You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2013/04/15 19:24:53 UTC

[01/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Updated Branches:
  refs/heads/ui-vm-affinity 51cfc0709 -> 267568483


Dedicate Public IP address range to an account


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8f865c5a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8f865c5a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8f865c5a

Branch: refs/heads/ui-vm-affinity
Commit: 8f865c5a901d1fb066709e1809fd5538af3eea11
Parents: 95cbb79
Author: Likitha Shetty <li...@citrix.com>
Authored: Mon Apr 8 22:44:45 2013 +0530
Committer: Likitha Shetty <li...@citrix.com>
Committed: Fri Apr 12 23:27:35 2013 +0530

----------------------------------------------------------------------
 .../cloud/configuration/ConfigurationService.java  |    6 +
 api/src/com/cloud/event/EventTypes.java            |    4 +
 .../admin/vlan/DedicatePublicIpRangeCmd.java       |  108 ++++
 .../admin/vlan/ReleasePublicIpRangeCmd.java        |   77 +++
 client/tomcatconf/commands.properties.in           |    2 +
 .../cloud/configuration/ConfigurationManager.java  |    5 +-
 .../configuration/ConfigurationManagerImpl.java    |  173 ++++++-
 .../src/com/cloud/network/NetworkManagerImpl.java  |   45 ++-
 .../src/com/cloud/network/NetworkServiceImpl.java  |    9 -
 .../src/com/cloud/server/ManagementServerImpl.java |    3 +
 server/src/com/cloud/user/AccountManagerImpl.java  |    6 +-
 .../configuration/ConfigurationManagerTest.java    |  413 +++++++++++++++
 .../cloud/vpc/MockConfigurationManagerImpl.java    |   23 +-
 test/integration/component/test_public_ip_range.py |  173 ++++++
 tools/marvin/marvin/integration/lib/base.py        |   19 +-
 15 files changed, 1017 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8f865c5a/api/src/com/cloud/configuration/ConfigurationService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/configuration/ConfigurationService.java b/api/src/com/cloud/configuration/ConfigurationService.java
index e63fcec..6937d0b 100644
--- a/api/src/com/cloud/configuration/ConfigurationService.java
+++ b/api/src/com/cloud/configuration/ConfigurationService.java
@@ -35,7 +35,9 @@ import org.apache.cloudstack.api.command.admin.offering.UpdateServiceOfferingCmd
 import org.apache.cloudstack.api.command.admin.pod.DeletePodCmd;
 import org.apache.cloudstack.api.command.admin.pod.UpdatePodCmd;
 import org.apache.cloudstack.api.command.admin.vlan.CreateVlanIpRangeCmd;
+import org.apache.cloudstack.api.command.admin.vlan.DedicatePublicIpRangeCmd;
 import org.apache.cloudstack.api.command.admin.vlan.DeleteVlanIpRangeCmd;
+import org.apache.cloudstack.api.command.admin.vlan.ReleasePublicIpRangeCmd;
 import org.apache.cloudstack.api.command.admin.zone.CreateZoneCmd;
 import org.apache.cloudstack.api.command.admin.zone.DeleteZoneCmd;
 import org.apache.cloudstack.api.command.admin.zone.UpdateZoneCmd;
@@ -234,6 +236,10 @@ public interface ConfigurationService {
 
     boolean deleteVlanIpRange(DeleteVlanIpRangeCmd cmd);
 
+    Vlan dedicatePublicIpRange(DedicatePublicIpRangeCmd cmd) throws ResourceAllocationException;
+
+    boolean releasePublicIpRange(ReleasePublicIpRangeCmd cmd);
+
     NetworkOffering createNetworkOffering(CreateNetworkOfferingCmd cmd);
 
     NetworkOffering updateNetworkOffering(UpdateNetworkOfferingCmd cmd);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8f865c5a/api/src/com/cloud/event/EventTypes.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/event/EventTypes.java b/api/src/com/cloud/event/EventTypes.java
index 6a26212..0ee7f40 100755
--- a/api/src/com/cloud/event/EventTypes.java
+++ b/api/src/com/cloud/event/EventTypes.java
@@ -226,6 +226,8 @@ public class EventTypes {
     // VLANs/IP ranges
     public static final String EVENT_VLAN_IP_RANGE_CREATE = "VLAN.IP.RANGE.CREATE";
     public static final String EVENT_VLAN_IP_RANGE_DELETE = "VLAN.IP.RANGE.DELETE";
+    public static final String EVENT_VLAN_IP_RANGE_DEDICATE = "VLAN.IP.RANGE.DEDICATE";
+    public static final String EVENT_VLAN_IP_RANGE_RELEASE = "VLAN.IP.RANGE.RELEASE";
 
     public static final String EVENT_STORAGE_IP_RANGE_CREATE = "STORAGE.IP.RANGE.CREATE";
     public static final String EVENT_STORAGE_IP_RANGE_DELETE = "STORAGE.IP.RANGE.DELETE";
@@ -545,6 +547,8 @@ public class EventTypes {
         // VLANs/IP ranges
         entityEventDetails.put(EVENT_VLAN_IP_RANGE_CREATE, Vlan.class.getName());
         entityEventDetails.put(EVENT_VLAN_IP_RANGE_DELETE,Vlan.class.getName());
+        entityEventDetails.put(EVENT_VLAN_IP_RANGE_DEDICATE, Vlan.class.getName());
+        entityEventDetails.put(EVENT_VLAN_IP_RANGE_RELEASE,Vlan.class.getName());
 
         entityEventDetails.put(EVENT_STORAGE_IP_RANGE_CREATE, StorageNetworkIpRange.class.getName());
         entityEventDetails.put(EVENT_STORAGE_IP_RANGE_DELETE, StorageNetworkIpRange.class.getName());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8f865c5a/api/src/org/apache/cloudstack/api/command/admin/vlan/DedicatePublicIpRangeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vlan/DedicatePublicIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vlan/DedicatePublicIpRangeCmd.java
new file mode 100755
index 0000000..e7b1105
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/command/admin/vlan/DedicatePublicIpRangeCmd.java
@@ -0,0 +1,108 @@
+// 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.vlan;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.DomainResponse;
+import org.apache.cloudstack.api.response.ProjectResponse;
+import org.apache.cloudstack.api.response.VlanIpRangeResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.log4j.Logger;
+
+import com.cloud.dc.Vlan;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.user.Account;
+
+@APICommand(name = "dedicatePublicIpRange", description="Dedicates a Public IP range to an account", responseObject=VlanIpRangeResponse.class)
+public class DedicatePublicIpRangeCmd extends BaseCmd {
+    public static final Logger s_logger = Logger.getLogger(DedicatePublicIpRangeCmd.class.getName());
+
+    private static final String s_name = "dedicatepubliciprangeresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = VlanIpRangeResponse.class,
+            required=true, description="the id of the VLAN IP range")
+    private Long id;
+
+    @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, required=true,
+            description="account who will own the VLAN")
+    private String accountName;
+
+    @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType = ProjectResponse.class,
+            description="project who will own the VLAN")
+    private Long projectId;
+
+    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType = DomainResponse.class,
+            required=true, description="domain ID of the account owning a VLAN")
+    private Long domainId;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getId() {
+        return id;
+    }
+
+    public String getAccountName() {
+        return accountName;
+    }
+
+    public Long getDomainId() {
+        return domainId;
+    }
+
+    public Long getProjectId() {
+        return projectId;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public long getEntityOwnerId() {
+        return Account.ACCOUNT_ID_SYSTEM;
+    }
+
+    @Override
+    public void execute() throws ResourceUnavailableException, ResourceAllocationException {
+        Vlan result = _configService.dedicatePublicIpRange(this);
+        if (result != null) {
+            VlanIpRangeResponse response = _responseGenerator.createVlanIpRangeResponse(result);
+            response.setResponseName(getCommandName());
+            this.setResponseObject(response);
+        } else {
+            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to dedicate vlan ip range");
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8f865c5a/api/src/org/apache/cloudstack/api/command/admin/vlan/ReleasePublicIpRangeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vlan/ReleasePublicIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vlan/ReleasePublicIpRangeCmd.java
new file mode 100644
index 0000000..91cc7d3
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/command/admin/vlan/ReleasePublicIpRangeCmd.java
@@ -0,0 +1,77 @@
+// 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.vlan;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.SuccessResponse;
+import org.apache.cloudstack.api.response.VlanIpRangeResponse;
+import org.apache.log4j.Logger;
+
+import com.cloud.user.Account;
+
+@APICommand(name = "releasePublicIpRange", description="Releases a Public IP range back to the system pool", responseObject=SuccessResponse.class)
+public class ReleasePublicIpRangeCmd extends BaseCmd {
+    public static final Logger s_logger = Logger.getLogger(ReleasePublicIpRangeCmd.class.getName());
+
+    private static final String s_name = "releasepubliciprangeresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = VlanIpRangeResponse.class,
+            required=true, description="the id of the Public IP range")
+    private Long id;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getId() {
+        return id;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public long getEntityOwnerId() {
+        return Account.ACCOUNT_ID_SYSTEM;
+    }
+
+    @Override
+    public void execute(){
+        boolean result = _configService.releasePublicIpRange(this);
+        if (result) {
+            SuccessResponse response = new SuccessResponse(getCommandName());
+            this.setResponseObject(response);
+        } else {
+            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to release public ip range");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8f865c5a/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in
index 4ce9fd3..798d226 100644
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@ -124,6 +124,8 @@ listDiskOfferings=15
 createVlanIpRange=1
 deleteVlanIpRange=1
 listVlanIpRanges=1
+dedicatePublicIpRange=1
+releasePublicIpRange=1
 
 #### address commands
 associateIpAddress=15

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8f865c5a/server/src/com/cloud/configuration/ConfigurationManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManager.java b/server/src/com/cloud/configuration/ConfigurationManager.java
old mode 100644
new mode 100755
index c5f65e9..d7faf19
--- a/server/src/com/cloud/configuration/ConfigurationManager.java
+++ b/server/src/com/cloud/configuration/ConfigurationManager.java
@@ -30,6 +30,7 @@ import com.cloud.dc.Vlan;
 import com.cloud.exception.ConcurrentOperationException;
 import com.cloud.exception.InsufficientCapacityException;
 import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.exception.ResourceAllocationException;
 import com.cloud.network.Network;
 import com.cloud.network.Network.Capability;
 import com.cloud.network.Network.Provider;
@@ -150,6 +151,8 @@ public interface ConfigurationManager extends ConfigurationService, Manager {
      */
     boolean deleteVlanAndPublicIpRange(long userId, long vlanDbId, Account caller);
 
+    boolean releasePublicIpRange(long userId, long vlanDbId, Account caller);
+
     /**
      * Converts a comma separated list of tags to a List
      * 
@@ -211,7 +214,7 @@ public interface ConfigurationManager extends ConfigurationService, Manager {
 
     ClusterVO getCluster(long id);
 
-    boolean deleteAccountSpecificVirtualRanges(long accountId);
+    boolean releaseAccountSpecificVirtualRanges(long accountId);
 
     /**
      * Edits a pod in the database. Will not allow you to edit pods that are being used anywhere in the system.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8f865c5a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index ceeae1e..fce3c01 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -56,7 +56,9 @@ import org.apache.cloudstack.api.command.admin.offering.UpdateServiceOfferingCmd
 import org.apache.cloudstack.api.command.admin.pod.DeletePodCmd;
 import org.apache.cloudstack.api.command.admin.pod.UpdatePodCmd;
 import org.apache.cloudstack.api.command.admin.vlan.CreateVlanIpRangeCmd;
+import org.apache.cloudstack.api.command.admin.vlan.DedicatePublicIpRangeCmd;
 import org.apache.cloudstack.api.command.admin.vlan.DeleteVlanIpRangeCmd;
+import org.apache.cloudstack.api.command.admin.vlan.ReleasePublicIpRangeCmd;
 import org.apache.cloudstack.api.command.admin.zone.CreateZoneCmd;
 import org.apache.cloudstack.api.command.admin.zone.DeleteZoneCmd;
 import org.apache.cloudstack.api.command.admin.zone.UpdateZoneCmd;
@@ -2306,9 +2308,6 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
             throw new InvalidParameterValueException("Gateway, netmask and zoneId have to be passed in for virtual and direct untagged networks");
         }
 
-        // if it's an account specific range, associate ip address list to the account
-        boolean associateIpRangeToAccount = false;
-
         if (forVirtualNetwork) {
             if (vlanOwner != null) {
 
@@ -2316,8 +2315,6 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
 
                 //check resource limits
                 _resourceLimitMgr.checkResourceLimit(vlanOwner, ResourceType.public_ip, accountIpRange);
-                
-                associateIpRangeToAccount = true;
             }
         }
 
@@ -2332,21 +2329,6 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
                 endIP, vlanGateway, vlanNetmask, vlanId, vlanOwner, startIPv6, endIPv6, ip6Gateway, ip6Cidr);
 
         txn.commit();
-        if (associateIpRangeToAccount) {
-            _networkMgr.associateIpAddressListToAccount(userId, vlanOwner.getId(), zoneId, vlan.getId(), null);
-        }
-
-        // Associate ips to the network
-        if (associateIpRangeToAccount) {
-            if (network.getState() == Network.State.Implemented) {
-                s_logger.debug("Applying ip associations for vlan id=" + vlanId + " in network " + network);
-                if (!_networkMgr.applyIpAssociations(network, false)) {
-                    s_logger.warn("Failed to apply ip associations for vlan id=1 as a part of add vlan range for account id=" + vlanOwner.getId());
-                }
-            } else {
-                s_logger.trace("Network id=" + network.getId() + " is not Implemented, no need to apply ipAssociations");
-            }
-        }
 
         return vlan;
     }
@@ -2699,6 +2681,149 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
     }
 
     @Override
+    @DB
+    @ActionEvent(eventType = EventTypes.EVENT_VLAN_IP_RANGE_DEDICATE, eventDescription = "dedicating vlan ip range", async = false)
+    public Vlan dedicatePublicIpRange(DedicatePublicIpRangeCmd cmd) throws ResourceAllocationException {
+        Long vlanDbId = cmd.getId();
+        String accountName = cmd.getAccountName();
+        Long domainId = cmd.getDomainId();
+        Long projectId = cmd.getProjectId();
+
+        // Check if account is valid
+        Account vlanOwner = null;
+        if (projectId != null) {
+            if (accountName != null) {
+                throw new InvalidParameterValueException("accountName and projectId are mutually exclusive");
+            }
+            Project project = _projectMgr.getProject(projectId);
+            if (project == null) {
+                throw new InvalidParameterValueException("Unable to find project by id " + projectId);
+            }
+            vlanOwner = _accountMgr.getAccount(project.getProjectAccountId());
+        }
+
+        if ((accountName != null) && (domainId != null)) {
+            vlanOwner = _accountDao.findActiveAccount(accountName, domainId);
+            if (vlanOwner == null) {
+                throw new InvalidParameterValueException("Please specify a valid account");
+            }
+        }
+
+        // Check if range is valid
+        VlanVO vlan = _vlanDao.findById(vlanDbId);
+        if (vlan == null) {
+            throw new InvalidParameterValueException("Please specify a valid Public IP range id");
+        }
+
+        // Check if range has already been dedicated
+        List<AccountVlanMapVO> maps = _accountVlanMapDao.listAccountVlanMapsByVlan(vlanDbId);
+        if (maps != null && !maps.isEmpty()) {
+            throw new InvalidParameterValueException("Specified Public IP range has already been dedicated");
+        }
+
+        // Verify that zone exists and is advanced
+        Long zoneId = vlan.getDataCenterId();
+        DataCenterVO zone = _zoneDao.findById(zoneId);
+        if (zone == null) {
+            throw new InvalidParameterValueException("Unable to find zone by id " + zoneId);
+        }
+        if (zone.getNetworkType() == NetworkType.Basic) {
+            throw new InvalidParameterValueException("Public IP range can be dedicated to an account only in the zone of type " + NetworkType.Advanced);
+        }
+
+        // Check Public IP resource limits
+        int accountPublicIpRange = _publicIpAddressDao.countIPs(zoneId, vlanDbId, false);
+        _resourceLimitMgr.checkResourceLimit(vlanOwner, ResourceType.public_ip, accountPublicIpRange);
+
+        // Check if any of the Public IP addresses is allocated to another account
+        List<IPAddressVO> ips = _publicIpAddressDao.listByVlanId(vlanDbId);
+        for (IPAddressVO ip : ips) {
+            Long allocatedToAccountId = ip.getAllocatedToAccountId();
+            if (allocatedToAccountId != null) {
+                Account accountAllocatedTo = _accountMgr.getActiveAccountById(allocatedToAccountId);
+                if (!accountAllocatedTo.getAccountName().equalsIgnoreCase(accountName))
+                    throw new InvalidParameterValueException("Public IP address in range is already allocated to another account");
+            }
+        }
+
+        Transaction txn = Transaction.currentTxn();
+        txn.start();
+
+        // Create an AccountVlanMapVO entry
+        AccountVlanMapVO accountVlanMapVO = new AccountVlanMapVO(vlanOwner.getId(), vlan.getId());
+        _accountVlanMapDao.persist(accountVlanMapVO);
+
+        txn.commit();
+
+        return vlan;
+    }
+
+    @Override
+    @ActionEvent(eventType = EventTypes.EVENT_VLAN_IP_RANGE_RELEASE, eventDescription = "releasing a public ip range", async = false)
+    public boolean releasePublicIpRange(ReleasePublicIpRangeCmd cmd) {
+        Long vlanDbId = cmd.getId();
+
+        VlanVO vlan = _vlanDao.findById(vlanDbId);
+        if (vlan == null) {
+            throw new InvalidParameterValueException("Please specify a valid IP range id.");
+        }
+
+        return releasePublicIpRange(vlanDbId, UserContext.current().getCallerUserId(), UserContext.current().getCaller());
+    }
+
+    @Override
+    @DB
+    public boolean releasePublicIpRange(long vlanDbId, long userId, Account caller) {
+        VlanVO vlan = _vlanDao.findById(vlanDbId);
+
+        List<AccountVlanMapVO> acctVln = _accountVlanMapDao.listAccountVlanMapsByVlan(vlanDbId);
+        // Verify range is dedicated
+        if (acctVln == null || acctVln.isEmpty()) {
+            throw new InvalidParameterValueException("Can't release Public IP range " + vlanDbId + " as it not dedicated to any account");
+        }
+
+        // Check if range has any allocated public IPs
+        long allocIpCount = _publicIpAddressDao.countIPs(vlan.getDataCenterId(), vlanDbId, true);
+        boolean success = true;
+        if (allocIpCount > 0) {
+            try {
+                vlan = _vlanDao.acquireInLockTable(vlanDbId, 30);
+                if (vlan == null) {
+                    throw new CloudRuntimeException("Unable to acquire vlan configuration: " + vlanDbId);
+                }
+                if (s_logger.isDebugEnabled()) {
+                    s_logger.debug("lock vlan " + vlanDbId + " is acquired");
+                }
+                List<IPAddressVO> ips = _publicIpAddressDao.listByVlanId(vlanDbId);
+                for (IPAddressVO ip : ips) {
+                    // Disassociate allocated IP's that are not in use
+                    if ( !ip.isOneToOneNat() && !(ip.isSourceNat() && _networkModel.getNetwork(ip.getAssociatedWithNetworkId()) != null) &&
+                            !(_firewallDao.countRulesByIpId(ip.getId()) > 0) ) {
+                        if (s_logger.isDebugEnabled()) {
+                            s_logger.debug("Releasing Public IP addresses" + ip  +" of vlan " + vlanDbId + " as part of Public IP" +
+                                    " range release to the system pool");
+                        }
+                        success = success && _networkMgr.disassociatePublicIpAddress(ip.getId(), userId, caller);
+                    }
+                }
+                if (!success) {
+                    s_logger.warn("Some Public IP addresses that were not in use failed to be released as a part of" +
+                            " vlan " + vlanDbId + "release to the system pool");
+                }
+            } finally {
+                _vlanDao.releaseFromLockTable(vlanDbId);
+            }
+        }
+
+        // A Public IP range can only be dedicated to one account at a time
+        if (_accountVlanMapDao.remove(acctVln.get(0).getId())) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    @Override
     public List<String> csvTagsToList(String tags) {
         List<String> tagsList = new ArrayList<String>();
 
@@ -3957,14 +4082,14 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
 
     @Override
     @DB
-    public boolean deleteAccountSpecificVirtualRanges(long accountId) {
+    public boolean releaseAccountSpecificVirtualRanges(long accountId) {
         List<AccountVlanMapVO> maps = _accountVlanMapDao.listAccountVlanMapsByAccount(accountId);
         boolean result = true;
         if (maps != null && !maps.isEmpty()) {
             Transaction txn = Transaction.currentTxn();
             txn.start();
             for (AccountVlanMapVO map : maps) {
-                if (!deleteVlanAndPublicIpRange(_accountMgr.getSystemUser().getId(), map.getVlanDbId(), 
+                if (!releasePublicIpRange(map.getVlanDbId(), _accountMgr.getSystemUser().getId(),
                         _accountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM))) {
                     result = false;
                 }
@@ -3972,10 +4097,10 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
             if (result) {
                 txn.commit();
             } else {
-                s_logger.error("Failed to delete account specific virtual ip ranges for account id=" + accountId);
+                s_logger.error("Failed to release account specific virtual ip ranges for account id=" + accountId);
             }
         } else {
-            s_logger.trace("Account id=" + accountId + " has no account specific virtual ip ranges, nothing to delete");
+            s_logger.trace("Account id=" + accountId + " has no account specific virtual ip ranges, nothing to release");
         }
         return result;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8f865c5a/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index a97f2ce..5b60466 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -348,7 +348,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
     }
 
     @DB
-    public PublicIp fetchNewPublicIp(long dcId, Long podId, Long vlanDbId, Account owner, VlanType vlanUse,
+    public PublicIp fetchNewPublicIp(long dcId, Long podId, List<Long> vlanDbIds, Account owner, VlanType vlanUse,
             Long guestNetworkId, boolean sourceNat, boolean assign, String requestedIp, boolean isSystem, Long vpcId)
             throws InsufficientAddressCapacityException {
         StringBuilder errorMessage = new StringBuilder("Unable to get ip adress in ");
@@ -364,9 +364,9 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
             errorMessage.append(" zone id=" + dcId);
         }
 
-        if (vlanDbId != null) {
-            sc.addAnd("vlanId", SearchCriteria.Op.EQ, vlanDbId);
-            errorMessage.append(", vlanId id=" + vlanDbId);
+        if ( vlanDbIds != null && !vlanDbIds.isEmpty() ) {
+            sc.setParameters("vlanId", vlanDbIds.toArray());
+            errorMessage.append(", vlanId id=" + vlanDbIds.toArray());
         }
 
         sc.setParameters("dc", dcId);
@@ -526,14 +526,14 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
             }
 
             // If account has Account specific ip ranges, try to allocate ip from there
-            Long vlanId = null;
+            List<Long> vlanIds = new ArrayList<Long>();
             List<AccountVlanMapVO> maps = _accountVlanMapDao.listAccountVlanMapsByAccount(ownerId);
             if (maps != null && !maps.isEmpty()) {
-                vlanId = maps.get(0).getVlanDbId();
+                vlanIds.add(maps.get(0).getVlanDbId());
             }
 
 
-            ip = fetchNewPublicIp(dcId, null, vlanId, owner, VlanType.VirtualNetwork, guestNtwkId,
+            ip = fetchNewPublicIp(dcId, null, vlanIds, owner, VlanType.VirtualNetwork, guestNtwkId,
                     isSourceNat, false, null, false, vpcId);
             IPAddressVO publicIp = ip.ip();
 
@@ -669,6 +669,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
 
         VlanType vlanType = VlanType.VirtualNetwork;
         boolean assign = false;
+        boolean allocateFromDedicatedRange = false;
 
         if (Grouping.AllocationState.Disabled == zone.getAllocationState() && !_accountMgr.isRootAdmin(caller.getType())) {
             // zone is of type DataCenter. See DataCenterVO.java.
@@ -702,8 +703,32 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
 
             txn.start();
 
-            ip = fetchNewPublicIp(zone.getId(), null, null, ipOwner, vlanType, null,
-                    false, assign, null, isSystem, null);
+            // If account has dedicated Public IP ranges, allocate IP from the dedicated range
+            List<Long> vlanDbIds = new ArrayList<Long>();
+            List<AccountVlanMapVO> maps = _accountVlanMapDao.listAccountVlanMapsByAccount(ipOwner.getId());
+            for (AccountVlanMapVO map : maps) {
+                vlanDbIds.add(map.getVlanDbId());
+            }
+            if (vlanDbIds != null && !vlanDbIds.isEmpty()) {
+                allocateFromDedicatedRange = true;
+            }
+
+            try {
+                if (allocateFromDedicatedRange) {
+                    ip = fetchNewPublicIp(zone.getId(), null, vlanDbIds, ipOwner, vlanType, null,
+                            false, assign, null, isSystem, null);
+                }
+            } catch(InsufficientAddressCapacityException e) {
+                s_logger.warn("All IPs dedicated to account " + ipOwner.getId() + " has been acquired." +
+                        " Now acquiring from the system pool");
+                txn.close();
+                allocateFromDedicatedRange = false;
+            }
+
+            if (!allocateFromDedicatedRange) {
+                ip = fetchNewPublicIp(zone.getId(), null, null, ipOwner, vlanType, null, false, assign, null,
+                       isSystem, null);
+            }
 
             if (ip == null) {
 
@@ -1082,7 +1107,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
         AssignIpAddressSearch = _ipAddressDao.createSearchBuilder();
         AssignIpAddressSearch.and("dc", AssignIpAddressSearch.entity().getDataCenterId(), Op.EQ);
         AssignIpAddressSearch.and("allocated", AssignIpAddressSearch.entity().getAllocatedTime(), Op.NULL);
-        AssignIpAddressSearch.and("vlanId", AssignIpAddressSearch.entity().getVlanId(), Op.EQ);
+        AssignIpAddressSearch.and("vlanId", AssignIpAddressSearch.entity().getVlanId(), Op.IN);
         SearchBuilder<VlanVO> vlanSearch = _vlanDao.createSearchBuilder();
         vlanSearch.and("type", vlanSearch.entity().getVlanType(), Op.EQ);
         vlanSearch.and("networkId", vlanSearch.entity().getNetworkId(), Op.EQ);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8f865c5a/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index 4eb620c..a8cbaa7 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -697,15 +697,6 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService {
             throw new IllegalArgumentException("only ip addresses that belong to a virtual network may be disassociated.");
         }
 
-        // Check for account wide pool. It will have an entry for account_vlan_map.
-        if (_accountVlanMapDao.findAccountVlanMap(ipVO.getAllocatedToAccountId(), ipVO.getVlanId()) != null) {            
-            //see IPaddressVO.java
-            InvalidParameterValueException ex = new InvalidParameterValueException("Sepcified IP address uuid belongs to" +
-                    " Account wide IP pool and cannot be disassociated");
-            ex.addProxyObject("user_ip_address", ipAddressId, "ipAddressId");
-            throw ex;
-        }
-
         // don't allow releasing system ip address
         if (ipVO.getSystem()) {
             InvalidParameterValueException ex = new InvalidParameterValueException("Can't release system IP address with specified id");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8f865c5a/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index b869d1e..d9a4317 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -59,6 +59,7 @@ import org.apache.cloudstack.api.command.admin.storage.*;
 import org.apache.cloudstack.api.command.admin.systemvm.*;
 import org.apache.cloudstack.api.command.admin.usage.*;
 import org.apache.cloudstack.api.command.admin.user.*;
+import org.apache.cloudstack.api.command.admin.vlan.*;
 import org.apache.cloudstack.api.command.admin.vpc.*;
 import org.apache.cloudstack.api.command.user.autoscale.*;
 import org.apache.cloudstack.api.command.user.firewall.*;
@@ -2037,6 +2038,8 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
         cmdList.add(CreateVlanIpRangeCmd.class);
         cmdList.add(DeleteVlanIpRangeCmd.class);
         cmdList.add(ListVlanIpRangesCmd.class);
+        cmdList.add(DedicatePublicIpRangeCmd.class);
+        cmdList.add(ReleasePublicIpRangeCmd.class);
         cmdList.add(AssignVMCmd.class);
         cmdList.add(MigrateVMCmd.class);
         cmdList.add(RecoverVMCmd.class);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8f865c5a/server/src/com/cloud/user/AccountManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java
index fe714c5..e74c491 100755
--- a/server/src/com/cloud/user/AccountManagerImpl.java
+++ b/server/src/com/cloud/user/AccountManagerImpl.java
@@ -690,13 +690,13 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
                 accountCleanupNeeded = true;
             }
 
-            // delete account specific Virtual vlans (belong to system Public Network) - only when networks are cleaned
+            // release account specific Virtual vlans (belong to system Public Network) - only when networks are cleaned
             // up successfully
             if (networksDeleted) {
-                if (!_configMgr.deleteAccountSpecificVirtualRanges(accountId)) {
+                if (!_configMgr.releaseAccountSpecificVirtualRanges(accountId)) {
                     accountCleanupNeeded = true;
                 } else {
-                    s_logger.debug("Account specific Virtual IP ranges " + " are successfully deleted as a part of account id=" + accountId + " cleanup.");
+                    s_logger.debug("Account specific Virtual IP ranges " + " are successfully released as a part of account id=" + accountId + " cleanup.");
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8f865c5a/server/test/com/cloud/configuration/ConfigurationManagerTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/configuration/ConfigurationManagerTest.java b/server/test/com/cloud/configuration/ConfigurationManagerTest.java
new file mode 100755
index 0000000..ee98d53
--- /dev/null
+++ b/server/test/com/cloud/configuration/ConfigurationManagerTest.java
@@ -0,0 +1,413 @@
+// 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.configuration;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+import java.lang.reflect.Field;
+
+import org.apache.cloudstack.api.command.admin.vlan.DedicatePublicIpRangeCmd;
+import org.apache.cloudstack.api.command.admin.vlan.ReleasePublicIpRangeCmd;
+import org.apache.log4j.Logger;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+import com.cloud.configuration.Resource.ResourceType;
+import com.cloud.dc.AccountVlanMapVO;
+import com.cloud.dc.DataCenterVO;
+import com.cloud.dc.Vlan;
+import com.cloud.dc.VlanVO;
+import com.cloud.dc.DataCenter.NetworkType;
+import com.cloud.dc.dao.AccountVlanMapDao;
+import com.cloud.dc.dao.DataCenterDao;
+import com.cloud.dc.dao.VlanDao;
+import com.cloud.network.NetworkManager;
+import com.cloud.network.dao.FirewallRulesDao;
+import com.cloud.network.dao.IPAddressDao;
+import com.cloud.network.dao.IPAddressVO;
+import com.cloud.projects.ProjectManager;
+import com.cloud.user.Account;
+import com.cloud.user.AccountManager;
+import com.cloud.user.AccountVO;
+import com.cloud.user.ResourceLimitService;
+import com.cloud.user.UserContext;
+import com.cloud.user.dao.AccountDao;
+import com.cloud.utils.db.Transaction;
+import com.cloud.utils.net.Ip;
+
+import junit.framework.Assert;
+
+import static org.mockito.Matchers.*;
+import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.doNothing;
+
+public class ConfigurationManagerTest {
+
+    private static final Logger s_logger = Logger.getLogger(ConfigurationManagerTest.class);
+
+    ConfigurationManagerImpl configurationMgr = new ConfigurationManagerImpl();
+
+    DedicatePublicIpRangeCmd dedicatePublicIpRangesCmd = new DedicatePublicIpRangeCmdExtn();
+    Class<?> _dedicatePublicIpRangeClass = dedicatePublicIpRangesCmd.getClass().getSuperclass();
+
+    ReleasePublicIpRangeCmd releasePublicIpRangesCmd = new ReleasePublicIpRangeCmdExtn();
+    Class<?> _releasePublicIpRangeClass = releasePublicIpRangesCmd.getClass().getSuperclass();
+
+    @Mock AccountManager _accountMgr;
+    @Mock ProjectManager _projectMgr;
+    @Mock ResourceLimitService _resourceLimitMgr;
+    @Mock NetworkManager _networkMgr;
+    @Mock AccountDao _accountDao;
+    @Mock VlanDao _vlanDao;
+    @Mock AccountVlanMapDao _accountVlanMapDao;
+    @Mock IPAddressDao _publicIpAddressDao;
+    @Mock DataCenterDao _zoneDao;
+    @Mock FirewallRulesDao _firewallDao;
+
+    VlanVO vlan = new VlanVO(Vlan.VlanType.VirtualNetwork, "vlantag", "vlangateway","vlannetmask", 1L, "iprange", 1L, 1L, null, null, null);
+
+    @Before
+    public void setup() throws Exception {
+        MockitoAnnotations.initMocks(this);
+        configurationMgr._accountMgr = _accountMgr;
+        configurationMgr._projectMgr = _projectMgr;
+        configurationMgr._resourceLimitMgr = _resourceLimitMgr;
+        configurationMgr._networkMgr = _networkMgr;
+        configurationMgr._accountDao = _accountDao;
+        configurationMgr._vlanDao = _vlanDao;
+        configurationMgr._accountVlanMapDao = _accountVlanMapDao;
+        configurationMgr._publicIpAddressDao = _publicIpAddressDao;
+        configurationMgr._zoneDao = _zoneDao;
+        configurationMgr._firewallDao = _firewallDao;
+
+        Account account = (Account) new AccountVO("testaccount", 1, "networkdomain", (short) 0, UUID.randomUUID().toString());
+        when(configurationMgr._accountMgr.getAccount(anyLong())).thenReturn(account);
+        when(configurationMgr._accountDao.findActiveAccount(anyString(), anyLong())).thenReturn(account);
+        when(configurationMgr._accountMgr.getActiveAccountById(anyLong())).thenReturn(account);
+
+        when(configurationMgr._publicIpAddressDao.countIPs(anyLong(), anyLong(), anyBoolean())).thenReturn(1);
+
+        doNothing().when(configurationMgr._resourceLimitMgr).checkResourceLimit(any(Account.class),
+                any(ResourceType.class), anyLong());
+
+        when(configurationMgr._accountVlanMapDao.persist(any(AccountVlanMapVO.class))).thenReturn(new AccountVlanMapVO());
+
+        when(configurationMgr._vlanDao.acquireInLockTable(anyLong(), anyInt())).thenReturn(vlan);
+
+        UserContext.registerContext(1, account, null, true);
+
+        Field dedicateIdField = _dedicatePublicIpRangeClass.getDeclaredField("id");
+        dedicateIdField.setAccessible(true);
+        dedicateIdField.set(dedicatePublicIpRangesCmd, 1L);
+
+        Field accountNameField = _dedicatePublicIpRangeClass.getDeclaredField("accountName");
+        accountNameField.setAccessible(true);
+        accountNameField.set(dedicatePublicIpRangesCmd, "accountname");
+
+        Field projectIdField = _dedicatePublicIpRangeClass.getDeclaredField("projectId");
+        projectIdField.setAccessible(true);
+        projectIdField.set(dedicatePublicIpRangesCmd, null);
+
+        Field domainIdField = _dedicatePublicIpRangeClass.getDeclaredField("domainId");
+        domainIdField.setAccessible(true);
+        domainIdField.set(dedicatePublicIpRangesCmd, 1L);
+
+        Field releaseIdField = _releasePublicIpRangeClass.getDeclaredField("id");
+        releaseIdField.setAccessible(true);
+        releaseIdField.set(releasePublicIpRangesCmd, 1L);
+    }
+
+    @Test
+    public void testDedicatePublicIpRange() throws Exception {
+
+        s_logger.info("Running tests for DedicatePublicIpRange API");
+
+        /*
+         * TEST 1: given valid parameters DedicatePublicIpRange should succeed
+         */
+        runDedicatePublicIpRangePostiveTest();
+
+        /*
+         * TEST 2: given invalid public ip range DedicatePublicIpRange should fail
+         */
+        runDedicatePublicIpRangeInvalidRange();
+         /*
+         * TEST 3: given public IP range that is already dedicated to a different account DedicatePublicIpRange should fail
+         */
+        runDedicatePublicIpRangeDedicatedRange();
+
+         /*
+         * TEST 4: given zone is of type Basic DedicatePublicIpRange should fail
+         */
+        runDedicatePublicIpRangeInvalidZone();
+
+        /*
+         * TEST 5: given range is already allocated to a different account DedicatePublicIpRange should fail
+         */
+        runDedicatePublicIpRangeIPAdressAllocated();
+    }
+
+    @Test
+    public void testReleasePublicIpRange() throws Exception {
+
+        s_logger.info("Running tests for DedicatePublicIpRange API");
+
+        /*
+         * TEST 1: given valid parameters and no allocated public ip's in the range ReleasePublicIpRange should succeed
+         */
+        runReleasePublicIpRangePostiveTest1();
+
+        /*
+         * TEST 2: given valid parameters ReleasePublicIpRange should succeed
+         */
+        runReleasePublicIpRangePostiveTest2();
+
+        /*
+         * TEST 3: given range doesn't exist
+         */
+        runReleasePublicIpRangeInvalidIpRange();
+
+        /*
+         * TEST 4: given range is not dedicated to any account
+         */
+        runReleaseNonDedicatedPublicIpRange();
+    }
+
+    void runDedicatePublicIpRangePostiveTest() throws Exception {
+        Transaction txn = Transaction.open("runDedicatePublicIpRangePostiveTest");
+
+        when(configurationMgr._vlanDao.findById(anyLong())).thenReturn(vlan);
+
+        when(configurationMgr._accountVlanMapDao.listAccountVlanMapsByAccount(anyLong())).thenReturn(null);
+
+        DataCenterVO dc = new DataCenterVO(UUID.randomUUID().toString(), "test", "8.8.8.8", null, "10.0.0.1", null,  "10.0.0.1/24",
+                null, null, NetworkType.Advanced, null, null, true,  true, null, null);
+        when(configurationMgr._zoneDao.findById(anyLong())).thenReturn(dc);
+
+        List<IPAddressVO> ipAddressList = new ArrayList<IPAddressVO>();
+        IPAddressVO ipAddress = new IPAddressVO(new Ip("75.75.75.75"), 1, 0xaabbccddeeffL, 10, false);
+        ipAddressList.add(ipAddress);
+        when(configurationMgr._publicIpAddressDao.listByVlanId(anyLong())).thenReturn(ipAddressList);
+
+        try {
+            Vlan result = configurationMgr.dedicatePublicIpRange(dedicatePublicIpRangesCmd);
+            Assert.assertNotNull(result);
+        } catch (Exception e) {
+            s_logger.info("exception in testing runDedicatePublicIpRangePostiveTest message: " + e.toString());
+        } finally {
+            txn.close("runDedicatePublicIpRangePostiveTest");
+        }
+    }
+
+    void runDedicatePublicIpRangeInvalidRange() throws Exception {
+        Transaction txn = Transaction.open("runDedicatePublicIpRangeInvalidRange");
+
+        when(configurationMgr._vlanDao.findById(anyLong())).thenReturn(null);
+        try {
+            configurationMgr.dedicatePublicIpRange(dedicatePublicIpRangesCmd);
+        } catch (Exception e) {
+            Assert.assertTrue(e.getMessage().contains("Please specify a valid Public IP range id"));
+        } finally {
+            txn.close("runDedicatePublicIpRangeInvalidRange");
+        }
+    }
+
+    void runDedicatePublicIpRangeDedicatedRange() throws Exception {
+        Transaction txn = Transaction.open("runDedicatePublicIpRangeDedicatedRange");
+
+        when(configurationMgr._vlanDao.findById(anyLong())).thenReturn(vlan);
+
+        // public ip range is already dedicated
+        List<AccountVlanMapVO> accountVlanMaps = new ArrayList<AccountVlanMapVO>();
+        AccountVlanMapVO accountVlanMap = new AccountVlanMapVO(1, 1);
+        accountVlanMaps.add(accountVlanMap);
+        when(configurationMgr._accountVlanMapDao.listAccountVlanMapsByVlan(anyLong())).thenReturn(accountVlanMaps);
+
+        DataCenterVO dc = new DataCenterVO(UUID.randomUUID().toString(), "test", "8.8.8.8", null, "10.0.0.1", null,  "10.0.0.1/24",
+                null, null, NetworkType.Advanced, null, null, true,  true, null, null);
+        when(configurationMgr._zoneDao.findById(anyLong())).thenReturn(dc);
+
+        List<IPAddressVO> ipAddressList = new ArrayList<IPAddressVO>();
+        IPAddressVO ipAddress = new IPAddressVO(new Ip("75.75.75.75"), 1, 0xaabbccddeeffL, 10, false);
+        ipAddressList.add(ipAddress);
+        when(configurationMgr._publicIpAddressDao.listByVlanId(anyLong())).thenReturn(ipAddressList);
+
+        try {
+            configurationMgr.dedicatePublicIpRange(dedicatePublicIpRangesCmd);
+        } catch (Exception e) {
+            Assert.assertTrue(e.getMessage().contains("Public IP range has already been dedicated"));
+        } finally {
+            txn.close("runDedicatePublicIpRangePublicIpRangeDedicated");
+        }
+    }
+
+    void runDedicatePublicIpRangeInvalidZone() throws Exception {
+        Transaction txn = Transaction.open("runDedicatePublicIpRangeInvalidZone");
+
+        when(configurationMgr._vlanDao.findById(anyLong())).thenReturn(vlan);
+
+        when(configurationMgr._accountVlanMapDao.listAccountVlanMapsByVlan(anyLong())).thenReturn(null);
+
+        // public ip range belongs to zone of type basic
+        DataCenterVO dc = new DataCenterVO(UUID.randomUUID().toString(), "test", "8.8.8.8", null, "10.0.0.1", null,  "10.0.0.1/24",
+                null, null, NetworkType.Basic, null, null, true,  true, null, null);
+        when(configurationMgr._zoneDao.findById(anyLong())).thenReturn(dc);
+
+        List<IPAddressVO> ipAddressList = new ArrayList<IPAddressVO>();
+        IPAddressVO ipAddress = new IPAddressVO(new Ip("75.75.75.75"), 1, 0xaabbccddeeffL, 10, false);
+        ipAddressList.add(ipAddress);
+        when(configurationMgr._publicIpAddressDao.listByVlanId(anyLong())).thenReturn(ipAddressList);
+
+        try {
+            configurationMgr.dedicatePublicIpRange(dedicatePublicIpRangesCmd);
+        } catch (Exception e) {
+            Assert.assertTrue(e.getMessage().contains("Public IP range can be dedicated to an account only in the zone of type Advanced"));
+        } finally {
+            txn.close("runDedicatePublicIpRangeInvalidZone");
+        }
+    }
+
+    void runDedicatePublicIpRangeIPAdressAllocated() throws Exception {
+        Transaction txn = Transaction.open("runDedicatePublicIpRangeIPAdressAllocated");
+
+        when(configurationMgr._vlanDao.findById(anyLong())).thenReturn(vlan);
+
+        when(configurationMgr._accountVlanMapDao.listAccountVlanMapsByAccount(anyLong())).thenReturn(null);
+
+        DataCenterVO dc = new DataCenterVO(UUID.randomUUID().toString(), "test", "8.8.8.8", null, "10.0.0.1", null,  "10.0.0.1/24",
+                null, null, NetworkType.Advanced, null, null, true,  true, null, null);
+        when(configurationMgr._zoneDao.findById(anyLong())).thenReturn(dc);
+
+        // one of the ip addresses of the range is allocated to different account
+        List<IPAddressVO> ipAddressList = new ArrayList<IPAddressVO>();
+        IPAddressVO ipAddress = new IPAddressVO(new Ip("75.75.75.75"), 1, 0xaabbccddeeffL, 10, false);
+        ipAddress.setAllocatedToAccountId(1L);
+        ipAddressList.add(ipAddress);
+        when(configurationMgr._publicIpAddressDao.listByVlanId(anyLong())).thenReturn(ipAddressList);
+
+        try {
+            configurationMgr.dedicatePublicIpRange(dedicatePublicIpRangesCmd);
+        } catch (Exception e) {
+            Assert.assertTrue(e.getMessage().contains("Public IP address in range is already allocated to another account"));
+        } finally {
+            txn.close("runDedicatePublicIpRangeIPAdressAllocated");
+        }
+    }
+
+    void runReleasePublicIpRangePostiveTest1() throws Exception {
+        Transaction txn = Transaction.open("runReleasePublicIpRangePostiveTest1");
+
+        when(configurationMgr._vlanDao.findById(anyLong())).thenReturn(vlan);
+
+        List<AccountVlanMapVO> accountVlanMaps = new ArrayList<AccountVlanMapVO>();
+        AccountVlanMapVO accountVlanMap = new AccountVlanMapVO(1, 1);
+        accountVlanMaps.add(accountVlanMap);
+        when(configurationMgr._accountVlanMapDao.listAccountVlanMapsByVlan(anyLong())).thenReturn(accountVlanMaps);
+
+        // no allocated ip's
+        when(configurationMgr._publicIpAddressDao.countIPs(anyLong(), anyLong(), anyBoolean())).thenReturn(0);
+
+        when(configurationMgr._accountVlanMapDao.remove(anyLong())).thenReturn(true);
+        try {
+            Boolean result = configurationMgr.releasePublicIpRange(releasePublicIpRangesCmd);
+            Assert.assertTrue(result);
+        } catch (Exception e) {
+            s_logger.info("exception in testing runReleasePublicIpRangePostiveTest1 message: " + e.toString());
+        } finally {
+            txn.close("runReleasePublicIpRangePostiveTest1");
+        }
+    }
+
+    void runReleasePublicIpRangePostiveTest2() throws Exception {
+        Transaction txn = Transaction.open("runReleasePublicIpRangePostiveTest2");
+
+        when(configurationMgr._vlanDao.findById(anyLong())).thenReturn(vlan);
+
+        List<AccountVlanMapVO> accountVlanMaps = new ArrayList<AccountVlanMapVO>();
+        AccountVlanMapVO accountVlanMap = new AccountVlanMapVO(1, 1);
+        accountVlanMaps.add(accountVlanMap);
+        when(configurationMgr._accountVlanMapDao.listAccountVlanMapsByVlan(anyLong())).thenReturn(accountVlanMaps);
+
+        when(configurationMgr._publicIpAddressDao.countIPs(anyLong(), anyLong(), anyBoolean())).thenReturn(1);
+
+        List<IPAddressVO> ipAddressList = new ArrayList<IPAddressVO>();
+        IPAddressVO ipAddress = new IPAddressVO(new Ip("75.75.75.75"), 1, 0xaabbccddeeffL, 10, false);
+        ipAddressList.add(ipAddress);
+        when(configurationMgr._publicIpAddressDao.listByVlanId(anyLong())).thenReturn(ipAddressList);
+
+        when(configurationMgr._firewallDao.countRulesByIpId(anyLong())).thenReturn(0L);
+
+        when(configurationMgr._networkMgr.disassociatePublicIpAddress(anyLong(), anyLong(), any(Account.class))).thenReturn(true);
+
+        when(configurationMgr._vlanDao.releaseFromLockTable(anyLong())).thenReturn(true);
+
+        when(configurationMgr._accountVlanMapDao.remove(anyLong())).thenReturn(true);
+        try {
+            Boolean result = configurationMgr.releasePublicIpRange(releasePublicIpRangesCmd);
+            Assert.assertTrue(result);
+        } catch (Exception e) {
+            s_logger.info("exception in testing runReleasePublicIpRangePostiveTest2 message: " + e.toString());
+        } finally {
+            txn.close("runReleasePublicIpRangePostiveTest2");
+        }
+    }
+
+    void runReleasePublicIpRangeInvalidIpRange() throws Exception {
+        Transaction txn = Transaction.open("runReleasePublicIpRangeInvalidIpRange");
+
+        when(configurationMgr._vlanDao.findById(anyLong())).thenReturn(null);
+        try {
+            configurationMgr.releasePublicIpRange(releasePublicIpRangesCmd);
+        } catch (Exception e) {
+            Assert.assertTrue(e.getMessage().contains("Please specify a valid IP range id"));
+        } finally {
+            txn.close("runReleasePublicIpRangeInvalidIpRange");
+        }
+    }
+
+    void runReleaseNonDedicatedPublicIpRange() throws Exception {
+        Transaction txn = Transaction.open("runReleaseNonDedicatedPublicIpRange");
+
+        when(configurationMgr._vlanDao.findById(anyLong())).thenReturn(vlan);
+
+        when(configurationMgr._accountVlanMapDao.listAccountVlanMapsByVlan(anyLong())).thenReturn(null);
+        try {
+            configurationMgr.releasePublicIpRange(releasePublicIpRangesCmd);
+        } catch (Exception e) {
+            Assert.assertTrue(e.getMessage().contains("as it not dedicated to any account"));
+        } finally {
+            txn.close("runReleaseNonDedicatedPublicIpRange");
+        }
+    }
+
+
+    public class DedicatePublicIpRangeCmdExtn extends DedicatePublicIpRangeCmd {
+        public long getEntityOwnerId() {
+            return 1;
+        }
+    }
+
+    public class ReleasePublicIpRangeCmdExtn extends ReleasePublicIpRangeCmd {
+        public long getEntityOwnerId() {
+            return 1;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8f865c5a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
old mode 100644
new mode 100755
index b0063fa..a03e361
--- a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
@@ -40,7 +40,9 @@ import org.apache.cloudstack.api.command.admin.offering.UpdateServiceOfferingCmd
 import org.apache.cloudstack.api.command.admin.pod.DeletePodCmd;
 import org.apache.cloudstack.api.command.admin.pod.UpdatePodCmd;
 import org.apache.cloudstack.api.command.admin.vlan.CreateVlanIpRangeCmd;
+import org.apache.cloudstack.api.command.admin.vlan.DedicatePublicIpRangeCmd;
 import org.apache.cloudstack.api.command.admin.vlan.DeleteVlanIpRangeCmd;
+import org.apache.cloudstack.api.command.admin.vlan.ReleasePublicIpRangeCmd;
 import org.apache.cloudstack.api.command.admin.zone.CreateZoneCmd;
 import org.apache.cloudstack.api.command.admin.zone.DeleteZoneCmd;
 import org.apache.cloudstack.api.command.admin.zone.UpdateZoneCmd;
@@ -544,7 +546,7 @@ public class MockConfigurationManagerImpl extends ManagerBase implements Configu
      * @see com.cloud.configuration.ConfigurationManager#deleteAccountSpecificVirtualRanges(long)
      */
     @Override
-    public boolean deleteAccountSpecificVirtualRanges(long accountId) {
+    public boolean releaseAccountSpecificVirtualRanges(long accountId) {
         // TODO Auto-generated method stub
         return false;
     }
@@ -613,5 +615,24 @@ public class MockConfigurationManagerImpl extends ManagerBase implements Configu
         return null;
     }
 
+	@Override
+	public Vlan dedicatePublicIpRange(DedicatePublicIpRangeCmd cmd)
+			throws ResourceAllocationException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean releasePublicIpRange(ReleasePublicIpRangeCmd cmd) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean releasePublicIpRange(long userId, long vlanDbId,
+			Account caller) {
+		// TODO Auto-generated method stub
+		return false;
+	}
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8f865c5a/test/integration/component/test_public_ip_range.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_public_ip_range.py b/test/integration/component/test_public_ip_range.py
new file mode 100755
index 0000000..f2c967f
--- /dev/null
+++ b/test/integration/component/test_public_ip_range.py
@@ -0,0 +1,173 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+""" P1 tests for Dedicating Public IP addresses
+"""
+#Import Local Modules
+import marvin
+from nose.plugins.attrib import attr
+from marvin.cloudstackTestCase import *
+from marvin.cloudstackAPI import *
+from marvin.integration.lib.utils import *
+from marvin.integration.lib.base import *
+from marvin.integration.lib.common import *
+import datetime
+
+class Services:
+    """Test Dedicating Public IP addresses
+    """
+
+    def __init__(self):
+        self.services = {
+                        "domain": {
+                                   "name": "Domain",
+                                   },
+                        "account": {
+                                    "email": "test@test.com",
+                                    "firstname": "Test",
+                                    "lastname": "User",
+                                    "username": "test",
+                                    "password": "password",
+                         },
+                        "gateway": "10.102.197.1",
+                        "netmask": "255.255.255.0",
+                        "forvirtualnetwork": "true",
+                        "startip": "10.102.197.70",
+                        "endip": "10.102.197.73",
+                        "zoneid": "1",
+                        "podid": "",
+                        "vlan": "101",
+                    }
+
+class TesDedicatePublicIPRange(cloudstackTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        cls.api_client = super(TesDedicatePublicIPRange, cls).getClsTestClient().getApiClient()
+        cls.services = Services().services
+        # Get Zone, Domain
+        cls.domain = get_domain(cls.api_client, cls.services)
+        cls.zone = get_zone(cls.api_client, cls.services)
+
+        # Create Account
+        cls.account = Account.create(
+                            cls.api_client,
+                            cls.services["account"],
+                            domainid=cls.domain.id
+                            )
+        cls._cleanup = [
+                        cls.account,
+                        ]
+        return
+
+    @classmethod
+    def tearDownClass(cls):
+        try:
+            # Cleanup resources used
+            cleanup_resources(cls.api_client, cls._cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
+    def setUp(self):
+        self.apiclient = self.testClient.getApiClient()
+        self.dbclient = self.testClient.getDbConnection()
+        self.cleanup = []
+        return
+
+    def tearDown(self):
+        try:
+            # Clean up
+            cleanup_resources(self.apiclient, self.cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
+    @attr(tags = ["publiciprange", "dedicate", "release"])
+    def test_dedicatePublicIpRange(self):
+        """Test public IP range dedication
+        """
+
+        # Validate the following:
+        # 1. Create a Public IP range
+        # 2. Created IP range should be present, verify with listVlanIpRanges
+        # 3. Dedicate the created IP range to user account
+        # 4. Verify IP range is dedicated, verify with listVlanIpRanges
+        # 5. Release the dedicated Public IP range back to the system
+        # 6. Verify IP range has been released, verify with listVlanIpRanges
+        # 7. Delete the Public IP range
+
+        self.debug("Creating Public IP range")
+        self.public_ip_range = PublicIpRange.create(
+                                    self.api_client,
+                                    self.services
+                               )
+        list_public_ip_range_response = PublicIpRange.list(
+                                            self.apiclient,
+                                            id=self.public_ip_range.vlan.id
+                                        )
+        self.debug(
+                "Verify listPublicIpRanges response for public ip ranges: %s" \
+                % self.public_ip_range.vlan.id
+            )
+        self.assertEqual(
+                         isinstance(list_public_ip_range_response, list),
+                         True,
+                         "Check for list Public IP range response"
+                         )
+        public_ip_response = list_public_ip_range_response[0]
+        self.assertEqual(
+                            public_ip_response.id,
+                            self.public_ip_range.vlan.id,
+                            "Check public ip range response id is in listVlanIpRanges"
+                        )
+
+        self.debug("Dedicating Public IP range");
+        dedicate_public_ip_range_response = PublicIpRange.dedicate(
+                                                self.apiclient,
+                                                self.public_ip_range.vlan.id,
+                                                account=self.account.account.name,
+                                                domainid=self.account.account.domainid
+                                            )
+        list_public_ip_range_response = PublicIpRange.list(
+                                            self.apiclient,
+                                            id=self.public_ip_range.vlan.id
+                                        )
+        public_ip_response = list_public_ip_range_response[0]
+        self.assertEqual(
+                            public_ip_response.account,
+                            self.account.account.name,
+                            "Check account name is in listVlanIpRanges as the account public ip range is dedicated to"
+                        )
+
+        self.debug("Releasing Public IP range");
+        self.public_ip_range.release(self.apiclient)
+        list_public_ip_range_response = PublicIpRange.list(
+                                            self.apiclient,
+                                            id=self.public_ip_range.vlan.id
+                                        )
+        public_ip_response = list_public_ip_range_response[0]
+        self.assertEqual(
+                            public_ip_response.account,
+                            "system",
+                            "Check account name is system account in listVlanIpRanges"
+                        )
+
+        self.debug("Deleting Public IP range");
+        self.public_ip_range.delete(self.apiclient)
+
+        return
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8f865c5a/tools/marvin/marvin/integration/lib/base.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base.py b/tools/marvin/marvin/integration/lib/base.py
old mode 100644
new mode 100755
index d27ab3b..3df68ab
--- a/tools/marvin/marvin/integration/lib/base.py
+++ b/tools/marvin/marvin/integration/lib/base.py
@@ -1873,7 +1873,7 @@ class PublicIpRange:
         """Delete VlanIpRange"""
 
         cmd = deleteVlanIpRange.deleteVlanIpRangeCmd()
-        cmd.id = self.id
+        cmd.id = self.vlan.id
         apiclient.deleteVlanIpRange(cmd)
 
     @classmethod
@@ -1884,6 +1884,23 @@ class PublicIpRange:
         [setattr(cmd, k, v) for k, v in kwargs.items()]
         return(apiclient.listVlanIpRanges(cmd))
 
+    @classmethod
+    def dedicate(cls, apiclient, id, account=None, domainid=None, projectid=None):
+        """Dedicate VLAN IP range"""
+
+        cmd = dedicatePublicIpRange.dedicatePublicIpRangeCmd()
+        cmd.id = id
+        cmd.account = account
+        cmd.domainid = domainid
+        cmd.projectid = projectid
+        return PublicIpRange(apiclient.dedicatePublicIpRange(cmd).__dict__)
+
+    def release(self, apiclient):
+        """Release VLAN IP range"""
+
+        cmd = releasePublicIpRange.releasePublicIpRangeCmd()
+        cmd.id = self.vlan.id
+        return apiclient.releasePublicIpRange(cmd)
 
 class SecondaryStorage:
     """Manage Secondary storage"""


[32/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
Added more to new features section, including API discovery service, CloudMonkey, Regions, and more.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1f76d8be
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1f76d8be
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1f76d8be

Branch: refs/heads/ui-vm-affinity
Commit: 1f76d8bed7f765de8e5e2ea695995eef6e927b0d
Parents: e22a86f
Author: Joe Brockmeier <jz...@zonker.net>
Authored: Mon Apr 15 12:03:43 2013 -0500
Committer: Joe Brockmeier <jz...@zonker.net>
Committed: Mon Apr 15 12:04:14 2013 -0500

----------------------------------------------------------------------
 docs/en-US/Release_Notes.xml |  148 +++++++++++++++++++++++++++++++++++++
 1 files changed, 148 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1f76d8be/docs/en-US/Release_Notes.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/Release_Notes.xml b/docs/en-US/Release_Notes.xml
index e701330..718f38e 100644
--- a/docs/en-US/Release_Notes.xml
+++ b/docs/en-US/Release_Notes.xml
@@ -37,6 +37,154 @@ under the License.
                 <para>The 4.1.0 release adds partial User Interface (UI) support for Catalan, Chinese, French, German, Italian, Japanese, Korean, Norwegian, Portuguese, Russian, and Spanish. Not all languages are complete.</para>
                 <para>The 4.1.0 release also adds documentation translations for Chinese, Chinese (Taiwan), Italian, Japanese, Korean, and Portuguese.</para>
             </section>
+            <section id="aws-style-regions">
+                <title>Added Region Support</title>
+                <para><ulink url="https://issues.apache.org/jira/browse/CLOUDSTACK-241">CLOUDSTACK-241</ulink>: This feature adds a "region" construct that spans several management servers. The objective of this feature is to add AWS EC2 like Regions implementation into CloudStack.  Regions are dispersed and located in separate geographic areas. Availability Zones (or Zones in CloudStack) are distinct locations within a Region that are engineered to be isolated from failures in other Zones and provide inexpensive, low latency network connectivity to other Zones in the same Region.</para>
+                <para>Regions are expected to add the following benefits</para>
+                <itemizedlist>
+                    <listitem><para>Higher availability of the services: users can deploy services across AZs and even if one of the AZ goes down the services are still available to the end-user through VMs deployed in other zones.</para></listitem>
+                    <listitem><para>Higher availability of the Management Server (MS): Since each MS Cluster only manages a single Region, if that MS Cluster goes down, only that particular Region is impacted. Admin should be able to access all the other Regions.</para></listitem>
+                    <listitem><para>Scalability: The scalability limit of CloudStack dramatically improves, as the scalability limit of MS Cluster is limited to a single Region.</para></listitem>
+                    <listitem><para>Object Store: With Regions construct, CloudStack would also allow users to define Object Store (Secondary Storage) across AZs. This helps users easily deploy VMs in different AZs using the same template, offerings.</para></listitem>
+                    <listitem><para>Geographical Grouping: Regions allow admins to group AZs (that have low latency and are geographically located nearby) into a broader region construct.</para></listitem>
+                </itemizedlist>
+                <para>Currently the Region feature is exposed in the API, but does not have a UI component.</para>
+            </section>
+            <section id="ec2-query-api">
+                <title>Support for EC2 Query API</title>
+                <para><ulink url="https://issues.apache.org/jira/browse/CLOUDSTACK-197">CLOUDSTACK-197</ulink>: This introduces a query API for the AWS APIs that are currently only supported by SOAP. The AWS Java SDK and AWS PHP SDK should now be supported by the AWSAPI in CloudStack.</para>
+                <para>Supported Query APIs in 4.1.0:</para>
+                <itemizedlist>
+                    <listitem><para><command>AllocateAddress</command></para></listitem>
+                    <listitem><para><command>AssociateAddress</command></para></listitem>
+                    <listitem><para><command>AttachVolume</command></para></listitem>
+                    <listitem><para><command>AuthorizeSecurityGroupIngress</command></para></listitem>
+                    <listitem><para><command>CreateImage</command></para></listitem>
+                    <listitem><para><command>CreateKeyPair</command></para></listitem>
+                    <listitem><para><command>CreateSecurityGroup</command></para></listitem>
+                    <listitem><para><command>CreateSnapshot</command></para></listitem>
+                    <listitem><para><command>CreateTags</command></para></listitem>
+                    <listitem><para><command>CreateVolume</command></para></listitem>
+                    <listitem><para><command>DeleteKeyPair</command></para></listitem>
+                    <listitem><para><command>DeleteSecurityGroup</command></para></listitem>
+                    <listitem><para><command>DeleteSnapshot</command></para></listitem>
+                    <listitem><para><command>DeleteTags</command></para></listitem>
+                    <listitem><para><command>DeleteVolume</command></para></listitem>
+                    <listitem><para><command>DeregisterImage</command></para></listitem>
+                    <listitem><para><command>DescribeAddresses</command></para></listitem>
+                    <listitem><para><command>DescribeAvailabilityZones</command></para></listitem>
+                    <listitem><para><command>DescribeImageAttribute</command></para></listitem>
+                    <listitem><para><command>DescribeImages</command></para></listitem>
+                    <listitem><para><command>DescribeInstanceAttribute</command></para></listitem>
+                    <listitem><para><command>DescribeInstances</command></para></listitem>
+                    <listitem><para><command>DescribeKeyPairs</command></para></listitem>
+                    <listitem><para><command>DescribeSecurityGroups</command></para></listitem>
+                    <listitem><para><command>DescribeSnapshots</command></para></listitem>
+                    <listitem><para><command>DescribeTags</command></para></listitem>
+                    <listitem><para><command>DescribeVolumes</command></para></listitem>
+                    <listitem><para><command>DetachVolume</command></para></listitem>
+                    <listitem><para><command>DisassociateAddress</command></para></listitem>
+                    <listitem><para><command>GetPasswordData</command></para></listitem>
+                    <listitem><para><command>ImportkeyPair</command></para></listitem>
+                    <listitem><para><command>ModifyImageAttribute</command></para></listitem>
+                    <listitem><para><command>RebootInstances</command></para></listitem>
+                    <listitem><para><command>RegisterImage</command></para></listitem>
+                    <listitem><para><command>ReleaseAddress</command></para></listitem>
+                    <listitem><para><command>ResetImageAttribute</command></para></listitem>
+                    <listitem><para><command>RevokeSecurityGroupIngress</command></para></listitem>
+                    <listitem><para><command>RunInstances</command></para></listitem>
+                    <listitem><para><command>StartInstances</command></para></listitem>
+                    <listitem><para><command>StopInstances</command></para></listitem>
+                    <listitem><para><command>TerminateInstances</command></para></listitem>
+                </itemizedlist>
+                <para>See the <ulink url="https://cwiki.apache.org/CLOUDSTACK/ec2-functional-spec-for-query-api-support.html">Feature Specification</ulink> for more information on the Query API support.</para>
+            </section>
+            <section id="cloudmonkey">
+                <title>Auto-Completing Shell for CloudStack (CloudMonkey)</title>
+                <para><ulink url="https://issues.apache.org/jira/browse/CLOUDSTACK-132">CLOUDSTACK-132</ulink>: Adds a auto-completing shell and command-line tool for &PRODUCT; written in Python, called <application>CloudMonkey</application>.</para>
+                <para>CloudMonkey includes the following features:</para>
+                <itemizedlist>
+                    <listitem><para>Usable as a command line tool and interactive shell.</para></listitem>
+                    <listitem><para>All commands are lowercase unlike API.</para></listitem>
+                    <listitem><para>Api Discovery using sync feature, with build time api precaching for failsafe sync.</para></listitem>
+                    <listitem><para>Raw api execution support.</para></listitem>
+                    <listitem><para>Auto-completion via double <command>tab</command>.</para></listitem>
+                    <listitem><para>Reverse search using <command>Ctrl+R</command></para></listitem>
+                    <listitem><para>Emacs compatible key bindings.</para></listitem>
+                    <listitem><para>Output that's "pipeable" to other *nix programs.</para></listitem>
+                    <listitem><para>Unix shell execution.</para></listitem>
+                    <listitem><para>Support to handle asynchronous jobs using user defined blocking or non-blocking way.</para></listitem>
+                    <listitem><para>Tabular or JSON output with filtering of table columns.</para></listitem>
+                    <listitem><para>Colored output.</para></listitem>
+                    <listitem><para>API parameter value completion (based on predication, fuzzy results may fail sometimes).</para></listitem>
+                </itemizedlist>
+                <para>CloudMonkey has a few requirements above and beyond CloudStack, and does not need to be run on the same machine as a management server. If you wish to run <application>CloudMonkey</application> you'll need Python 2.5 or later, <application>readline</application>, <application>Pygments</application>, and <application>prettytable</application>. CloudMonkey can be installed with <application>pip</application>:</para>
+                <programlisting language="Bash"><prompt>$</prompt> pip install cloudmonkey</programlisting>
+                <para>See the Developer's Guide and <ulink url="https://cwiki.apache.org/CLOUDSTACK/cloudstack-cloudmonkey-cli.html">the CloudStack wiki</ulink> for the latest information on <application>CloudMonkey</application> installation and use.</para>
+            </section>
+            <section id="apidiscover">
+                <title>API Discovery Service</title>
+                <para><ulink url="https://issues.apache.org/jira/browse/CLOUDSTACK-926">CLOUDSTACK-926</ulink>: CloudStack has more than 300 APIs and more are added in each major release. CloudStack admins can enable or disable APIs, or add plugins which provide more APIs. The API Discovery Service is a plugin which will help users discover the APIs available to them on a CloudStack Management Server.</para>
+                <para>The discovery service implements a method called <command>listApis</command> which will return information about APIs for a user. It currently accepts an apiName to list api information of that particular API. The method ensures that user can only list APIs they are entitled to.</para>
+                <para>All CloudStack APIs are implemented by annotated command class and PluggableService is a contract implemented by all the components such as the Management Server and all the plugins which provide an API. During load time, API discovery service asks all the pluggable services to return list of API cmd classes from whose fields and annotations it gathers information about each API, the information consists of name, description, parameter name, parameter description, etc.</para>
+                <para>For more information on the implementation of the API Discovery Service for 4.1.0, see the <ulink url="https://cwiki.apache.org/CLOUDSTACK/api-discovery-service.html">CloudStack wiki</ulink>.</para> 
+            </section>
+            <section id="events-framework">
+                <title>Events Framework</title>
+                <para><ulink url="https://issues.apache.org/jira/browse/CLOUDSTACK-820">CLOUDSTACK-820</ulink>: The Events Framework provides a mechanism to publish and subscribe to events in &PRODUCT;.</para>
+            </section>
+            <section id="additional-vmx-settings">
+                <title>Additional VMX Settings</title>
+                <para>###</para>
+            </section>
+            <section id="l3-nicira">
+                <title>L3 Router Functionality in Nicira Nvp Plugin</title>
+                <para>###</para>
+            </section>
+            <section id="persistent-networks">
+                <title>Persistent Networks without Running VM</title>
+                <para>###</para>
+            </section>
+            <section id="add-remove-network-vm">
+                <title>Add/Remove Network on VM</title>
+                <para>###</para>
+            </section>
+            <section id="resize-volumes">
+                <title>Resize Volumes Feature</title>
+                <para>###</para>
+            </section>
+            <section id="autoscale">
+                <title>Autoscale</title>
+                <para>###</para>
+            </section>
+            <section id="api-throttling">
+                <title>API Request Throttling</title>
+                <para>###</para>
+            </section>
+            <section id="ceph-rdb-setup">
+                <title>Ceph RDB Setup</title>
+                <para>###</para>
+            </section>
+            <section id="s3-backed-storage">
+                <title>S3 Backed Secondary Storage</title>
+                <para>###</para>
+            </section>
+            <section id="user-domain-admin-create-key">
+                <title>User and Domain Admin Can Create API Key and Secret</title>
+                <para><ulink url="https://issues.apache.org/jira/browse/CLOUDSTACK-437">CLOUDSTACK-437</ulink>: This feature adds the ability for domain admins and users to create their own API Key and Secret. Domain admins can create keys for themselves, subdomain admins, and for regular users, but not for other domain admins.</para>
+            </section>
+            <section id="inline-srx-f5-mode">
+                <title>Support Inline Mode for F5 and SRX</title>
+                <para><ulink url="https://issues.apache.org/jira/browse/CLOUDSTACK-306">CLOUDSTACK-306</ulink>: ### </para>
+            </section>
+            <section id="egress-firewall">
+                <title>Egress Firewall Rules for Guest Networks</title>
+                <para><ulink url="https://issues.apache.org/jira/browse/CLOUDSTACK-299">CLOUDSTACK-299</ulink>: ###</para>
+            </section>
+            <section id="reset-ssh-key">
+                <title>Reset SSH Key to Access VM</title>
+                <para><ulink url="https://issues.apache.org/jira/browse/CLOUDSTACK-297">CLOUDSTACK-297</ulink>: ###</para>
+            </section>
         </section>
         <section id="issues-fixed-4.0">
             <title>Issues Fixed in 4.1.0</title>


[29/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
NiciraNvpElement is also implements IpDeployer.

IpDeployer is required for the L3 components.

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1f0b804d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1f0b804d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1f0b804d

Branch: refs/heads/ui-vm-affinity
Commit: 1f0b804dd3972f373c196799fc48929a7bc3f473
Parents: e94c702
Author: Hugo Trippaers <ht...@schubergphilis.com>
Authored: Mon Apr 15 15:42:10 2013 +0200
Committer: Hugo Trippaers <ht...@schubergphilis.com>
Committed: Mon Apr 15 15:42:40 2013 +0200

----------------------------------------------------------------------
 client/tomcatconf/componentContext.xml.in       |    1 +
 client/tomcatconf/nonossComponentContext.xml.in |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1f0b804d/client/tomcatconf/componentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/componentContext.xml.in b/client/tomcatconf/componentContext.xml.in
index 92838fd..23284ab 100644
--- a/client/tomcatconf/componentContext.xml.in
+++ b/client/tomcatconf/componentContext.xml.in
@@ -197,6 +197,7 @@
           <ref bean="elasticLoadBalancerElement"/>
           <ref bean="VirtualRouter"/>
           <ref bean="VpcVirtualRouter"/>
+          <ref bean="NiciraNvp"/>
       </list>
     </property>
   </bean>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1f0b804d/client/tomcatconf/nonossComponentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/nonossComponentContext.xml.in b/client/tomcatconf/nonossComponentContext.xml.in
index aac3b89..a2182d1 100644
--- a/client/tomcatconf/nonossComponentContext.xml.in
+++ b/client/tomcatconf/nonossComponentContext.xml.in
@@ -293,6 +293,7 @@
           <ref bean="elasticLoadBalancerElement"/>
           <ref bean="VirtualRouter"/>
           <ref bean="VpcVirtualRouter"/>
+          <ref bean="NiciraNvp"/>
       </list>
     </property>
   </bean>


[18/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
CLOUDSTACK-1984:Wrong mapping of resource names to the capacity function on the dashboard


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e05defc0
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e05defc0
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e05defc0

Branch: refs/heads/ui-vm-affinity
Commit: e05defc0732541eba117909211e455ecb6ac8b23
Parents: 0abfe24
Author: Pranav Saxena <pr...@citrix.com>
Authored: Mon Apr 15 12:38:18 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Mon Apr 15 12:38:18 2013 +0530

----------------------------------------------------------------------
 ui/scripts/dashboard.js       |    2 +-
 ui/scripts/sharedFunctions.js |   25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e05defc0/ui/scripts/dashboard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/dashboard.js b/ui/scripts/dashboard.js
index 845ae52..e8ab6c5 100644
--- a/ui/scripts/dashboard.js
+++ b/ui/scripts/dashboard.js
@@ -238,7 +238,7 @@
                     return {
                       zoneID: capacity.zoneid, // Temporary fix for dashboard
                       zoneName: capacity.zonename,
-                      type: cloudStack.converters.toAlertType(capacity.type),
+                      type: cloudStack.converters.toCapacityCountType(capacity.type),
                       percent: parseInt(capacity.percentused),
                       used: cloudStack.converters.convertByType(capacity.type, capacity.capacityused),
                       total: cloudStack.converters.convertByType(capacity.type, capacity.capacitytotal)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e05defc0/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 86fe7f6..19e1611 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -425,6 +425,31 @@ cloudStack.converters = {
     case 26 : return "Resource Limit Exceeded";
     }
   },
+
+  toCapacityCountType:function(capacityCode){
+   switch(capacityCode){
+    case 0 : return _l('label.memory');
+    case 1 : return _l('label.cpu');
+    case 2 : return _l('label.storage');
+    case 3 : return _l('label.primary.storage');
+    case 4 : return _l('label.public.ips');
+    case 5 : return _l('label.management.ips');
+    case 6 : return _l('label.secondary.storage');
+    case 7 : return _l('label.vlan');
+    case 8 : return _l('label.direct.ips');
+    case 9 : return _l('label.local.storage');
+    case 10 : return "Routing Host";
+    case 11 : return "Storage";
+    case 12 : return "Usage Server";
+    case 13 : return "Management Server";
+    case 14 : return "Domain Router";
+    case 15 : return "Console Proxy";
+    case 16 : return "User VM";
+    case 17 : return "VLAN";
+    case 18 : return "Secondary Storage VM";
+      }
+    },
+
   convertByType: function(alertCode, value) {
     switch(alertCode) {
       case 0: return cloudStack.converters.convertBytes(value);


[30/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
More work on Release Notes.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/abbc7efd
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/abbc7efd
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/abbc7efd

Branch: refs/heads/ui-vm-affinity
Commit: abbc7efd808a3b8da0548e8a1908fa42cdde2a28
Parents: 1f0b804
Author: Joe Brockmeier <jz...@zonker.net>
Authored: Mon Apr 15 09:19:36 2013 -0500
Committer: Joe Brockmeier <jz...@zonker.net>
Committed: Mon Apr 15 09:20:38 2013 -0500

----------------------------------------------------------------------
 docs/en-US/Release_Notes.xml |   90 ++++++++++++++++++++++++++++++++++++-
 1 files changed, 88 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/abbc7efd/docs/en-US/Release_Notes.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/Release_Notes.xml b/docs/en-US/Release_Notes.xml
index 5b9571e..e701330 100644
--- a/docs/en-US/Release_Notes.xml
+++ b/docs/en-US/Release_Notes.xml
@@ -3983,6 +3983,92 @@ under the License.
                     <para>Instructions for creating packages from the &PRODUCT; source are in the <ulink url="http://cloudstack.apache.org/docs/en-US/index.html">Installation Guide</ulink>.</para>
                 </listitem>
                 <listitem>
+                    <note><title>For VMware Only</title>
+                        <para>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.</para>
+                    </note>
+                    <para>In each zone that includes VMware hosts, you need to add a new system VM template. </para>
+                    <orderedlist numeration="loweralpha">
+                        <listitem>
+                            <para>While running the existing 3.0.2 system, log in to the UI as root administrator.</para>
+                        </listitem>
+                        <listitem>
+                            <para>In the left navigation bar, click Templates.</para>
+                        </listitem>
+                        <listitem>
+                            <para>In Select view, click Templates.</para>
+                        </listitem>
+                        <listitem>
+                            <para>Click Register template.</para>
+                            <para>The Register template dialog box is displayed.</para>
+                        </listitem>
+                        <listitem>
+                            <para>In the Register template dialog box, specify the following values (do not change these):</para>
+                            <informaltable>
+                                <tgroup cols="2" align="left" colsep="1" rowsep="1">
+                                    <colspec colwidth="1*" colname="1" colnum="1"/>
+                                    <colspec colwidth="2*" colname="2" colnum="2"/>
+                                    <thead>
+                                        <row>
+                                            <entry><para>Field</para></entry>
+                                            <entry><para>Value</para></entry>
+                                        </row>
+                                    </thead>
+                                    <tbody>
+                                        <row>
+                                            <entry><para>Name</para></entry>
+                                            <entry><para>systemvm-vmware-4.1</para></entry>
+                                        </row>
+                                        <row>
+                                            <entry><para>Description</para></entry>
+                                            <entry><para>systemvm-vmware-4.1</para></entry>
+                                        </row>
+                                        <row>
+                                            <entry><para>URL</para></entry>
+                                            <entry><para>http://download.cloud.com/templates/burbank/burbank-systemvm-08012012.ova</para></entry>
+                                        </row>
+                                        <row>
+                                            <entry><para>Zone</para></entry>
+                                            <entry><para>Choose the zone where this hypervisor is used</para></entry>
+                                        </row>
+                                        <row>
+                                            <entry><para>Hypervisor</para></entry>
+                                            <entry><para>VMware</para></entry>
+                                        </row>
+                                        <row>
+                                            <entry><para>Format</para></entry>
+                                            <entry><para>OVA</para></entry>
+                                        </row>
+                                        <row>
+                                            <entry><para>OS Type</para></entry>
+                                            <entry><para>Debian GNU/Linux 5.0 (32-bit)</para></entry>
+                                        </row>
+                                        <row>
+                                            <entry><para>Extractable</para></entry>
+                                            <entry><para>no</para></entry>
+                                        </row>
+                                        <row>
+                                            <entry><para>Password Enabled</para></entry>
+                                            <entry><para>no</para></entry>
+                                        </row>
+                                        <row>
+                                            <entry><para>Public</para></entry>
+                                            <entry><para>no</para></entry>
+                                        </row>
+                                        <row>
+                                            <entry><para>Featured</para></entry>
+                                            <entry><para>no</para></entry>
+                                        </row>
+                                    </tbody>
+                                </tgroup>
+                            </informaltable>
+                        </listitem>
+                        <listitem>
+                            <para>Watch the screen to be sure that the template downloads successfully and enters
+                                the READY state. Do not proceed until this is successful.</para>
+                        </listitem>
+                    </orderedlist>
+                </listitem>
+                <listitem>
                     <para>Stop your management server or servers. Run this on all management server hosts:</para>
                     <programlisting><prompt>#</prompt> service cloud-management stop</programlisting>
                 </listitem>
@@ -4132,11 +4218,11 @@ under the License.
                                     <tbody>
                                         <row>
                                             <entry><para>Name</para></entry>
-                                            <entry><para>systemvm-vmware-4.0</para></entry>
+                                            <entry><para>systemvm-vmware-4.1</para></entry>
                                         </row>
                                         <row>
                                             <entry><para>Description</para></entry>
-                                            <entry><para>systemvm-vmware-4.0</para></entry>
+                                            <entry><para>systemvm-vmware-4.1</para></entry>
                                         </row>
                                         <row>
                                             <entry><para>URL</para></entry>


[26/33] Squashed commit of the following:

Posted by bf...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/AddCiscoVnmcResourceCmd.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/AddCiscoVnmcResourceCmd.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/AddCiscoVnmcResourceCmd.java
new file mode 100644
index 0000000..bfd6db9
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/AddCiscoVnmcResourceCmd.java
@@ -0,0 +1,115 @@
+// 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.api.commands;
+
+import javax.inject.Inject;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
+import org.apache.log4j.Logger;
+
+import com.cloud.api.response.CiscoVnmcResourceResponse;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.cisco.CiscoVnmcController;
+import com.cloud.network.element.CiscoVnmcElementService;
+import com.cloud.user.UserContext;
+import com.cloud.utils.exception.CloudRuntimeException;
+
+@APICommand(name="addCiscoVnmcResource", responseObject=CiscoVnmcResourceResponse.class, description="Adds a Cisco Vnmc Controller")
+public class AddCiscoVnmcResourceCmd extends BaseCmd {
+    private static final Logger s_logger = Logger.getLogger(AddCiscoVnmcResourceCmd.class.getName());
+    private static final String s_name = "addCiscoVnmcResource";
+    @Inject CiscoVnmcElementService _ciscoVnmcElementService;
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.UUID, entityType = PhysicalNetworkResponse.class, required=true, description="the Physical Network ID")
+    private Long physicalNetworkId;
+
+    @Parameter(name=ApiConstants.HOST_NAME, type=CommandType.STRING, required = true, description="Hostname or ip address of the Cisco VNMC Controller.")
+    private String host;
+
+    @Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required = true, description="Credentials to access the Cisco VNMC Controller API")
+    private String username;
+
+    @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required = true, description="Credentials to access the Cisco VNMC Controller API")
+    private String password;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getPhysicalNetworkId() {
+        return physicalNetworkId;
+    }
+
+    public String getHost() {
+        return host;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    @Override
+    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
+        try {
+            CiscoVnmcController CiscoVnmcResourceVO = _ciscoVnmcElementService.addCiscoVnmcResource(this);
+            if (CiscoVnmcResourceVO != null) {
+                CiscoVnmcResourceResponse response = _ciscoVnmcElementService.createCiscoVnmcResourceResponse(CiscoVnmcResourceVO);
+                response.setObjectName("CiscoVnmcResource");
+                response.setResponseName(getCommandName());
+                this.setResponseObject(response);
+            } else {
+                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to add Cisco VNMC controller due to internal error.");
+            }
+        }  catch (InvalidParameterValueException invalidParamExcp) {
+            throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage());
+        } catch (CloudRuntimeException runtimeExcp) {
+            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage());
+        }
+    }
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public long getEntityOwnerId() {
+        return UserContext.current().getCaller().getId();
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/DeleteCiscoAsa1000vResourceCmd.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/DeleteCiscoAsa1000vResourceCmd.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/DeleteCiscoAsa1000vResourceCmd.java
new file mode 100755
index 0000000..d4f86fa
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/DeleteCiscoAsa1000vResourceCmd.java
@@ -0,0 +1,93 @@
+// 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.api.commands;
+
+import javax.inject.Inject;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.SuccessResponse;
+import org.apache.log4j.Logger;
+
+import com.cloud.api.response.CiscoAsa1000vResourceResponse;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.element.CiscoAsa1000vService;
+import com.cloud.user.UserContext;
+import com.cloud.utils.exception.CloudRuntimeException;
+
+@APICommand(name="deleteCiscoAsa1000vResource", responseObject=SuccessResponse.class, description="Deletes a Cisco ASA 1000v appliance")
+public class DeleteCiscoAsa1000vResourceCmd extends BaseCmd {
+    private static final Logger s_logger = Logger.getLogger(DeleteCiscoAsa1000vResourceCmd.class.getName());
+    private static final String s_name = "deleteCiscoAsa1000vResource";
+    @Inject CiscoAsa1000vService _ciscoAsa1000vService;
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name=ApiConstants.RESOURCE_ID, type=CommandType.UUID, required=true, entityType=CiscoAsa1000vResourceResponse.class, description="Cisco ASA 1000v resource ID")
+    private Long ciscoAsa1000vResourceId;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getCiscoAsa1000vResourceId() {
+        return ciscoAsa1000vResourceId;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    @Override
+    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
+        try {
+            boolean result = _ciscoAsa1000vService.deleteCiscoAsa1000vResource(this);
+            if (result) {
+                SuccessResponse response = new SuccessResponse(getCommandName());
+                response.setResponseName(getCommandName());
+                this.setResponseObject(response);
+            } else {
+                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete Cisco ASA 1000v appliance.");
+            }
+        }  catch (InvalidParameterValueException invalidParamExcp) {
+            throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage());
+        } catch (CloudRuntimeException runtimeExcp) {
+            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage());
+        }
+    }
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public long getEntityOwnerId() {
+        return UserContext.current().getCaller().getId();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/DeleteCiscoVnmcResourceCmd.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/DeleteCiscoVnmcResourceCmd.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/DeleteCiscoVnmcResourceCmd.java
new file mode 100644
index 0000000..d2a3720
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/DeleteCiscoVnmcResourceCmd.java
@@ -0,0 +1,93 @@
+// 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.api.commands;
+
+import javax.inject.Inject;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.SuccessResponse;
+import org.apache.log4j.Logger;
+
+import com.cloud.api.response.CiscoVnmcResourceResponse;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.element.CiscoVnmcElementService;
+import com.cloud.user.UserContext;
+import com.cloud.utils.exception.CloudRuntimeException;
+
+@APICommand(name="deleteCiscoVnmcResource", responseObject=SuccessResponse.class, description="Deletes a Cisco Vnmc controller")
+public class DeleteCiscoVnmcResourceCmd extends BaseCmd {
+    private static final Logger s_logger = Logger.getLogger(DeleteCiscoVnmcResourceCmd.class.getName());
+    private static final String s_name = "deleteCiscoVnmcResource";
+    @Inject CiscoVnmcElementService _ciscoVnmcElementService;
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name=ApiConstants.RESOURCE_ID, type=CommandType.UUID, required=true, entityType=CiscoVnmcResourceResponse.class, description="Cisco Vnmc resource ID")
+    private Long ciscoVnmcResourceId;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getCiscoVnmcResourceId() {
+        return ciscoVnmcResourceId;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    @Override
+    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
+        try {
+            boolean result = _ciscoVnmcElementService.deleteCiscoVnmcResource(this);
+            if (result) {
+                SuccessResponse response = new SuccessResponse(getCommandName());
+                response.setResponseName(getCommandName());
+                this.setResponseObject(response);
+            } else {
+                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete Cisco Vnmc resource.");
+            }
+        }  catch (InvalidParameterValueException invalidParamExcp) {
+            throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage());
+        } catch (CloudRuntimeException runtimeExcp) {
+            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage());
+        }
+    }
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public long getEntityOwnerId() {
+        return UserContext.current().getCaller().getId();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/ListCiscoAsa1000vResourcesCmd.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/ListCiscoAsa1000vResourcesCmd.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/ListCiscoAsa1000vResourcesCmd.java
new file mode 100755
index 0000000..509d39f
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/ListCiscoAsa1000vResourcesCmd.java
@@ -0,0 +1,110 @@
+// 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.api.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseListCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
+import org.apache.log4j.Logger;
+
+import com.cloud.api.response.CiscoAsa1000vResourceResponse;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.cisco.CiscoAsa1000vDevice;
+import com.cloud.network.cisco.CiscoAsa1000vDeviceVO;
+import com.cloud.network.element.CiscoAsa1000vService;
+import com.cloud.utils.exception.CloudRuntimeException;
+
+@APICommand(name="listCiscoAsa1000vResources", responseObject=CiscoAsa1000vResourceResponse.class, description="Lists Cisco ASA 1000v appliances")
+public class ListCiscoAsa1000vResourcesCmd extends BaseListCmd {
+    private static final Logger s_logger = Logger.getLogger(ListCiscoAsa1000vResourcesCmd.class.getName());
+    private static final String s_name = "listCiscoAsa1000vResources";
+    @Inject CiscoAsa1000vService _ciscoAsa1000vService;
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.UUID, entityType = PhysicalNetworkResponse.class, description="the Physical Network ID")
+    private Long physicalNetworkId;
+
+    @Parameter(name=ApiConstants.RESOURCE_ID, type=CommandType.UUID, entityType=CiscoAsa1000vResourceResponse.class, description="Cisco ASA 1000v resource ID")
+    private Long ciscoAsa1000vResourceId;
+
+    @Parameter(name=ApiConstants.HOST_NAME, type=CommandType.STRING, description="Hostname or ip address of the Cisco ASA 1000v appliance.")
+    private String host;
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getCiscoAsa1000vResourceId() {
+        return ciscoAsa1000vResourceId;
+    }
+
+    public Long getPhysicalNetworkId() {
+        return physicalNetworkId;
+    }
+
+    public String getManagementIp() {
+        return host;
+    }
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    @Override
+    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
+        try {
+            List<CiscoAsa1000vDeviceVO> ciscoAsa1000vDevices = _ciscoAsa1000vService.listCiscoAsa1000vResources(this);
+            ListResponse<CiscoAsa1000vResourceResponse> response = new ListResponse<CiscoAsa1000vResourceResponse>();
+            List<CiscoAsa1000vResourceResponse> ciscoAsa1000vResourcesResponse = new ArrayList<CiscoAsa1000vResourceResponse>();
+
+            if (ciscoAsa1000vDevices != null && !ciscoAsa1000vDevices.isEmpty()) {
+                for (CiscoAsa1000vDevice ciscoAsa1000vDeviceVO : ciscoAsa1000vDevices) {
+                    CiscoAsa1000vResourceResponse ciscoAsa1000vResourceResponse = _ciscoAsa1000vService.createCiscoAsa1000vResourceResponse(ciscoAsa1000vDeviceVO);
+                    ciscoAsa1000vResourcesResponse.add(ciscoAsa1000vResourceResponse);
+                }
+            }
+
+            response.setResponses(ciscoAsa1000vResourcesResponse);
+            response.setResponseName(getCommandName());
+            this.setResponseObject(response);
+        }  catch (InvalidParameterValueException invalidParamExcp) {
+            throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage());
+        } catch (CloudRuntimeException runtimeExcp) {
+            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage());
+        }
+    }
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/ListCiscoVnmcResourcesCmd.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/ListCiscoVnmcResourcesCmd.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/ListCiscoVnmcResourcesCmd.java
new file mode 100644
index 0000000..ab553ee
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/ListCiscoVnmcResourcesCmd.java
@@ -0,0 +1,106 @@
+// 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.api.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseListCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
+import org.apache.log4j.Logger;
+
+import com.cloud.api.response.CiscoVnmcResourceResponse;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.cisco.CiscoVnmcController;
+import com.cloud.network.cisco.CiscoVnmcControllerVO;
+import com.cloud.network.element.CiscoVnmcElementService;
+import com.cloud.utils.exception.CloudRuntimeException;
+
+@APICommand(name="listCiscoVnmcResources", responseObject=CiscoVnmcResourceResponse.class, description="Lists Cisco VNMC controllers")
+public class ListCiscoVnmcResourcesCmd extends BaseListCmd {
+    private static final Logger s_logger = Logger.getLogger(ListCiscoVnmcResourcesCmd.class.getName());
+    private static final String s_name = "listCiscoVnmcResources";
+    @Inject CiscoVnmcElementService _ciscoVnmcElementService;
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.UUID, entityType = PhysicalNetworkResponse.class, description="the Physical Network ID")
+    private Long physicalNetworkId;
+
+    @Parameter(name=ApiConstants.RESOURCE_ID, type=CommandType.UUID,  entityType=CiscoVnmcResourceResponse.class, description="Cisco VNMC resource ID")
+    private Long ciscoVnmcResourceId;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getCiscoVnmcResourceId() {
+        return ciscoVnmcResourceId;
+    }
+
+    public Long getPhysicalNetworkId() {
+        return physicalNetworkId;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    @Override
+    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
+        try {
+            List<CiscoVnmcControllerVO> CiscoVnmcResources = _ciscoVnmcElementService.listCiscoVnmcResources(this);
+            ListResponse<CiscoVnmcResourceResponse> response = new ListResponse<CiscoVnmcResourceResponse>();
+            List<CiscoVnmcResourceResponse> CiscoVnmcResourcesResponse = new ArrayList<CiscoVnmcResourceResponse>();
+
+            if (CiscoVnmcResources != null && !CiscoVnmcResources.isEmpty()) {
+                for (CiscoVnmcController CiscoVnmcResourceVO : CiscoVnmcResources) {
+                    CiscoVnmcResourceResponse CiscoVnmcResourceResponse = _ciscoVnmcElementService.createCiscoVnmcResourceResponse(CiscoVnmcResourceVO);
+                    CiscoVnmcResourcesResponse.add(CiscoVnmcResourceResponse);
+                }
+            }
+
+            response.setResponses(CiscoVnmcResourcesResponse);
+            response.setResponseName(getCommandName());
+            this.setResponseObject(response);
+        }  catch (InvalidParameterValueException invalidParamExcp) {
+            throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage());
+        } catch (CloudRuntimeException runtimeExcp) {
+            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage());
+        }
+    }
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoAsa1000vResourceResponse.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoAsa1000vResourceResponse.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoAsa1000vResourceResponse.java
new file mode 100755
index 0000000..9cd87da
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoAsa1000vResourceResponse.java
@@ -0,0 +1,88 @@
+// 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.api.response;
+
+
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseResponse;
+import org.apache.cloudstack.api.EntityReference;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.response.NetworkResponse;
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
+
+import com.cloud.network.cisco.CiscoAsa1000vDevice;
+import com.google.gson.annotations.SerializedName;
+
+@EntityReference(value = CiscoAsa1000vDevice.class)
+public class CiscoAsa1000vResourceResponse extends BaseResponse {
+    public static final String RESOURCE_NAME = "resourcename";
+
+    @SerializedName(ApiConstants.RESOURCE_ID) @Parameter(description="resource id of the Cisco ASA 1000v appliance")
+    private String id;
+
+    @SerializedName(ApiConstants.PHYSICAL_NETWORK_ID) 
+    @Parameter(description="the physical network to which this ASA 1000v belongs to", entityType = PhysicalNetworkResponse.class)
+    private Long physicalNetworkId ;
+
+    public Long getPhysicalNetworkId() {
+        return physicalNetworkId;
+    }
+
+    @SerializedName(ApiConstants.HOST_NAME)
+    @Parameter(description="management ip address of ASA 1000v")
+    private String managementIp;
+
+    public String getManagementIp() {
+        return managementIp;
+    }
+
+    @SerializedName(ApiConstants.ASA_INSIDE_PORT_PROFILE)
+    @Parameter(description="management ip address of ASA 1000v")
+    private String inPortProfile;
+
+    public String getInPortProfile() {
+        return inPortProfile;
+    }
+
+    @SerializedName(ApiConstants.NETWORK_ID)
+    @Parameter(description="the guest network to which ASA 1000v is associated", entityType = NetworkResponse.class)
+    private Long guestNetworkId;
+
+    public Long getGuestNetworkId() {
+        return guestNetworkId;
+    }
+
+    public void setId(String ciscoAsa1000vResourceId) {
+        this.id = ciscoAsa1000vResourceId;
+    }
+
+    public void setPhysicalNetworkId(Long physicalNetworkId) {
+        this.physicalNetworkId = physicalNetworkId;
+    }
+
+    public void setManagementIp(String managementIp) {
+        this.managementIp = managementIp;
+    }
+
+    public void setInPortProfile(String inPortProfile) {
+        this.inPortProfile = inPortProfile;
+    }     
+
+    public void setGuestNetworkId(Long guestNetworkId) {
+        this.guestNetworkId = guestNetworkId;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoVnmcResourceResponse.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoVnmcResourceResponse.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoVnmcResourceResponse.java
new file mode 100644
index 0000000..f5c9b72
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoVnmcResourceResponse.java
@@ -0,0 +1,75 @@
+// 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.api.response;
+
+
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseResponse;
+import org.apache.cloudstack.api.EntityReference;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
+
+import com.cloud.network.cisco.CiscoVnmcController;
+import com.google.gson.annotations.SerializedName;
+@EntityReference(value = CiscoVnmcController.class)
+public class CiscoVnmcResourceResponse extends BaseResponse {
+    public static final String RESOURCE_NAME = "resourcename";
+
+    @SerializedName(ApiConstants.RESOURCE_ID)
+    @Parameter(description="resource id of the Cisco VNMC controller")
+    private String id;
+
+    @SerializedName(ApiConstants.PHYSICAL_NETWORK_ID) 
+    @Parameter(description="the physical network to which this VNMC belongs to", entityType = PhysicalNetworkResponse.class)
+    private Long physicalNetworkId;
+
+    public Long getPhysicalNetworkId() {
+        return physicalNetworkId;
+    }
+
+    public String getProviderName() {
+        return providerName;
+    }
+
+    public String getResourceName() {
+        return resourceName;
+    }
+
+    @SerializedName(ApiConstants.PROVIDER) @Parameter(description="name of the provider")
+    private String providerName;
+
+    @SerializedName(RESOURCE_NAME) 
+    @Parameter(description="Cisco VNMC resource name")
+    private String resourceName;
+
+    public void setId(String ciscoVnmcResourceId) {
+        this.id = ciscoVnmcResourceId;
+    }
+
+    public void setPhysicalNetworkId(Long physicalNetworkId) {
+        this.physicalNetworkId = physicalNetworkId;
+    }
+
+    public void setProviderName(String providerName) {
+        this.providerName = providerName;
+    }
+
+    public void setResourceName(String resourceName) {
+        this.resourceName = resourceName;
+    }     
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoAsa1000vDevice.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoAsa1000vDevice.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoAsa1000vDevice.java
new file mode 100755
index 0000000..3c5f682
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoAsa1000vDevice.java
@@ -0,0 +1,39 @@
+// 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.cisco;
+
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
+import com.cloud.org.Grouping;
+
+public interface CiscoAsa1000vDevice extends Grouping, InternalIdentity, Identity {
+
+    long getId();
+
+    String getUuid();
+
+    void setUuid(String uuid);
+
+    long getPhysicalNetworkId();
+
+    String getManagementIp();
+
+    String getInPortProfile();
+
+    long getClusterId();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoAsa1000vDeviceVO.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoAsa1000vDeviceVO.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoAsa1000vDeviceVO.java
new file mode 100755
index 0000000..ba85fb1
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoAsa1000vDeviceVO.java
@@ -0,0 +1,101 @@
+// 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.cisco;
+
+import java.util.UUID;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Entity
+@Table(name="external_cisco_asa1000v_devices")
+public class CiscoAsa1000vDeviceVO implements CiscoAsa1000vDevice {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name="id")
+    private long id;
+
+    @Column(name="uuid")
+    private String uuid;
+
+    @Column(name="physical_network_id")
+    private long physicalNetworkId;
+
+    @Column(name="management_ip")
+    private String managementIp;
+
+    @Column(name="in_Port_profile")
+    private String inPortProfile;
+
+    @Column(name="cluster_id")
+    private long clusterId;
+
+    public CiscoAsa1000vDeviceVO() {
+        this.uuid = UUID.randomUUID().toString();
+    }
+
+    public CiscoAsa1000vDeviceVO(long physicalNetworkId,
+            String managementIp, String inPortProfile, long clusterId) {
+        super();
+        this.physicalNetworkId = physicalNetworkId;
+        this.managementIp = managementIp;
+        this.inPortProfile = inPortProfile;
+        this.uuid = UUID.randomUUID().toString();
+        this.clusterId = clusterId;
+    }
+
+    @Override
+	public long getId() {
+        return id;
+    }
+
+    @Override
+	public String getUuid() {
+        return uuid;
+    }
+
+    @Override
+	public void setUuid(String uuid) {
+        this.uuid = uuid;
+    }
+
+    @Override
+	public long getPhysicalNetworkId() {
+        return physicalNetworkId;
+    }
+
+    @Override
+	public String getManagementIp() {
+        return managementIp;
+    }
+
+    @Override
+	public String getInPortProfile() {
+        return inPortProfile;
+    }
+
+    @Override
+    public long getClusterId() {
+        return clusterId;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcConnection.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcConnection.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcConnection.java
new file mode 100644
index 0000000..f137148
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcConnection.java
@@ -0,0 +1,196 @@
+// 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.cisco;
+
+import java.util.Map;
+
+import com.cloud.utils.exception.ExecutionException;
+
+public interface CiscoVnmcConnection {
+
+    public boolean createTenant(String tenantName) throws ExecutionException;
+
+    public boolean deleteTenant(String tenantName) throws ExecutionException;
+
+    public boolean createTenantVDC(String tenantName) throws ExecutionException;
+
+    public boolean deleteTenantVDC(String tenantName) throws ExecutionException;
+
+    public boolean createTenantVDCEdgeDeviceProfile(String tenantName)
+            throws ExecutionException;
+
+    public boolean createTenantVDCEdgeStaticRoutePolicy(String tenantName)
+            throws ExecutionException;
+
+    public boolean createTenantVDCEdgeStaticRoute(String tenantName,
+            String nextHopIp, String destination, String netmask) throws ExecutionException;
+
+    public boolean associateTenantVDCEdgeStaticRoutePolicy(String tenantName)
+            throws ExecutionException;
+
+    public boolean associateTenantVDCEdgeDhcpPolicy(String tenantName,
+            String intfName) throws ExecutionException;
+
+    public boolean createTenantVDCEdgeDhcpPolicy(String tenantName,
+            String startIp, String endIp, String subnet, String nameServerIp,
+            String domain) throws ExecutionException;
+
+    public boolean associateTenantVDCEdgeDhcpServerPolicy(String tenantName,
+            String intfName) throws ExecutionException;
+
+    public boolean createTenantVDCEdgeSecurityProfile(String tenantName)
+            throws ExecutionException;
+
+    public boolean deleteTenantVDCEdgeSecurityProfile(String tenantName)
+            throws ExecutionException;
+
+    public boolean createTenantVDCSourceNatIpPool(String tenantName, String identifier,
+            String publicIp) throws ExecutionException;
+
+    public boolean createTenantVDCSourceNatRule(String tenantName, String identifier,
+            String startSourceIp, String endSourceIp) throws ExecutionException;
+
+    public boolean createTenantVDCSourceNatPolicy(String tenantName, String identifier)
+            throws ExecutionException;
+
+    public boolean createTenantVDCSourceNatPolicyRef(String tenantName, String identifier)
+            throws ExecutionException;
+
+    public boolean createTenantVDCDNatIpPool(String tenantName, String identifier,
+            String ipAddress) throws ExecutionException;
+
+    public boolean createTenantVDCDNatRule(String tenantName,
+            String identifier, String policyIdentifier,
+            String publicIp)
+            throws ExecutionException;
+
+    public boolean deleteTenantVDCDNatRule(String tenantName,
+            String identifier, String policyIdentifier)
+            throws ExecutionException;
+
+    public boolean createTenantVDCAclRuleForDNat(String tenantName,
+            String identifier, String policyIdentifier,
+            String ipAddress)
+            throws ExecutionException;
+
+    public boolean createTenantVDCDNatPolicy(String tenantName, String identifier)
+            throws ExecutionException;
+
+    public boolean deleteTenantVDCDNatPolicy(String tenantName, String identifier)
+            throws ExecutionException;
+
+    public boolean createTenantVDCDNatPolicyRef(String tenantName, String identifier)
+            throws ExecutionException;
+
+    public boolean createTenantVDCPFPortPool(String tenantName, String identifier,
+            String startPort, String endPort)
+            throws ExecutionException;
+
+    public boolean createTenantVDCPFIpPool(String tenantName, String identifier,
+            String ipAddress) throws ExecutionException;
+
+    public boolean createTenantVDCPFRule(String tenantName,
+            String identifier, String policyIdentifier,
+            String protocol, String publicIp,
+            String startPort, String endPort)
+            throws ExecutionException;
+
+    public boolean deleteTenantVDCPFRule(String tenantName,
+            String identifier, String policyIdentifier)
+            throws ExecutionException;
+
+    public boolean createTenantVDCAclRuleForPF(String tenantName,
+            String identifier, String policyIdentifier,
+            String protocol, String ipAddress,
+            String startPort, String endPort)
+            throws ExecutionException;
+
+    public boolean createTenantVDCPFPolicy(String tenantName, String identifier)
+            throws ExecutionException;
+
+    public boolean deleteTenantVDCPFPolicy(String tenantName, String identifier)
+            throws ExecutionException;
+
+    public boolean createTenantVDCPFPolicyRef(String tenantName, String identifier)
+            throws ExecutionException;
+
+    public boolean createTenantVDCNatPolicySet(String tenantName)
+            throws ExecutionException;
+
+    public boolean deleteTenantVDCNatPolicySet(String tenantName)
+            throws ExecutionException;
+    
+    public boolean associateNatPolicySet(String tenantName)
+            throws ExecutionException;
+
+    public boolean createTenantVDCIngressAclRule(String tenantName,
+            String identifier, String policyIdentifier,
+            String protocol, String sourceStartIp, String sourceEndIp,
+            String destStartPort, String destEndPort, String destIp)
+            throws ExecutionException;
+
+    public boolean createTenantVDCIngressAclRule(String tenantName,
+            String identifier, String policyIdentifier,
+            String protocol, String sourceStartIp, String sourceEndIp, String destIp)
+            throws ExecutionException;
+
+    public boolean createTenantVDCEgressAclRule(String tenantName,
+            String identifier, String policyIdentifier,
+            String protocol, String sourceStartPort, String sourceEndPort, String sourceIp,
+            String destStartIp, String destEndIp)
+            throws ExecutionException;
+
+    public boolean createTenantVDCEgressAclRule(String tenantName,
+            String identifier, String policyIdentifier,
+            String protocol, String sourceIp, String destStartIp, String destEndIp)
+            throws ExecutionException;
+
+    public boolean deleteTenantVDCAclRule(String tenantName,
+            String identifier, String policyIdentifier) throws ExecutionException;
+
+    public boolean createTenantVDCAclPolicy(String tenantName,
+            String identifier) throws ExecutionException;
+
+    public boolean createTenantVDCAclPolicyRef(String tenantName, String identifier,
+            boolean ingress) throws ExecutionException;
+
+    public boolean deleteTenantVDCAclPolicy(String tenantName, String identifier)
+            throws ExecutionException;
+
+    public boolean createTenantVDCAclPolicySet(String tenantName, boolean ingress)
+            throws ExecutionException;
+
+    public boolean deleteTenantVDCAclPolicySet(String tenantName, boolean ingress)
+            throws ExecutionException;
+
+    public boolean associateAclPolicySet(String tenantName)
+            throws ExecutionException;
+
+    public boolean createEdgeFirewall(String tenantName, String publicIp,
+            String insideIp, String publicSubnet, String insideSubnet)
+            throws ExecutionException;
+
+    public boolean deleteEdgeFirewall(String tenantName) throws ExecutionException;
+
+    public Map<String, String> listUnAssocAsa1000v() throws ExecutionException;
+
+    public boolean assignAsa1000v(String tenantName, String firewallDn)
+            throws ExecutionException;
+
+    public boolean unassignAsa1000v(String tenantName, String firewallDn)
+            throws ExecutionException;
+}
\ No newline at end of file


[15/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
Adding issues fixed in 4.1.0


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b0bbffb7
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b0bbffb7
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b0bbffb7

Branch: refs/heads/ui-vm-affinity
Commit: b0bbffb79ebb169355fbce499397a2a1c4f83af2
Parents: bc3e184
Author: Joe Brockmeier <jz...@zonker.net>
Authored: Sun Apr 14 23:08:08 2013 -0500
Committer: Joe Brockmeier <jz...@zonker.net>
Committed: Sun Apr 14 23:08:08 2013 -0500

----------------------------------------------------------------------
 docs/en-US/Release_Notes.xml | 4176 +++++++++++++++++++++++++++++++++++--
 1 files changed, 3954 insertions(+), 222 deletions(-)
----------------------------------------------------------------------



[11/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
Fixed typos

Signed-off-by: Milamber <mi...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/20614598
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/20614598
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/20614598

Branch: refs/heads/ui-vm-affinity
Commit: 20614598bfd91f09c0d4407265df0701896c26a1
Parents: ed2aa9f
Author: Pascal Borreli <pa...@borreli.com>
Authored: Sat Apr 13 00:09:15 2013 +0000
Committer: Milamber <mi...@apache.org>
Committed: Sat Apr 13 13:28:32 2013 +0000

----------------------------------------------------------------------
 api/src/com/cloud/vm/DiskProfile.java              |    2 +-
 client/tomcatconf/applicationContext.xml.in        |    6 +-
 .../subsystem/api/storage/CommandResult.java       |    2 +-
 .../api/storage/ObjectInDataStoreStateMachine.java |    2 +-
 .../image/motion/DefaultImageMotionStrategy.java   |    4 +-
 .../test/MockHypervisorHostEndPointRpcServer.java  |   72 +++++++
 .../test/MockHypervsiorHostEndPointRpcServer.java  |   72 -------
 .../integration-test/test/resource/component.xml   |    2 +-
 .../storage/HypervisorHostEndPointRpcServer.java   |  119 +++++++++++
 .../storage/HypervsiorHostEndPointRpcServer.java   |  119 -----------
 .../allocator/AbstractStoragePoolAllocator.java    |    2 +-
 .../allocator/ZoneWideStoragePoolAllocator.java    |    2 +-
 .../storage/datastore/DataObjectManagerImpl.java   |    6 +-
 .../driver/DefaultPrimaryDataStoreDriverImpl.java  |    4 +-
 .../DefaultPrimaryDatastoreProviderImpl.java       |    6 +-
 .../volume/TemplateInstallStrategyImpl.java        |    6 +-
 .../dns-notifier/resources/components-example.xml  |    2 +-
 .../CloudStackPrimaryDataStoreProviderImpl.java    |    6 +-
 .../cloud/network/ExteralIpAddressAllocator.java   |  165 ---------------
 .../cloud/network/ExternalIpAddressAllocator.java  |  165 +++++++++++++++
 server/src/com/cloud/network/IpAddrAllocator.java  |    2 +-
 .../com/cloud/template/TemplateManagerImpl.java    |    2 +-
 server/test/resources/network-mgr-component.xml    |    2 +-
 .../cloud/utils/component/ComponentContext.java    |    4 +-
 24 files changed, 387 insertions(+), 387 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/api/src/com/cloud/vm/DiskProfile.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/vm/DiskProfile.java b/api/src/com/cloud/vm/DiskProfile.java
index e34a334..e3a3386 100644
--- a/api/src/com/cloud/vm/DiskProfile.java
+++ b/api/src/com/cloud/vm/DiskProfile.java
@@ -139,7 +139,7 @@ public class DiskProfile {
         this.hyperType = hyperType;
     }
 
-    public HypervisorType getHypersorType() {
+    public HypervisorType getHypervisorType() {
         return this.hyperType;
     }
     

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/client/tomcatconf/applicationContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in
index 0d13877..15cd6fe 100644
--- a/client/tomcatconf/applicationContext.xml.in
+++ b/client/tomcatconf/applicationContext.xml.in
@@ -454,11 +454,11 @@
     <property name="name" value="Balance"/>
   </bean>
 
-  <bean id="ExteralIpAddressAllocator" class="com.cloud.network.ExteralIpAddressAllocator">
+  <bean id="ExternalIpAddressAllocator" class="com.cloud.network.ExternalIpAddressAllocator">
     <property name="name" value="Basic"/>
   </bean>
 
-  <bean id="hyervisorTemplateAdapter" class="com.cloud.template.HypervisorTemplateAdapter" />
+  <bean id="hypervisorTemplateAdapter" class="com.cloud.template.HypervisorTemplateAdapter" />
   <bean id="clusterAlertAdapter" class="com.cloud.alert.ClusterAlertAdapter" />
   <bean id="consoleProxyAlertAdapter" class="com.cloud.alert.ConsoleProxyAlertAdapter" />
   <bean id="secondaryStorageVmAlertAdapter" class="com.cloud.alert.SecondaryStorageVmAlertAdapter" />
@@ -733,7 +733,7 @@
   <bean id="defaultEndPointSelector" class="org.apache.cloudstack.storage.endpoint.DefaultEndPointSelector" />
   <bean id="defaultPrimaryDataStoreProviderManagerImpl" class="org.apache.cloudstack.storage.datastore.manager.DefaultPrimaryDataStoreProviderManagerImpl" />
   <bean id="eventUtils" class="com.cloud.event.EventUtils" />
-  <bean id="hypervsiorHostEndPointRpcServer" class="org.apache.cloudstack.storage.HypervsiorHostEndPointRpcServer" />
+  <bean id="hypervisorHostEndPointRpcServer" class="org.apache.cloudstack.storage.HypervisorHostEndPointRpcServer" />
   <bean id="iSCSI" class="org.apache.cloudstack.storage.datastore.type.ISCSI" />
   <bean id="ISO" class="org.apache.cloudstack.storage.image.format.ISO" />
   <bean id="imageDataFactoryImpl" class="org.apache.cloudstack.storage.image.ImageDataFactoryImpl" />

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/CommandResult.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/CommandResult.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/CommandResult.java
index 6b6139b..cc45914 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/CommandResult.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/CommandResult.java
@@ -34,7 +34,7 @@ public class CommandResult {
         return !this.success;
     }
     
-    public void setSucess(boolean success) {
+    public void setSuccess(boolean success) {
         this.success = success;
     }
     

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ObjectInDataStoreStateMachine.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ObjectInDataStoreStateMachine.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ObjectInDataStoreStateMachine.java
index 726ce08..f619ef4 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ObjectInDataStoreStateMachine.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ObjectInDataStoreStateMachine.java
@@ -26,7 +26,7 @@ public interface ObjectInDataStoreStateMachine extends StateObject<ObjectInDataS
         Creating2("This is only used with createOnlyRequested event"),
         Creating("The object is being creating on data store"),
         Created("The object is created"),
-        Ready("Template downloading is complished"),
+        Ready("Template downloading is accomplished"),
         Copying("The object is being coping"),
         Destroying("Template is destroying"),
         Destroyed("Template is destroyed"),

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/engine/storage/imagemotion/src/org/apache/cloudstack/storage/image/motion/DefaultImageMotionStrategy.java
----------------------------------------------------------------------
diff --git a/engine/storage/imagemotion/src/org/apache/cloudstack/storage/image/motion/DefaultImageMotionStrategy.java b/engine/storage/imagemotion/src/org/apache/cloudstack/storage/image/motion/DefaultImageMotionStrategy.java
index c49a521..a70fd8a 100644
--- a/engine/storage/imagemotion/src/org/apache/cloudstack/storage/image/motion/DefaultImageMotionStrategy.java
+++ b/engine/storage/imagemotion/src/org/apache/cloudstack/storage/image/motion/DefaultImageMotionStrategy.java
@@ -70,12 +70,12 @@ public class DefaultImageMotionStrategy implements ImageMotionStrategy {
         CommandResult result = new CommandResult();
        
         if (!answer.getResult()) {
-            result.setSucess(answer.getResult());
+            result.setSuccess(answer.getResult());
             result.setResult(answer.getDetails());
         } else {
             TemplateOnPrimaryDataStoreInfo templateStore = context.getTemplate();
             templateStore.setPath(answer.getPath());
-            result.setSucess(true);
+            result.setSuccess(true);
         }
 
         parentCall.complete(result);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/MockHypervisorHostEndPointRpcServer.java
----------------------------------------------------------------------
diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/MockHypervisorHostEndPointRpcServer.java b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/MockHypervisorHostEndPointRpcServer.java
new file mode 100644
index 0000000..8fc161b
--- /dev/null
+++ b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/MockHypervisorHostEndPointRpcServer.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.storage.test;
+
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
+import org.apache.cloudstack.storage.HostEndpointRpcServer;
+import org.apache.cloudstack.storage.HypervisorHostEndPoint;
+
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.Command;
+
+public class MockHypervisorHostEndPointRpcServer implements HostEndpointRpcServer {
+    private ScheduledExecutorService executor;
+    public MockHypervisorHostEndPointRpcServer() {
+        executor = Executors.newScheduledThreadPool(10);
+    }
+    
+    protected class MockRpcCallBack implements Runnable {
+        private final Command cmd;
+        private final AsyncCompletionCallback<Answer> callback; 
+        public MockRpcCallBack(Command cmd, final AsyncCompletionCallback<Answer> callback) {
+            this.cmd = cmd;
+            this.callback = callback;
+        }
+        @Override
+        public void run() {
+            try {
+            Answer answer = new Answer(cmd, false, "unknown command");
+            /*if (cmd instanceof CopyTemplateToPrimaryStorageCmd) {
+                answer = new CopyTemplateToPrimaryStorageAnswer(cmd, UUID.randomUUID().toString());
+            } else if (cmd instanceof CreateVolumeFromBaseImageCommand) {
+                answer = new CreateVolumeAnswer(cmd, UUID.randomUUID().toString());
+            }*/
+            
+           callback.complete(answer);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        
+    }
+    
+    public void sendCommandAsync(HypervisorHostEndPoint host, final Command command, final AsyncCompletionCallback<Answer> callback) {
+        executor.schedule(new MockRpcCallBack(command, callback), 10, TimeUnit.SECONDS);
+    }
+    
+    @Override
+    public Answer sendCommand(HypervisorHostEndPoint host, Command command) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/MockHypervsiorHostEndPointRpcServer.java
----------------------------------------------------------------------
diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/MockHypervsiorHostEndPointRpcServer.java b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/MockHypervsiorHostEndPointRpcServer.java
deleted file mode 100644
index d698576..0000000
--- a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/MockHypervsiorHostEndPointRpcServer.java
+++ /dev/null
@@ -1,72 +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.storage.test;
-
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
-import org.apache.cloudstack.storage.HostEndpointRpcServer;
-import org.apache.cloudstack.storage.HypervisorHostEndPoint;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.Command;
-
-public class MockHypervsiorHostEndPointRpcServer implements HostEndpointRpcServer {
-    private ScheduledExecutorService executor;
-    public MockHypervsiorHostEndPointRpcServer() {
-        executor = Executors.newScheduledThreadPool(10);
-    }
-    
-    protected class MockRpcCallBack implements Runnable {
-        private final Command cmd;
-        private final AsyncCompletionCallback<Answer> callback; 
-        public MockRpcCallBack(Command cmd, final AsyncCompletionCallback<Answer> callback) {
-            this.cmd = cmd;
-            this.callback = callback;
-        }
-        @Override
-        public void run() {
-            try {
-            Answer answer = new Answer(cmd, false, "unknown command");
-            /*if (cmd instanceof CopyTemplateToPrimaryStorageCmd) {
-                answer = new CopyTemplateToPrimaryStorageAnswer(cmd, UUID.randomUUID().toString());
-            } else if (cmd instanceof CreateVolumeFromBaseImageCommand) {
-                answer = new CreateVolumeAnswer(cmd, UUID.randomUUID().toString());
-            }*/
-            
-           callback.complete(answer);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-        
-    }
-    
-    public void sendCommandAsync(HypervisorHostEndPoint host, final Command command, final AsyncCompletionCallback<Answer> callback) {
-        executor.schedule(new MockRpcCallBack(command, callback), 10, TimeUnit.SECONDS);
-    }
-    
-    @Override
-    public Answer sendCommand(HypervisorHostEndPoint host, Command command) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/engine/storage/integration-test/test/resource/component.xml
----------------------------------------------------------------------
diff --git a/engine/storage/integration-test/test/resource/component.xml b/engine/storage/integration-test/test/resource/component.xml
index 0368ad4..5ba87e8 100644
--- a/engine/storage/integration-test/test/resource/component.xml
+++ b/engine/storage/integration-test/test/resource/component.xml
@@ -75,7 +75,7 @@
   </bean>
 
  
-  <bean id="ExteralIpAddressAllocator" class="com.cloud.network.ExteralIpAddressAllocator">
+  <bean id="ExternalIpAddressAllocator" class="com.cloud.network.ExternalIpAddressAllocator">
     <property name="name" value="Basic"/>
   </bean>
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/engine/storage/src/org/apache/cloudstack/storage/HypervisorHostEndPointRpcServer.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/HypervisorHostEndPointRpcServer.java b/engine/storage/src/org/apache/cloudstack/storage/HypervisorHostEndPointRpcServer.java
new file mode 100644
index 0000000..bc21776
--- /dev/null
+++ b/engine/storage/src/org/apache/cloudstack/storage/HypervisorHostEndPointRpcServer.java
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.storage;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
+import org.apache.cloudstack.framework.async.AsyncCallbackDispatcher;
+import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
+import org.apache.cloudstack.framework.async.AsyncRpcConext;
+import org.apache.cloudstack.framework.rpc.RpcCallbackListener;
+import org.apache.cloudstack.framework.rpc.RpcException;
+import org.apache.cloudstack.framework.rpc.RpcProvider;
+import org.apache.cloudstack.framework.rpc.RpcServiceDispatcher;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.Command;
+import com.cloud.utils.exception.CloudRuntimeException;
+
+@Component
+public class HypervisorHostEndPointRpcServer implements HostEndpointRpcServer {
+    private static final Logger s_logger = Logger.getLogger(HypervisorHostEndPointRpcServer.class);
+    
+    @Inject
+    private RpcProvider rpcProvider;
+    
+    public HypervisorHostEndPointRpcServer() {
+    }
+    
+    public HypervisorHostEndPointRpcServer(RpcProvider rpcProvider) {
+        rpcProvider = rpcProvider;
+        rpcProvider.registerRpcServiceEndpoint(RpcServiceDispatcher.getDispatcher(this));
+    }
+    
+    @PostConstruct
+    public void Initialize() {
+        rpcProvider.registerRpcServiceEndpoint(RpcServiceDispatcher.getDispatcher(this));
+    }
+    
+    @Override
+    public void sendCommandAsync(HypervisorHostEndPoint host, final Command command, final AsyncCompletionCallback<Answer> callback) {
+        rpcProvider.newCall(host.getHostAddr()).addCallbackListener(new RpcCallbackListener<Answer>() {
+            @Override
+            public void onSuccess(Answer result) {
+                callback.complete(result);
+            }
+
+            @Override
+            public void onFailure(RpcException e) {
+                Answer answer = new Answer(command, false, e.toString());
+                callback.complete(answer);
+            }
+        }).apply();
+    }
+    
+    private class SendCommandContext<T> extends AsyncRpcConext<T> {
+        private T answer;
+       
+        public SendCommandContext(AsyncCompletionCallback<T> callback) {
+            super(callback);
+        }
+        
+        public void setAnswer(T answer) {
+            this.answer = answer;
+        }
+        
+        public T getAnswer() {
+            return this.answer;
+        }
+        
+    }
+
+    @Override
+    public Answer sendCommand(HypervisorHostEndPoint host, Command command) {
+        SendCommandContext<Answer> context = new SendCommandContext<Answer>(null);
+        AsyncCallbackDispatcher<HypervisorHostEndPointRpcServer, Answer> caller = AsyncCallbackDispatcher.create(this);
+        caller.setCallback(caller.getTarget().sendCommandCallback(null, null))
+        .setContext(context);
+        
+        this.sendCommandAsync(host, command, caller);
+        
+        synchronized (context) {
+            try {
+                context.wait();
+            } catch (InterruptedException e) {
+                s_logger.debug(e.toString());
+                throw new CloudRuntimeException("wait on context is interrupted", e);
+            }
+        }
+        
+        return context.getAnswer();
+    }
+    
+    protected Object sendCommandCallback(AsyncCallbackDispatcher<HypervisorHostEndPointRpcServer, Answer> callback, SendCommandContext<Answer> context) {
+        context.setAnswer((Answer)callback.getResult());
+        synchronized(context) {
+            context.notify();
+        }
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/engine/storage/src/org/apache/cloudstack/storage/HypervsiorHostEndPointRpcServer.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/HypervsiorHostEndPointRpcServer.java b/engine/storage/src/org/apache/cloudstack/storage/HypervsiorHostEndPointRpcServer.java
deleted file mode 100644
index f441f39..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/HypervsiorHostEndPointRpcServer.java
+++ /dev/null
@@ -1,119 +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.storage;
-
-import javax.annotation.PostConstruct;
-import javax.inject.Inject;
-
-import org.apache.cloudstack.framework.async.AsyncCallbackDispatcher;
-import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
-import org.apache.cloudstack.framework.async.AsyncRpcConext;
-import org.apache.cloudstack.framework.rpc.RpcCallbackListener;
-import org.apache.cloudstack.framework.rpc.RpcException;
-import org.apache.cloudstack.framework.rpc.RpcProvider;
-import org.apache.cloudstack.framework.rpc.RpcServiceDispatcher;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.Command;
-import com.cloud.utils.exception.CloudRuntimeException;
-
-@Component
-public class HypervsiorHostEndPointRpcServer implements HostEndpointRpcServer {
-    private static final Logger s_logger = Logger.getLogger(HypervsiorHostEndPointRpcServer.class);
-    
-    @Inject
-    private RpcProvider rpcProvider;
-    
-    public HypervsiorHostEndPointRpcServer() {
-    }
-    
-    public HypervsiorHostEndPointRpcServer(RpcProvider rpcProvider) {
-        rpcProvider = rpcProvider;
-        rpcProvider.registerRpcServiceEndpoint(RpcServiceDispatcher.getDispatcher(this));
-    }
-    
-    @PostConstruct
-    public void Initialize() {
-        rpcProvider.registerRpcServiceEndpoint(RpcServiceDispatcher.getDispatcher(this));
-    }
-    
-    @Override
-    public void sendCommandAsync(HypervisorHostEndPoint host, final Command command, final AsyncCompletionCallback<Answer> callback) {
-        rpcProvider.newCall(host.getHostAddr()).addCallbackListener(new RpcCallbackListener<Answer>() {
-            @Override
-            public void onSuccess(Answer result) {
-                callback.complete(result);
-            }
-
-            @Override
-            public void onFailure(RpcException e) {
-                Answer answer = new Answer(command, false, e.toString());
-                callback.complete(answer);
-            }
-        }).apply();
-    }
-    
-    private class SendCommandContext<T> extends AsyncRpcConext<T> {
-        private T answer;
-       
-        public SendCommandContext(AsyncCompletionCallback<T> callback) {
-            super(callback);
-        }
-        
-        public void setAnswer(T answer) {
-            this.answer = answer;
-        }
-        
-        public T getAnswer() {
-            return this.answer;
-        }
-        
-    }
-
-    @Override
-    public Answer sendCommand(HypervisorHostEndPoint host, Command command) {
-        SendCommandContext<Answer> context = new SendCommandContext<Answer>(null);
-        AsyncCallbackDispatcher<HypervsiorHostEndPointRpcServer, Answer> caller = AsyncCallbackDispatcher.create(this);
-        caller.setCallback(caller.getTarget().sendCommandCallback(null, null))
-        .setContext(context);
-        
-        this.sendCommandAsync(host, command, caller);
-        
-        synchronized (context) {
-            try {
-                context.wait();
-            } catch (InterruptedException e) {
-                s_logger.debug(e.toString());
-                throw new CloudRuntimeException("wait on context is interrupted", e);
-            }
-        }
-        
-        return context.getAnswer();
-    }
-    
-    protected Object sendCommandCallback(AsyncCallbackDispatcher<HypervsiorHostEndPointRpcServer, Answer> callback, SendCommandContext<Answer> context) {
-        context.setAnswer((Answer)callback.getResult());
-        synchronized(context) {
-            context.notify();
-        }
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
index 6334ca7..3a66b85 100755
--- a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
@@ -176,7 +176,7 @@ public abstract class AbstractStoragePoolAllocator extends AdapterBase implement
         
 		Long clusterId = pool.getClusterId();
 		ClusterVO cluster = _clusterDao.findById(clusterId);
-		if (!(cluster.getHypervisorType() == dskCh.getHypersorType())) {
+		if (!(cluster.getHypervisorType() == dskCh.getHypervisorType())) {
     		if (s_logger.isDebugEnabled()) {
                 s_logger.debug("StoragePool's Cluster does not have required hypervisorType, skipping this pool");
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java
index 7c6c946..1d3cd81 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java
@@ -57,7 +57,7 @@ public class ZoneWideStoragePoolAllocator extends AbstractStoragePoolAllocator {
 			DeploymentPlan plan, ExcludeList avoid, int returnUpTo) {
 	    s_logger.debug("ZoneWideStoragePoolAllocator to find storage pool");
 		List<StoragePool> suitablePools = new ArrayList<StoragePool>();
-		HypervisorType hypervisor = dskCh.getHypersorType();
+		HypervisorType hypervisor = dskCh.getHypervisorType();
 		if (hypervisor != null) {
 			if (hypervisor != HypervisorType.KVM) {
 				s_logger.debug("Only kvm supports zone wide storage");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java
index 218f901..9d1afbe 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java
@@ -109,7 +109,7 @@ public class DataObjectManagerImpl implements DataObjectManager {
                 if (obj == null) {
                     CreateCmdResult result = new CreateCmdResult(
                             null, null);
-                    result.setSucess(false);
+                    result.setSuccess(false);
                     result.setResult(e.toString());
                     callback.complete(result);
                     return;
@@ -124,7 +124,7 @@ public class DataObjectManagerImpl implements DataObjectManager {
                         data, store);
             } catch (Exception e) {
                 CreateCmdResult result = new CreateCmdResult(null, null);
-                result.setSucess(false);
+                result.setSuccess(false);
                 result.setResult(e.toString());
                 callback.complete(result);
                 return;
@@ -153,7 +153,7 @@ public class DataObjectManagerImpl implements DataObjectManager {
                 s_logger.debug("state transation failed", e1);
             }
             CreateCmdResult result = new CreateCmdResult(null, null);
-            result.setSucess(false);
+            result.setSuccess(false);
             result.setResult(e.toString());
             callback.complete(result);
             return;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/DefaultPrimaryDataStoreDriverImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/DefaultPrimaryDataStoreDriverImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/DefaultPrimaryDataStoreDriverImpl.java
index 6d0c2c6..e5ee742 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/DefaultPrimaryDataStoreDriverImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/DefaultPrimaryDataStoreDriverImpl.java
@@ -144,12 +144,12 @@ public class DefaultPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
         CreateVolumeAnswer answer = (CreateVolumeAnswer)callback.getResult();
         CommandResult result = new CommandResult();
         if (answer == null || answer.getDetails() != null) {
-            result.setSucess(false);
+            result.setSuccess(false);
             if (answer != null) {
                 result.setResult(answer.getDetails());
             }
         } else {
-            result.setSucess(true);
+            result.setSuccess(true);
             VolumeObject volume = context.getVolume();
             volume.setPath(answer.getVolumeUuid());
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/DefaultPrimaryDatastoreProviderImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/DefaultPrimaryDatastoreProviderImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/DefaultPrimaryDatastoreProviderImpl.java
index 46fa738..8c674dc 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/DefaultPrimaryDatastoreProviderImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/DefaultPrimaryDatastoreProviderImpl.java
@@ -42,7 +42,7 @@ public class DefaultPrimaryDatastoreProviderImpl implements PrimaryDataStoreProv
     @Inject
     PrimaryDataStoreProviderManager storeMgr;
 
-    protected DataStoreLifeCycle lifecyle;
+    protected DataStoreLifeCycle lifecycle;
     protected String uuid;
     protected long id;
     @Override
@@ -52,12 +52,12 @@ public class DefaultPrimaryDatastoreProviderImpl implements PrimaryDataStoreProv
 
     @Override
     public DataStoreLifeCycle getDataStoreLifeCycle() {
-        return this.lifecyle;
+        return this.lifecycle;
     }
 
     @Override
     public boolean configure(Map<String, Object> params) {
-        lifecyle = ComponentContext.inject(DefaultPrimaryDataStoreLifeCycleImpl.class);
+        lifecycle = ComponentContext.inject(DefaultPrimaryDataStoreLifeCycleImpl.class);
         driver = ComponentContext.inject(DefaultPrimaryDataStoreDriverImpl.class);
         listener = ComponentContext.inject(DefaultHostListener.class);
         return true;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/engine/storage/volume/src/org/apache/cloudstack/storage/volume/TemplateInstallStrategyImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/TemplateInstallStrategyImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/TemplateInstallStrategyImpl.java
index 5f1735c..e099619 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/TemplateInstallStrategyImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/TemplateInstallStrategyImpl.java
@@ -107,7 +107,7 @@ public class TemplateInstallStrategyImpl implements TemplateInstallStrategy {
                 if (obj == null) {
                     CreateBaseImageResult result = new CreateBaseImageResult(
                             null);
-                    result.setSucess(false);
+                    result.setSuccess(false);
                     result.setResult(e.toString());
                     callback.complete(result);
                     return null;
@@ -122,7 +122,7 @@ public class TemplateInstallStrategyImpl implements TemplateInstallStrategy {
                         template, store);
             } catch (Exception e) {
                 CreateBaseImageResult result = new CreateBaseImageResult(null);
-                result.setSucess(false);
+                result.setSuccess(false);
                 result.setResult(e.toString());
                 callback.complete(result);
                 return null;
@@ -145,7 +145,7 @@ public class TemplateInstallStrategyImpl implements TemplateInstallStrategy {
                 s_logger.debug("state transation failed", e1);
             }
             CreateBaseImageResult result = new CreateBaseImageResult(null);
-            result.setSucess(false);
+            result.setSuccess(false);
             result.setResult(e.toString());
             callback.complete(result);
             return null;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/plugins/network-elements/dns-notifier/resources/components-example.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/dns-notifier/resources/components-example.xml b/plugins/network-elements/dns-notifier/resources/components-example.xml
index 6493e74..2e9c5be 100755
--- a/plugins/network-elements/dns-notifier/resources/components-example.xml
+++ b/plugins/network-elements/dns-notifier/resources/components-example.xml
@@ -86,7 +86,7 @@ under the License.
             <adapter name="Balance" class="com.cloud.storage.secondary.SecondaryStorageVmDefaultAllocator"/>
         </adapters>
         <adapters key="com.cloud.network.IpAddrAllocator">
-            <adapter name="Basic" class="com.cloud.network.ExteralIpAddressAllocator"/>
+            <adapter name="Basic" class="com.cloud.network.ExternalIpAddressAllocator"/>
         </adapters>
         <adapters key="com.cloud.server.auth.UserAuthenticator">
             <!-- <adapter name="SHA256SALT" class="com.cloud.server.auth.SHA256SaltedUserAuthenticator"/> -->

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/provider/CloudStackPrimaryDataStoreProviderImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/provider/CloudStackPrimaryDataStoreProviderImpl.java b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/provider/CloudStackPrimaryDataStoreProviderImpl.java
index 4d46d99..826f07a 100644
--- a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/provider/CloudStackPrimaryDataStoreProviderImpl.java
+++ b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/provider/CloudStackPrimaryDataStoreProviderImpl.java
@@ -37,7 +37,7 @@ public class CloudStackPrimaryDataStoreProviderImpl implements
     private final String providerName = "ancient primary data store provider";
     protected PrimaryDataStoreDriver driver;
     protected HypervisorHostListener listener;
-    protected DataStoreLifeCycle lifecyle;
+    protected DataStoreLifeCycle lifecycle;
 
     CloudStackPrimaryDataStoreProviderImpl() {
         
@@ -50,12 +50,12 @@ public class CloudStackPrimaryDataStoreProviderImpl implements
 
     @Override
     public DataStoreLifeCycle getDataStoreLifeCycle() {
-        return this.lifecyle;
+        return this.lifecycle;
     }
 
     @Override
     public boolean configure(Map<String, Object> params) {
-        lifecyle = ComponentContext.inject(CloudStackPrimaryDataStoreLifeCycleImpl.class);
+        lifecycle = ComponentContext.inject(CloudStackPrimaryDataStoreLifeCycleImpl.class);
         driver = ComponentContext.inject(CloudStackPrimaryDataStoreDriverImpl.class);
         listener = ComponentContext.inject(DefaultHostListener.class);
         return true;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/server/src/com/cloud/network/ExteralIpAddressAllocator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExteralIpAddressAllocator.java b/server/src/com/cloud/network/ExteralIpAddressAllocator.java
deleted file mode 100644
index 2b78712..0000000
--- a/server/src/com/cloud/network/ExteralIpAddressAllocator.java
+++ /dev/null
@@ -1,165 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Map;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.configuration.dao.ConfigurationDao;
-import com.cloud.dc.dao.VlanDao;
-import com.cloud.network.dao.IPAddressDao;
-import com.cloud.utils.component.AdapterBase;
-import com.cloud.utils.exception.CloudRuntimeException;
-
-@Local(value=IpAddrAllocator.class)
-public class ExteralIpAddressAllocator extends AdapterBase implements IpAddrAllocator{
-    private static final Logger s_logger = Logger.getLogger(ExteralIpAddressAllocator.class);
-    String _name;
-    @Inject ConfigurationDao _configDao = null;
-    @Inject IPAddressDao _ipAddressDao = null;
-    @Inject VlanDao _vlanDao;
-    private boolean _isExternalIpAllocatorEnabled = false;
-    private String _externalIpAllocatorUrl = null;
-
-
-    @Override
-    public IpAddr getPrivateIpAddress(String macAddr, long dcId, long podId) {
-        if (_externalIpAllocatorUrl == null || this._externalIpAllocatorUrl.equalsIgnoreCase("")) {
-            return new IpAddr();
-        }
-        String urlString = this._externalIpAllocatorUrl + "?command=getIpAddr&mac=" + macAddr + "&dc=" + dcId + "&pod=" + podId;
-        s_logger.debug("getIP:" + urlString);
-
-        BufferedReader in = null;
-        try {
-            URL url = new URL(urlString);
-            URLConnection conn = url.openConnection();
-            conn.setReadTimeout(30000);
-
-            in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
-            String inputLine;
-            while ((inputLine = in.readLine()) != null) {
-                s_logger.debug(inputLine);
-                String[] tokens = inputLine.split(",");
-                if (tokens.length != 3) {
-                    s_logger.debug("the return value should be: mac,netmask,gateway");
-                    return new IpAddr();
-                }
-                return new IpAddr(tokens[0], tokens[1], tokens[2]);
-            }
-
-            return new IpAddr();
-        } catch (MalformedURLException e) {
-            throw new CloudRuntimeException("URL is malformed " + urlString, e);
-        } catch (IOException e) {
-            return new IpAddr();
-        } finally {
-            if (in != null) {
-                try {
-                    in.close();
-                } catch (IOException e) {
-                }
-            }
-        }
-
-    }
-
-    @Override
-    public IpAddr getPublicIpAddress(String macAddr, long dcId, long podId) {
-        /*TODO: call API to get  ip address from external DHCP server*/
-        return getPrivateIpAddress(macAddr, dcId, podId);
-    }
-
-    @Override
-    public boolean releasePrivateIpAddress(String ip, long dcId, long podId) {
-        /*TODO: call API to release the ip address from external DHCP server*/
-        if (_externalIpAllocatorUrl == null || this._externalIpAllocatorUrl.equalsIgnoreCase("")) {
-            return false;
-        }
-
-        String urlString = this._externalIpAllocatorUrl + "?command=releaseIpAddr&ip=" + ip + "&dc=" + dcId + "&pod=" + podId;
-
-        s_logger.debug("releaseIP:" + urlString);
-        BufferedReader in = null;
-        try {
-            URL url = new URL(urlString);
-            URLConnection conn = url.openConnection();
-            conn.setReadTimeout(30000);
-
-            in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
-
-            return true;
-        } catch (MalformedURLException e) {
-            throw new CloudRuntimeException("URL is malformed " + urlString, e);
-        } catch (IOException e) {
-            return false;
-        } finally {
-            if (in != null) {
-                try {
-                    in.close();
-                } catch (IOException e) {
-                }
-            }
-        }
-    }
-
-    @Override
-    public boolean releasePublicIpAddress(String ip, long dcId, long podId) {
-        /*TODO: call API to release the ip address from external DHCP server*/
-        return releasePrivateIpAddress(ip, dcId, podId);
-    }
-
-    @Override
-    public boolean exteralIpAddressAllocatorEnabled() {
-        return _isExternalIpAllocatorEnabled;
-    }
-
-    @Override
-    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-        _isExternalIpAllocatorEnabled = Boolean.parseBoolean(_configDao.getValue("direct.attach.network.externalIpAllocator.enabled"));
-        _externalIpAllocatorUrl = _configDao.getValue("direct.attach.network.externalIpAllocator.url");
-        _name = name;
-
-        return true;
-    }
-
-    @Override
-    public String getName() {
-        return _name;
-    }
-
-    @Override
-    public boolean start() {
-        return true;
-    }
-
-    @Override
-    public boolean stop() {
-        return true;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/server/src/com/cloud/network/ExternalIpAddressAllocator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExternalIpAddressAllocator.java b/server/src/com/cloud/network/ExternalIpAddressAllocator.java
new file mode 100644
index 0000000..f24fa2d
--- /dev/null
+++ b/server/src/com/cloud/network/ExternalIpAddressAllocator.java
@@ -0,0 +1,165 @@
+// 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 java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Map;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+
+import org.apache.log4j.Logger;
+
+import com.cloud.configuration.dao.ConfigurationDao;
+import com.cloud.dc.dao.VlanDao;
+import com.cloud.network.dao.IPAddressDao;
+import com.cloud.utils.component.AdapterBase;
+import com.cloud.utils.exception.CloudRuntimeException;
+
+@Local(value=IpAddrAllocator.class)
+public class ExternalIpAddressAllocator extends AdapterBase implements IpAddrAllocator{
+    private static final Logger s_logger = Logger.getLogger(ExternalIpAddressAllocator.class);
+    String _name;
+    @Inject ConfigurationDao _configDao = null;
+    @Inject IPAddressDao _ipAddressDao = null;
+    @Inject VlanDao _vlanDao;
+    private boolean _isExternalIpAllocatorEnabled = false;
+    private String _externalIpAllocatorUrl = null;
+
+
+    @Override
+    public IpAddr getPrivateIpAddress(String macAddr, long dcId, long podId) {
+        if (_externalIpAllocatorUrl == null || this._externalIpAllocatorUrl.equalsIgnoreCase("")) {
+            return new IpAddr();
+        }
+        String urlString = this._externalIpAllocatorUrl + "?command=getIpAddr&mac=" + macAddr + "&dc=" + dcId + "&pod=" + podId;
+        s_logger.debug("getIP:" + urlString);
+
+        BufferedReader in = null;
+        try {
+            URL url = new URL(urlString);
+            URLConnection conn = url.openConnection();
+            conn.setReadTimeout(30000);
+
+            in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+            String inputLine;
+            while ((inputLine = in.readLine()) != null) {
+                s_logger.debug(inputLine);
+                String[] tokens = inputLine.split(",");
+                if (tokens.length != 3) {
+                    s_logger.debug("the return value should be: mac,netmask,gateway");
+                    return new IpAddr();
+                }
+                return new IpAddr(tokens[0], tokens[1], tokens[2]);
+            }
+
+            return new IpAddr();
+        } catch (MalformedURLException e) {
+            throw new CloudRuntimeException("URL is malformed " + urlString, e);
+        } catch (IOException e) {
+            return new IpAddr();
+        } finally {
+            if (in != null) {
+                try {
+                    in.close();
+                } catch (IOException e) {
+                }
+            }
+        }
+
+    }
+
+    @Override
+    public IpAddr getPublicIpAddress(String macAddr, long dcId, long podId) {
+        /*TODO: call API to get  ip address from external DHCP server*/
+        return getPrivateIpAddress(macAddr, dcId, podId);
+    }
+
+    @Override
+    public boolean releasePrivateIpAddress(String ip, long dcId, long podId) {
+        /*TODO: call API to release the ip address from external DHCP server*/
+        if (_externalIpAllocatorUrl == null || this._externalIpAllocatorUrl.equalsIgnoreCase("")) {
+            return false;
+        }
+
+        String urlString = this._externalIpAllocatorUrl + "?command=releaseIpAddr&ip=" + ip + "&dc=" + dcId + "&pod=" + podId;
+
+        s_logger.debug("releaseIP:" + urlString);
+        BufferedReader in = null;
+        try {
+            URL url = new URL(urlString);
+            URLConnection conn = url.openConnection();
+            conn.setReadTimeout(30000);
+
+            in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+
+            return true;
+        } catch (MalformedURLException e) {
+            throw new CloudRuntimeException("URL is malformed " + urlString, e);
+        } catch (IOException e) {
+            return false;
+        } finally {
+            if (in != null) {
+                try {
+                    in.close();
+                } catch (IOException e) {
+                }
+            }
+        }
+    }
+
+    @Override
+    public boolean releasePublicIpAddress(String ip, long dcId, long podId) {
+        /*TODO: call API to release the ip address from external DHCP server*/
+        return releasePrivateIpAddress(ip, dcId, podId);
+    }
+
+    @Override
+    public boolean externalIpAddressAllocatorEnabled() {
+        return _isExternalIpAllocatorEnabled;
+    }
+
+    @Override
+    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
+        _isExternalIpAllocatorEnabled = Boolean.parseBoolean(_configDao.getValue("direct.attach.network.externalIpAllocator.enabled"));
+        _externalIpAllocatorUrl = _configDao.getValue("direct.attach.network.externalIpAllocator.url");
+        _name = name;
+
+        return true;
+    }
+
+    @Override
+    public String getName() {
+        return _name;
+    }
+
+    @Override
+    public boolean start() {
+        return true;
+    }
+
+    @Override
+    public boolean stop() {
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/server/src/com/cloud/network/IpAddrAllocator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/IpAddrAllocator.java b/server/src/com/cloud/network/IpAddrAllocator.java
index d79125b..6cdf597 100644
--- a/server/src/com/cloud/network/IpAddrAllocator.java
+++ b/server/src/com/cloud/network/IpAddrAllocator.java
@@ -52,5 +52,5 @@ public interface IpAddrAllocator extends Adapter {
 	public IpAddr getPrivateIpAddress(String macAddr, long dcId, long podId);
 	public boolean releasePublicIpAddress(String ip, long dcId, long podId);
 	public boolean releasePrivateIpAddress(String ip, long dcId, long podId);
-	public boolean exteralIpAddressAllocatorEnabled();
+	public boolean externalIpAddressAllocatorEnabled();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java
index 2892e00..576440a 100755
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@ -273,7 +273,7 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
     	if (type == HypervisorType.BareMetal) {
     		adapter = AdapterBase.getAdapterByName(_adapters, TemplateAdapterType.BareMetal.getName());
     	} else {
-    		// see HyervisorTemplateAdapter
+    		// see HypervisorTemplateAdapter
     		adapter =  AdapterBase.getAdapterByName(_adapters, TemplateAdapterType.Hypervisor.getName());
     	}
     	

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/server/test/resources/network-mgr-component.xml
----------------------------------------------------------------------
diff --git a/server/test/resources/network-mgr-component.xml b/server/test/resources/network-mgr-component.xml
index 42d3c2e..b55a68b 100644
--- a/server/test/resources/network-mgr-component.xml
+++ b/server/test/resources/network-mgr-component.xml
@@ -78,7 +78,7 @@ under the License.
             <!--<adapter name="NiciraNvpGuestNetworkGuru" class="com.cloud.network.guru.NiciraNvpGuestNetworkGuru"/> -->
         </adapters>
         <adapters key="com.cloud.network.IpAddrAllocator">
-            <adapter name="Basic" class="com.cloud.network.ExteralIpAddressAllocator"/>
+            <adapter name="Basic" class="com.cloud.network.ExternalIpAddressAllocator"/>
         </adapters>
         <adapters key="com.cloud.network.element.NetworkElement">
             <adapter name="VirtualRouter" class="com.cloud.network.element.VirtualRouterElement"/>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20614598/utils/src/com/cloud/utils/component/ComponentContext.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/component/ComponentContext.java b/utils/src/com/cloud/utils/component/ComponentContext.java
index 796d4ec..5c5194c 100644
--- a/utils/src/com/cloud/utils/component/ComponentContext.java
+++ b/utils/src/com/cloud/utils/component/ComponentContext.java
@@ -71,14 +71,14 @@ public class ComponentContext implements ApplicationContextAware {
     		beanFactory.configureBean(bean, entry.getKey());
     	}
     	
-    	Map<String, ComponentLifecycle> lifecyleComponents = getApplicationContext().getBeansOfType(ComponentLifecycle.class);
+    	Map<String, ComponentLifecycle> lifecycleComponents = getApplicationContext().getBeansOfType(ComponentLifecycle.class);
  
     	Map[] classifiedComponents = new Map[ComponentLifecycle.MAX_RUN_LEVELS];
     	for(int i = 0; i < ComponentLifecycle.MAX_RUN_LEVELS; i++) {
     		classifiedComponents[i] = new HashMap<String, ComponentLifecycle>();
     	}
     	
-    	for(Map.Entry<String, ComponentLifecycle> entry : lifecyleComponents.entrySet()) {
+    	for(Map.Entry<String, ComponentLifecycle> entry : lifecycleComponents.entrySet()) {
     		classifiedComponents[entry.getValue().getRunLevel()].put(entry.getKey(), entry.getValue());
     	}
 


[07/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
Added the AffinityGroupProcessor definition to nonossComponentContext.xml.in to avoid auto-wiring failure for non-oss build


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e354807e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e354807e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e354807e

Branch: refs/heads/ui-vm-affinity
Commit: e354807e05312ba9d586544964ae99371803d145
Parents: 4b1a9f1
Author: Prachi Damle <pr...@cloud.com>
Authored: Fri Apr 12 15:31:16 2013 -0700
Committer: Prachi Damle <pr...@cloud.com>
Committed: Fri Apr 12 15:32:44 2013 -0700

----------------------------------------------------------------------
 client/tomcatconf/nonossComponentContext.xml.in |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e354807e/client/tomcatconf/nonossComponentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/nonossComponentContext.xml.in b/client/tomcatconf/nonossComponentContext.xml.in
index fc8a9cd..3ede263 100644
--- a/client/tomcatconf/nonossComponentContext.xml.in
+++ b/client/tomcatconf/nonossComponentContext.xml.in
@@ -339,5 +339,13 @@
       </list>
     </property>
   </bean>
+  
+  <!--
+   AffinityGroup Processors
+  -->
+    <bean id="HostAntiAffinityProcessor" class="org.apache.cloudstack.affinity.HostAntiAffinityProcessor">
+    	<property name="name" value="HostAntiAffinityProcessor"/>
+    	<property name="type" value="host anti-affinity"/>
+ 	</bean>
 
 </beans>


[24/33] Squashed commit of the following:

Posted by bf...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoAsa1000vService.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoAsa1000vService.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoAsa1000vService.java
new file mode 100755
index 0000000..dff9288
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoAsa1000vService.java
@@ -0,0 +1,43 @@
+// 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.element;
+
+import java.util.List;
+
+import com.cloud.api.commands.AddCiscoAsa1000vResourceCmd;
+import com.cloud.api.commands.DeleteCiscoAsa1000vResourceCmd;
+import com.cloud.api.commands.ListCiscoAsa1000vResourcesCmd;
+import com.cloud.api.response.CiscoAsa1000vResourceResponse;
+import com.cloud.network.Network;
+import com.cloud.network.cisco.CiscoAsa1000vDevice;
+import com.cloud.network.cisco.CiscoAsa1000vDeviceVO;
+import com.cloud.utils.component.PluggableService;
+
+public interface CiscoAsa1000vService extends PluggableService {
+
+    public CiscoAsa1000vDevice addCiscoAsa1000vResource(AddCiscoAsa1000vResourceCmd cmd);
+
+    public CiscoAsa1000vResourceResponse createCiscoAsa1000vResourceResponse(
+            CiscoAsa1000vDevice ciscoAsa1000vDeviceVO);
+
+    boolean deleteCiscoAsa1000vResource(DeleteCiscoAsa1000vResourceCmd cmd);
+
+    List<CiscoAsa1000vDeviceVO> listCiscoAsa1000vResources(ListCiscoAsa1000vResourcesCmd cmd);
+
+    CiscoAsa1000vDevice assignAsa1000vToNetwork(Network network);
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElement.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElement.java
new file mode 100644
index 0000000..443bb40
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElement.java
@@ -0,0 +1,928 @@
+// 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.element;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+
+import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice;
+import org.apache.log4j.Logger;
+
+import com.cloud.agent.AgentManager;
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.AssociateAsaWithLogicalEdgeFirewallCommand;
+import com.cloud.agent.api.CleanupLogicalEdgeFirewallCommand;
+import com.cloud.agent.api.ConfigureNexusVsmForAsaCommand;
+import com.cloud.agent.api.CreateLogicalEdgeFirewallCommand;
+import com.cloud.agent.api.StartupCommand;
+import com.cloud.agent.api.StartupExternalFirewallCommand;
+import com.cloud.agent.api.routing.NetworkElementCommand;
+import com.cloud.agent.api.routing.SetFirewallRulesCommand;
+import com.cloud.agent.api.routing.SetPortForwardingRulesCommand;
+import com.cloud.agent.api.routing.SetSourceNatCommand;
+import com.cloud.agent.api.routing.SetStaticNatRulesCommand;
+import com.cloud.agent.api.to.FirewallRuleTO;
+import com.cloud.agent.api.to.IpAddressTO;
+import com.cloud.agent.api.to.PortForwardingRuleTO;
+import com.cloud.agent.api.to.StaticNatRuleTO;
+import com.cloud.api.commands.AddCiscoAsa1000vResourceCmd;
+import com.cloud.api.commands.AddCiscoVnmcResourceCmd;
+import com.cloud.api.commands.DeleteCiscoAsa1000vResourceCmd;
+import com.cloud.api.commands.DeleteCiscoVnmcResourceCmd;
+import com.cloud.api.commands.ListCiscoAsa1000vResourcesCmd;
+import com.cloud.api.commands.ListCiscoVnmcResourcesCmd;
+import com.cloud.api.response.CiscoAsa1000vResourceResponse;
+import com.cloud.api.response.CiscoVnmcResourceResponse;
+import com.cloud.configuration.ConfigurationManager;
+import com.cloud.dc.ClusterVO;
+import com.cloud.dc.ClusterVSMMapVO;
+import com.cloud.dc.DataCenter;
+import com.cloud.dc.Vlan;
+import com.cloud.dc.DataCenter.NetworkType;
+import com.cloud.dc.VlanVO;
+import com.cloud.dc.dao.ClusterDao;
+import com.cloud.dc.dao.ClusterVSMMapDao;
+import com.cloud.dc.dao.VlanDao;
+import com.cloud.deploy.DeployDestination;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.host.DetailVO;
+import com.cloud.host.Host;
+import com.cloud.host.HostVO;
+import com.cloud.host.dao.HostDao;
+import com.cloud.host.dao.HostDetailsDao;
+import com.cloud.network.CiscoNexusVSMDeviceVO;
+import com.cloud.network.IpAddress;
+import com.cloud.network.Network;
+import com.cloud.network.NetworkManager;
+import com.cloud.network.NetworkModel;
+import com.cloud.network.PhysicalNetworkServiceProvider;
+import com.cloud.network.dao.PhysicalNetworkVO;
+import com.cloud.network.Network.Capability;
+import com.cloud.network.Network.Provider;
+import com.cloud.network.Network.Service;
+import com.cloud.network.Networks.BroadcastDomainType;
+import com.cloud.network.PublicIpAddress;
+import com.cloud.network.addr.PublicIp;
+import com.cloud.network.cisco.CiscoAsa1000vDevice;
+import com.cloud.network.cisco.CiscoAsa1000vDeviceVO;
+import com.cloud.network.cisco.CiscoVnmcController;
+import com.cloud.network.cisco.CiscoVnmcControllerVO;
+import com.cloud.network.cisco.NetworkAsa1000vMapVO;
+import com.cloud.network.dao.CiscoAsa1000vDao;
+import com.cloud.network.dao.CiscoNexusVSMDeviceDao;
+import com.cloud.network.dao.CiscoVnmcDao;
+import com.cloud.network.dao.NetworkAsa1000vMapDao;
+import com.cloud.network.dao.NetworkDao;
+import com.cloud.network.dao.PhysicalNetworkDao;
+import com.cloud.network.dao.PhysicalNetworkServiceProviderDao;
+import com.cloud.network.dao.PhysicalNetworkServiceProviderVO;
+import com.cloud.network.resource.CiscoVnmcResource;
+import com.cloud.network.rules.FirewallRule;
+import com.cloud.network.rules.PortForwardingRule;
+import com.cloud.network.rules.StaticNat;
+import com.cloud.offering.NetworkOffering;
+import com.cloud.resource.ResourceManager;
+import com.cloud.resource.ResourceState;
+import com.cloud.resource.ResourceStateAdapter;
+import com.cloud.resource.ServerResource;
+import com.cloud.resource.UnableDeleteHostException;
+import com.cloud.user.Account;
+import com.cloud.utils.component.AdapterBase;
+import com.cloud.utils.db.Transaction;
+import com.cloud.utils.exception.CloudRuntimeException;
+import com.cloud.utils.net.NetUtils;
+import com.cloud.vm.NicProfile;
+import com.cloud.vm.ReservationContext;
+import com.cloud.vm.VirtualMachine;
+import com.cloud.vm.VirtualMachine.Type;
+import com.cloud.vm.VirtualMachineProfile;
+
+@Local(value = NetworkElement.class)
+public class CiscoVnmcElement extends AdapterBase implements SourceNatServiceProvider, FirewallServiceProvider,
+    PortForwardingServiceProvider, IpDeployer, StaticNatServiceProvider, ResourceStateAdapter, NetworkElement,
+    CiscoVnmcElementService, CiscoAsa1000vService {
+    private static final Logger s_logger = Logger.getLogger(CiscoVnmcElement.class);
+    private static final Map<Service, Map<Capability, String>> capabilities = setCapabilities();
+
+    @Inject
+    AgentManager _agentMgr;
+    @Inject
+    ResourceManager _resourceMgr;
+    @Inject
+    ConfigurationManager _configMgr;
+    @Inject
+    NetworkManager _networkMgr;
+    @Inject
+    NetworkModel _networkModel;
+
+    @Inject
+    PhysicalNetworkDao _physicalNetworkDao;
+    @Inject
+    PhysicalNetworkServiceProviderDao _physicalNetworkServiceProviderDao;
+    @Inject 
+    HostDetailsDao _hostDetailsDao;
+    @Inject
+    HostDao _hostDao;
+    @Inject
+    NetworkDao _networkDao;
+    @Inject
+    ClusterDao _clusterDao;
+    @Inject
+    VlanDao _vlanDao;
+    @Inject
+    ClusterVSMMapDao _clusterVsmMapDao;
+    @Inject
+    CiscoNexusVSMDeviceDao _vsmDeviceDao;
+    @Inject
+    CiscoVnmcDao _ciscoVnmcDao;
+    @Inject
+    CiscoAsa1000vDao _ciscoAsa1000vDao;
+    @Inject
+    NetworkAsa1000vMapDao _networkAsa1000vMapDao;
+
+    protected boolean canHandle(Network network) {
+        if (network.getBroadcastDomainType() != BroadcastDomainType.Vlan) {
+            return false; //TODO: should handle VxLAN as well
+        }
+
+        return true;
+    }
+
+    @Override
+    public boolean configure(String name, Map<String, Object> params)
+            throws ConfigurationException {
+        super.configure(name, params);
+        _resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this);
+        return true;
+    }
+
+    private static Map<Service, Map<Capability, String>> setCapabilities() {
+        Map<Service, Map<Capability, String>> capabilities = new HashMap<Service, Map<Capability, String>>();
+        capabilities.put(Service.Gateway, null);
+
+        Map<Capability, String> firewallCapabilities = new HashMap<Capability, String>();
+        firewallCapabilities.put(Capability.TrafficStatistics, "per public ip");
+        firewallCapabilities.put(Capability.SupportedTrafficDirection, "ingress,egress");
+        firewallCapabilities.put(Capability.SupportedProtocols, "tcp,udp,icmp");
+        firewallCapabilities.put(Capability.SupportedEgressProtocols, "tcp,udp,icmp");
+        firewallCapabilities.put(Capability.MultipleIps, "true");
+        capabilities.put(Service.Firewall, firewallCapabilities);
+
+        capabilities.put(Service.StaticNat, null);
+        capabilities.put(Service.PortForwarding, null);
+
+        Map<Capability, String> sourceNatCapabilities = new HashMap<Capability, String>();
+        sourceNatCapabilities.put(Capability.SupportedSourceNatTypes, "peraccount");
+        sourceNatCapabilities.put(Capability.RedundantRouter, "false"); //TODO:
+        capabilities.put(Service.SourceNat, sourceNatCapabilities);
+        return capabilities;
+    }
+
+    @Override
+    public Map<Service, Map<Capability, String>> getCapabilities() {
+        return capabilities;
+    }
+
+    @Override
+    public Provider getProvider() {
+        return Provider.CiscoVnmc;
+    }
+
+    private boolean createLogicalEdgeFirewall(long vlanId,
+            String gateway, String gatewayNetmask,
+            String publicIp, String publicNetmask,
+            List<String> publicGateways, long hostId) {
+        CreateLogicalEdgeFirewallCommand cmd = new CreateLogicalEdgeFirewallCommand(vlanId, publicIp, gateway, publicNetmask, gatewayNetmask);
+        for (String publicGateway : publicGateways) {
+            cmd.getPublicGateways().add(publicGateway);
+        }
+        Answer answer = _agentMgr.easySend(hostId, cmd);
+        return answer.getResult();
+    }
+
+    private boolean configureNexusVsmForAsa(long vlanId, String gateway,
+            String vsmUsername, String vsmPassword, String vsmIp,
+            String asaInPortProfile, long hostId) {
+        ConfigureNexusVsmForAsaCommand cmd = new ConfigureNexusVsmForAsaCommand(vlanId, gateway, vsmUsername, vsmPassword, vsmIp, asaInPortProfile);
+        Answer answer = _agentMgr.easySend(hostId, cmd);
+        return answer.getResult();
+    }
+
+    private boolean configureSourceNat(long vlanId, String guestCidr,
+            PublicIp sourceNatIp, long hostId) {
+        boolean add = (sourceNatIp.getState() == IpAddress.State.Releasing ? false : true);
+        IpAddressTO ip = new IpAddressTO(sourceNatIp.getAccountId(), sourceNatIp.getAddress().addr(), add, false,
+                sourceNatIp.isSourceNat(), sourceNatIp.getVlanTag(), sourceNatIp.getGateway(), sourceNatIp.getNetmask(), sourceNatIp.getMacAddress(),
+                null, sourceNatIp.isOneToOneNat());
+        boolean addSourceNat = false;
+        if (sourceNatIp.isSourceNat()) {
+            addSourceNat = add;
+        }
+
+        SetSourceNatCommand cmd = new SetSourceNatCommand(ip, addSourceNat);
+        cmd.setContextParam(NetworkElementCommand.GUEST_VLAN_TAG, Long.toString(vlanId));
+        cmd.setContextParam(NetworkElementCommand.GUEST_NETWORK_CIDR, guestCidr);
+        Answer answer = _agentMgr.easySend(hostId, cmd);
+        return answer.getResult();
+    }
+
+    private boolean associateAsaWithLogicalEdgeFirewall(long vlanId,
+            String asaMgmtIp, long hostId) {
+        AssociateAsaWithLogicalEdgeFirewallCommand cmd = 
+                new AssociateAsaWithLogicalEdgeFirewallCommand(vlanId, asaMgmtIp);
+        Answer answer = _agentMgr.easySend(hostId, cmd);
+        return answer.getResult();
+    }
+
+    @Override
+    public boolean implement(Network network, NetworkOffering offering,
+            DeployDestination dest, ReservationContext context)
+            throws ConcurrentOperationException, ResourceUnavailableException,
+            InsufficientCapacityException {
+        DataCenter zone = _configMgr.getZone(network.getDataCenterId());
+
+        if (zone.getNetworkType() == NetworkType.Basic) {
+            s_logger.debug("Not handling network implement in zone of type " + NetworkType.Basic);
+            return false;
+        }
+
+        if (!canHandle(network)) {
+            return false;
+        }
+
+        List<CiscoVnmcControllerVO> devices = _ciscoVnmcDao.listByPhysicalNetwork(network.getPhysicalNetworkId());
+        if (devices.isEmpty()) {
+            s_logger.error("No Cisco Vnmc device on network " + network.getName());
+            return false;
+        }
+
+        List<CiscoAsa1000vDeviceVO> asaList = _ciscoAsa1000vDao.listByPhysicalNetwork(network.getPhysicalNetworkId());
+        if (asaList.isEmpty()) {
+            s_logger.debug("No Cisco ASA 1000v device on network " + network.getName());
+            return false;
+        }
+
+        NetworkAsa1000vMapVO asaForNetwork = _networkAsa1000vMapDao.findByNetworkId(network.getId());
+        if (asaForNetwork != null) {
+            s_logger.debug("Cisco ASA 1000v device already associated with network " + network.getName());
+            return true;
+        }
+
+        if (!_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.SourceNat, Provider.CiscoVnmc)) {
+            s_logger.error("SourceNat service is not provided by Cisco Vnmc device on network " + network.getName());
+            return false;
+        }
+
+        Transaction txn = Transaction.currentTxn();
+        boolean status = false;
+        try {
+            txn.start();
+
+            // ensure that there is an ASA 1000v assigned to this network
+            CiscoAsa1000vDevice assignedAsa = assignAsa1000vToNetwork(network);
+            if (assignedAsa == null) {
+                s_logger.error("Unable to assign ASA 1000v device to network " + network.getName());
+                return false;
+            }
+
+            ClusterVO asaCluster = _clusterDao.findById(assignedAsa.getClusterId());
+            ClusterVSMMapVO clusterVsmMap = _clusterVsmMapDao.findByClusterId(assignedAsa.getClusterId());
+            if (clusterVsmMap == null) {
+                s_logger.error("Vmware cluster " + asaCluster.getName() + " has no Cisco Nexus VSM device associated with it");
+                return false;
+            }
+
+            CiscoNexusVSMDeviceVO vsmDevice = _vsmDeviceDao.findById(clusterVsmMap.getVsmId());
+            if (vsmDevice == null) {
+                s_logger.error("Unable to load details of Cisco Nexus VSM device associated with cluster " + asaCluster.getName());
+                return false;
+            }
+
+            CiscoVnmcControllerVO ciscoVnmcDevice = devices.get(0);
+            HostVO ciscoVnmcHost = _hostDao.findById(ciscoVnmcDevice.getHostId());
+            _hostDao.loadDetails(ciscoVnmcHost);
+            Account owner = context.getAccount();
+            PublicIp sourceNatIp = _networkMgr.assignSourceNatIpAddressToGuestNetwork(owner, network);
+            String vlan = network.getBroadcastUri().getHost();
+            long vlanId = Long.parseLong(vlan);
+
+            List<VlanVO> vlanVOList = _vlanDao.listVlansByPhysicalNetworkId(network.getPhysicalNetworkId());
+            List<String> publicGateways = new ArrayList<String>();
+            for (VlanVO vlanVO : vlanVOList) {
+                publicGateways.add(vlanVO.getVlanGateway());
+            }
+
+            // create logical edge firewall in VNMC
+            String gatewayNetmask = NetUtils.getCidrNetmask(network.getCidr());
+            if (!createLogicalEdgeFirewall(vlanId, network.getGateway(), gatewayNetmask,
+                    sourceNatIp.getAddress().addr(), sourceNatIp.getNetmask(), publicGateways, ciscoVnmcHost.getId())) {
+                s_logger.error("Failed to create logical edge firewall in Cisco VNMC device for network " + network.getName());
+                return false;
+            }
+
+            // create stuff in VSM for ASA device
+            if (!configureNexusVsmForAsa(vlanId, network.getGateway(),
+                    vsmDevice.getUserName(), vsmDevice.getPassword(), vsmDevice.getipaddr(),
+                    assignedAsa.getInPortProfile(), ciscoVnmcHost.getId())) {
+                s_logger.error("Failed to configure Cisco Nexus VSM " + vsmDevice.getipaddr() +
+                        " for ASA device for network " + network.getName());
+                return false;
+            }
+
+            // configure source NAT
+            //if (!configureSourceNat(vlanId, network.getCidr(), sourceNatIp, ciscoVnmcHost.getId())) {
+            //    s_logger.error("Failed to configure source NAT in Cisco VNMC device for network " + network.getName());
+            //    return false;
+            //}
+
+            // associate Asa 1000v instance with logical edge firewall
+            if (!associateAsaWithLogicalEdgeFirewall(vlanId, assignedAsa.getManagementIp(), ciscoVnmcHost.getId())) {
+                s_logger.error("Failed to associate Cisco ASA 1000v (" + assignedAsa.getManagementIp() +
+                        ") with logical edge firewall in VNMC for network " + network.getName());
+                return false;
+            }
+
+            status = true;
+            txn.commit();
+        } finally {
+            if (!status) {
+                txn.rollback();
+                //FIXME: also undo changes in VNMC, VSM if anything failed
+            }
+        }
+
+        return true;
+    }
+
+    @Override
+    public boolean prepare(Network network, NicProfile nic,
+            VirtualMachineProfile<? extends VirtualMachine> vm,
+            DeployDestination dest, ReservationContext context)
+            throws ConcurrentOperationException, ResourceUnavailableException,
+            InsufficientCapacityException {
+        if (vm.getType() != Type.User) {
+            return false;
+        }
+
+        // ensure that there is an ASA 1000v assigned to this network
+        NetworkAsa1000vMapVO asaForNetwork = _networkAsa1000vMapDao.findByNetworkId(network.getId());
+        if (asaForNetwork == null) {
+            return false;
+        }
+
+        return true;
+    }
+
+    @Override
+    public boolean release(Network network, NicProfile nic,
+            VirtualMachineProfile<? extends VirtualMachine> vm,
+            ReservationContext context) throws ConcurrentOperationException,
+            ResourceUnavailableException {
+        return true;
+    }
+
+    private boolean cleanupLogicalEdgeFirewall(long vlanId, long hostId) {
+        CleanupLogicalEdgeFirewallCommand cmd = new CleanupLogicalEdgeFirewallCommand(vlanId);
+        Answer answer = _agentMgr.easySend(hostId, cmd);
+        return answer.getResult();
+    }
+
+    @Override
+    public boolean shutdown(Network network, ReservationContext context,
+            boolean cleanup) throws ConcurrentOperationException,
+            ResourceUnavailableException {
+
+        unassignAsa1000vFromNetwork(network);
+
+        String vlan = network.getBroadcastUri().getHost();
+        long vlanId = Long.parseLong(vlan);
+        List<CiscoVnmcControllerVO> devices = _ciscoVnmcDao.listByPhysicalNetwork(network.getPhysicalNetworkId());
+        if (!devices.isEmpty()) {
+            CiscoVnmcControllerVO ciscoVnmcDevice = devices.get(0);
+            HostVO ciscoVnmcHost = _hostDao.findById(ciscoVnmcDevice.getHostId());
+            cleanupLogicalEdgeFirewall(vlanId, ciscoVnmcHost.getId());
+        }
+
+        return true;
+    }
+
+    @Override
+    public boolean isReady(PhysicalNetworkServiceProvider provider) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public boolean shutdownProviderInstances(
+            PhysicalNetworkServiceProvider provider, ReservationContext context)
+            throws ConcurrentOperationException, ResourceUnavailableException {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public boolean canEnableIndividualServices() {
+        return true;
+    }
+
+    @Override
+    public boolean verifyServicesCombination(Set<Service> services) {
+        if (!services.contains(Service.Firewall)) {
+            s_logger.warn("CiscoVnmc must be used as Firewall Service Provider in the network");
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public boolean destroy(Network network, ReservationContext context)
+            throws ConcurrentOperationException, ResourceUnavailableException {
+        return true;
+    }
+
+    @Override
+    public List<Class<?>> getCommands() {
+        List<Class<?>> cmdList = new ArrayList<Class<?>>();
+        cmdList.add(AddCiscoVnmcResourceCmd.class);
+        cmdList.add(DeleteCiscoVnmcResourceCmd.class);
+        cmdList.add(ListCiscoVnmcResourcesCmd.class);
+        cmdList.add(AddCiscoAsa1000vResourceCmd.class);
+        cmdList.add(DeleteCiscoAsa1000vResourceCmd.class);
+        cmdList.add(ListCiscoAsa1000vResourcesCmd.class);
+        return cmdList;
+    }
+
+    @Override
+    public CiscoVnmcController addCiscoVnmcResource(AddCiscoVnmcResourceCmd cmd) {
+        String deviceName = Provider.CiscoVnmc.getName();
+        NetworkDevice networkDevice = NetworkDevice.getNetworkDevice(deviceName);
+        Long physicalNetworkId = cmd.getPhysicalNetworkId();
+        CiscoVnmcController ciscoVnmcResource = null;
+
+        PhysicalNetworkVO physicalNetwork = _physicalNetworkDao.findById(physicalNetworkId);
+        if (physicalNetwork == null) {
+            throw new InvalidParameterValueException("Could not find phyical network with ID: " + physicalNetworkId);
+        }
+        long zoneId = physicalNetwork.getDataCenterId();
+
+        PhysicalNetworkServiceProviderVO ntwkSvcProvider = _physicalNetworkServiceProviderDao.findByServiceProvider(physicalNetwork.getId(), networkDevice.getNetworkServiceProvder());
+        if (ntwkSvcProvider == null) {
+            throw new CloudRuntimeException("Network Service Provider: " + networkDevice.getNetworkServiceProvder() +
+                    " is not enabled in the physical network: " + physicalNetworkId + "to add this device");
+        } else if (ntwkSvcProvider.getState() == PhysicalNetworkServiceProvider.State.Shutdown) {
+            throw new CloudRuntimeException("Network Service Provider: " + ntwkSvcProvider.getProviderName() +
+                    " is in shutdown state in the physical network: " + physicalNetworkId + "to add this device");
+        }
+
+        if (_ciscoVnmcDao.listByPhysicalNetwork(physicalNetworkId).size() != 0) {
+            throw new CloudRuntimeException("A Cisco Vnmc device is already configured on this physical network");
+        }
+
+        Map<String, String> params = new HashMap<String,String>();
+        params.put("guid", UUID.randomUUID().toString());
+        params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId()));
+        params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId()));
+        params.put("name", "Cisco VNMC Controller - " + cmd.getHost());
+        params.put("ip", cmd.getHost());
+        params.put("username", cmd.getUsername());
+        params.put("password", cmd.getPassword());
+        params.put("transportzoneisotype", physicalNetwork.getIsolationMethods().get(0).toLowerCase()); // FIXME What to do with multiple isolation types
+
+        Map<String, Object> hostdetails = new HashMap<String,Object>();
+        hostdetails.putAll(params);
+
+        ServerResource resource = new CiscoVnmcResource();
+        Transaction txn = Transaction.currentTxn();
+        try {
+            resource.configure(cmd.getHost(), hostdetails);
+
+            Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.ExternalFirewall, params);
+            if (host != null) {
+                txn.start();
+
+                ciscoVnmcResource = new CiscoVnmcControllerVO(host.getId(), physicalNetworkId, ntwkSvcProvider.getProviderName(), deviceName);
+                _ciscoVnmcDao.persist((CiscoVnmcControllerVO)ciscoVnmcResource);
+                
+                DetailVO detail = new DetailVO(host.getId(), "deviceid", String.valueOf(ciscoVnmcResource.getId()));
+                _hostDetailsDao.persist(detail);
+
+                txn.commit();
+                return ciscoVnmcResource;
+            } else {
+                throw new CloudRuntimeException("Failed to add Cisco Vnmc device due to internal error.");
+            }
+        } catch (ConfigurationException e) {
+            txn.rollback();
+            throw new CloudRuntimeException(e.getMessage());
+        }
+    }
+
+    @Override
+    public CiscoVnmcResourceResponse createCiscoVnmcResourceResponse(
+            CiscoVnmcController ciscoVnmcResourceVO) {
+        HostVO ciscoVnmcHost = _hostDao.findById(ciscoVnmcResourceVO.getHostId());
+
+        CiscoVnmcResourceResponse response = new CiscoVnmcResourceResponse();
+        response.setId(ciscoVnmcResourceVO.getUuid());
+        response.setPhysicalNetworkId(ciscoVnmcResourceVO.getPhysicalNetworkId());
+        response.setProviderName(ciscoVnmcResourceVO.getProviderName());
+        response.setResourceName(ciscoVnmcHost.getName());
+
+        return response;
+    }
+
+    @Override
+    public boolean deleteCiscoVnmcResource(DeleteCiscoVnmcResourceCmd cmd) {
+        Long vnmcResourceId = cmd.getCiscoVnmcResourceId();
+        CiscoVnmcControllerVO vnmcResource = _ciscoVnmcDao.findById(vnmcResourceId);
+        if (vnmcResource == null) {
+            throw new InvalidParameterValueException(
+                    "Could not find a Cisco VNMC appliance with id " + vnmcResourceId);
+        }
+
+        // Check if there any ASA 1000v appliances
+        Long physicalNetworkId = vnmcResource.getPhysicalNetworkId();
+        PhysicalNetworkVO physicalNetwork = _physicalNetworkDao.findById(physicalNetworkId);
+        if (physicalNetwork != null) {
+            List<CiscoAsa1000vDeviceVO> responseList = _ciscoAsa1000vDao.listByPhysicalNetwork(physicalNetworkId);
+            if (responseList.size() > 0) {
+                throw new CloudRuntimeException(
+                        "Cisco VNMC appliance with id " + vnmcResourceId +
+                        " cannot be deleted as there Cisco ASA 1000v appliances using it");
+            }
+        }
+
+        HostVO vnmcHost = _hostDao.findById(vnmcResource.getHostId());
+        Long hostId = vnmcHost.getId();
+        vnmcHost.setResourceState(ResourceState.Maintenance);
+        _hostDao.update(hostId, vnmcHost);
+        _resourceMgr.deleteHost(hostId, false, false);
+        _ciscoVnmcDao.remove(vnmcResourceId);
+
+        return true;
+    }
+
+    @Override
+    public List<CiscoVnmcControllerVO> listCiscoVnmcResources(
+            ListCiscoVnmcResourcesCmd cmd) {
+        Long physicalNetworkId = cmd.getPhysicalNetworkId();
+        Long ciscoVnmcResourceId = cmd.getCiscoVnmcResourceId();
+        List<CiscoVnmcControllerVO> responseList = new ArrayList<CiscoVnmcControllerVO>();
+
+        if (physicalNetworkId == null && ciscoVnmcResourceId == null) {
+            throw new InvalidParameterValueException("Either physical network Id or vnmc device Id must be specified");
+        }
+
+        if (ciscoVnmcResourceId != null) {
+            CiscoVnmcControllerVO ciscoVnmcResource = _ciscoVnmcDao.findById(ciscoVnmcResourceId);
+            if (ciscoVnmcResource == null) {
+                throw new InvalidParameterValueException("Could not find Cisco Vnmc device with id: " + ciscoVnmcResource);
+            }
+            responseList.add(ciscoVnmcResource);
+        }
+        else {
+            PhysicalNetworkVO physicalNetwork = _physicalNetworkDao.findById(physicalNetworkId);
+            if (physicalNetwork == null) {
+                throw new InvalidParameterValueException("Could not find a physical network with id: " + physicalNetworkId);
+            }
+            responseList = _ciscoVnmcDao.listByPhysicalNetwork(physicalNetworkId);
+        }
+
+        return responseList;
+    }
+
+    @Override
+    public IpDeployer getIpDeployer(Network network) {
+        return this;
+    }
+
+    @Override
+    public boolean applyFWRules(Network network,
+            List<? extends FirewallRule> rules)
+            throws ResourceUnavailableException {
+
+        if (!_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.Firewall, Provider.CiscoVnmc)) {
+            s_logger.error("Firewall service is not provided by Cisco Vnmc device on network " + network.getName());
+            return false;
+        }
+
+        // Find VNMC host for physical network
+        List<CiscoVnmcControllerVO> devices = _ciscoVnmcDao.listByPhysicalNetwork(network.getPhysicalNetworkId());
+        if (devices.isEmpty()) {
+            s_logger.error("No Cisco Vnmc device on network " + network.getName());
+            return true;
+        }
+
+        // Find if ASA 1000v is associated with network
+        NetworkAsa1000vMapVO asaForNetwork = _networkAsa1000vMapDao.findByNetworkId(network.getId());
+        if (asaForNetwork == null) {
+            s_logger.debug("Cisco ASA 1000v device is not associated with network " + network.getName());
+            return true;
+        }
+
+        if (network.getState() == Network.State.Allocated) {
+            s_logger.debug("External firewall was asked to apply firewall rules for network with ID " + network.getId() + "; this network is not implemented. Skipping backend commands.");
+            return true;
+        }
+
+        CiscoVnmcControllerVO ciscoVnmcDevice = devices.get(0);
+        HostVO ciscoVnmcHost = _hostDao.findById(ciscoVnmcDevice.getHostId());
+
+        List<FirewallRuleTO> rulesTO = new ArrayList<FirewallRuleTO>();
+        for (FirewallRule rule : rules) {
+            IpAddress sourceIp = _networkModel.getIp(rule.getSourceIpAddressId());
+            FirewallRuleTO ruleTO = new FirewallRuleTO(rule, null, sourceIp.getAddress().addr(), rule.getPurpose(), rule.getTrafficType());
+            rulesTO.add(ruleTO);
+        }
+
+        if (!rulesTO.isEmpty()) {
+            SetFirewallRulesCommand cmd = new SetFirewallRulesCommand(rulesTO);
+            cmd.setContextParam(NetworkElementCommand.GUEST_VLAN_TAG, network.getBroadcastUri().getHost());
+            cmd.setContextParam(NetworkElementCommand.GUEST_NETWORK_CIDR, network.getCidr());
+            Answer answer = _agentMgr.easySend(ciscoVnmcHost.getId(), cmd);
+            if (answer == null || !answer.getResult()) {
+                String details = (answer != null) ? answer.getDetails() : "details unavailable";
+                String msg = "Unable to apply firewall rules to Cisco ASA 1000v appliance due to: " + details + ".";
+                s_logger.error(msg);
+                throw new ResourceUnavailableException(msg, DataCenter.class, network.getDataCenterId());
+            }
+        }
+
+        return true;
+    }
+
+    @Override
+    public boolean applyPFRules(Network network, List<PortForwardingRule> rules)
+            throws ResourceUnavailableException {
+
+        if (!_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.PortForwarding, Provider.CiscoVnmc)) {
+            s_logger.error("Port forwarding service is not provided by Cisco Vnmc device on network " + network.getName());
+            return false;
+        }
+
+        // Find VNMC host for physical network
+        List<CiscoVnmcControllerVO> devices = _ciscoVnmcDao.listByPhysicalNetwork(network.getPhysicalNetworkId());
+        if (devices.isEmpty()) {
+            s_logger.error("No Cisco Vnmc device on network " + network.getName());
+            return true;
+        }
+
+        // Find if ASA 1000v is associated with network
+        NetworkAsa1000vMapVO asaForNetwork = _networkAsa1000vMapDao.findByNetworkId(network.getId());
+        if (asaForNetwork == null) {
+            s_logger.debug("Cisco ASA 1000v device is not associated with network " + network.getName());
+            return true;
+        }
+
+        if (network.getState() == Network.State.Allocated) {
+            s_logger.debug("External firewall was asked to apply port forwarding rules for network with ID " + network.getId() + "; this network is not implemented. Skipping backend commands.");
+            return true;
+        }
+
+        CiscoVnmcControllerVO ciscoVnmcDevice = devices.get(0);
+        HostVO ciscoVnmcHost = _hostDao.findById(ciscoVnmcDevice.getHostId());
+
+        List<PortForwardingRuleTO> rulesTO = new ArrayList<PortForwardingRuleTO>();
+        for (PortForwardingRule rule : rules) {
+            IpAddress sourceIp = _networkModel.getIp(rule.getSourceIpAddressId());
+            Vlan vlan = _vlanDao.findById(sourceIp.getVlanId());
+            PortForwardingRuleTO ruleTO = new PortForwardingRuleTO(rule, vlan.getVlanTag(), sourceIp.getAddress().addr());
+            rulesTO.add(ruleTO);
+        }
+
+        if (!rulesTO.isEmpty()) {
+            SetPortForwardingRulesCommand cmd = new SetPortForwardingRulesCommand(rulesTO);
+            cmd.setContextParam(NetworkElementCommand.GUEST_VLAN_TAG, network.getBroadcastUri().getHost());
+            cmd.setContextParam(NetworkElementCommand.GUEST_NETWORK_CIDR, network.getCidr());
+            Answer answer = _agentMgr.easySend(ciscoVnmcHost.getId(), cmd);
+            if (answer == null || !answer.getResult()) {
+                String details = (answer != null) ? answer.getDetails() : "details unavailable";
+                String msg = "Unable to apply port forwarding rules to Cisco ASA 1000v appliance due to: " + details + ".";
+                s_logger.error(msg);
+                throw new ResourceUnavailableException(msg, DataCenter.class, network.getDataCenterId());
+            }
+        }
+
+        return true;
+    }
+
+    @Override
+    public boolean applyStaticNats(Network network,
+            List<? extends StaticNat> rules)
+            throws ResourceUnavailableException {
+        if (!_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.StaticNat, Provider.CiscoVnmc)) {
+            s_logger.error("Static NAT service is not provided by Cisco Vnmc device on network " + network.getName());
+            return false;
+        }
+
+        // Find VNMC host for physical network
+        List<CiscoVnmcControllerVO> devices = _ciscoVnmcDao.listByPhysicalNetwork(network.getPhysicalNetworkId());
+        if (devices.isEmpty()) {
+            s_logger.error("No Cisco Vnmc device on network " + network.getName());
+            return true;
+        }
+
+        // Find if ASA 1000v is associated with network
+        NetworkAsa1000vMapVO asaForNetwork = _networkAsa1000vMapDao.findByNetworkId(network.getId());
+        if (asaForNetwork == null) {
+            s_logger.debug("Cisco ASA 1000v device is not associated with network " + network.getName());
+            return true;
+        }
+
+        if (network.getState() == Network.State.Allocated) {
+            s_logger.debug("External firewall was asked to apply static NAT rules for network with ID " + network.getId() + "; this network is not implemented. Skipping backend commands.");
+            return true;
+        }
+
+        CiscoVnmcControllerVO ciscoVnmcDevice = devices.get(0);
+        HostVO ciscoVnmcHost = _hostDao.findById(ciscoVnmcDevice.getHostId());
+
+        List<StaticNatRuleTO> rulesTO = new ArrayList<StaticNatRuleTO>();
+        for (StaticNat rule : rules) {
+            IpAddress sourceIp = _networkModel.getIp(rule.getSourceIpAddressId());
+            StaticNatRuleTO ruleTO = new StaticNatRuleTO(0, sourceIp.getAddress().addr(), null, 
+                    null, rule.getDestIpAddress(), null, null, null, rule.isForRevoke(), false);
+            rulesTO.add(ruleTO);
+        }
+
+        if (!rulesTO.isEmpty()) {
+            SetStaticNatRulesCommand cmd = new SetStaticNatRulesCommand(rulesTO, null);
+            cmd.setContextParam(NetworkElementCommand.GUEST_VLAN_TAG, network.getBroadcastUri().getHost());
+            cmd.setContextParam(NetworkElementCommand.GUEST_NETWORK_CIDR, network.getCidr());
+            Answer answer = _agentMgr.easySend(ciscoVnmcHost.getId(), cmd);
+            if (answer == null || !answer.getResult()) {
+                String details = (answer != null) ? answer.getDetails() : "details unavailable";
+                String msg = "Unable to apply static NAT rules to Cisco ASA 1000v appliance due to: " + details + ".";
+                s_logger.error(msg);
+                throw new ResourceUnavailableException(msg, DataCenter.class, network.getDataCenterId());
+            }
+        }
+
+        return true;
+    }
+
+    @Override
+    public boolean applyIps(Network network,
+            List<? extends PublicIpAddress> ipAddress, Set<Service> services)
+            throws ResourceUnavailableException {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public HostVO createHostVOForConnectedAgent(HostVO host,
+            StartupCommand[] cmd) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public HostVO createHostVOForDirectConnectAgent(HostVO host,
+            StartupCommand[] startup, ServerResource resource,
+            Map<String, String> details, List<String> hostTags) {
+        if (!(startup[0] instanceof StartupExternalFirewallCommand)) {
+            return null;
+        }
+        host.setType(Host.Type.ExternalFirewall);
+        return host;
+    }
+
+    @Override
+    public DeleteHostAnswer deleteHost(HostVO host, boolean isForced,
+            boolean isForceDeleteStorage) throws UnableDeleteHostException {
+        if (host.getType() != com.cloud.host.Host.Type.ExternalFirewall) {
+            return null;
+        }
+        return new DeleteHostAnswer(true);
+    }
+
+    @Override
+    public CiscoAsa1000vDevice addCiscoAsa1000vResource(
+            AddCiscoAsa1000vResourceCmd cmd) {
+        Long physicalNetworkId = cmd.getPhysicalNetworkId();
+        CiscoAsa1000vDevice ciscoAsa1000vResource = null;
+
+        PhysicalNetworkVO physicalNetwork = _physicalNetworkDao.findById(physicalNetworkId);
+        if (physicalNetwork == null) {
+            throw new InvalidParameterValueException("Could not find phyical network with ID: " + physicalNetworkId);
+        }
+
+        ciscoAsa1000vResource = new CiscoAsa1000vDeviceVO(physicalNetworkId, cmd.getManagementIp(), cmd.getInPortProfile(), cmd.getClusterId());
+        _ciscoAsa1000vDao.persist((CiscoAsa1000vDeviceVO)ciscoAsa1000vResource);
+
+        return ciscoAsa1000vResource;
+    }
+
+    @Override
+    public CiscoAsa1000vResourceResponse createCiscoAsa1000vResourceResponse(
+            CiscoAsa1000vDevice ciscoAsa1000vDeviceVO) {
+        CiscoAsa1000vResourceResponse response = new CiscoAsa1000vResourceResponse();
+        response.setId(ciscoAsa1000vDeviceVO.getUuid());
+        response.setManagementIp(ciscoAsa1000vDeviceVO.getManagementIp());
+        response.setInPortProfile(ciscoAsa1000vDeviceVO.getInPortProfile());
+
+        NetworkAsa1000vMapVO networkAsaMap = _networkAsa1000vMapDao.findByAsa1000vId(ciscoAsa1000vDeviceVO.getId());
+        if (networkAsaMap != null) {
+            response.setGuestNetworkId(networkAsaMap.getNetworkId());
+        }
+
+        return response;
+    }
+
+    @Override
+    public boolean deleteCiscoAsa1000vResource(
+            DeleteCiscoAsa1000vResourceCmd cmd) {
+        Long asaResourceId = cmd.getCiscoAsa1000vResourceId();
+        CiscoAsa1000vDeviceVO asaResource = _ciscoAsa1000vDao.findById(asaResourceId);
+        if (asaResource == null) {
+            throw new InvalidParameterValueException(
+                    "Could not find a Cisco ASA 1000v appliance with id " + asaResourceId);
+        }
+
+        NetworkAsa1000vMapVO networkAsaMap = _networkAsa1000vMapDao.findByAsa1000vId(asaResource.getId());
+        if (networkAsaMap != null) {
+            throw new CloudRuntimeException(
+                    "Cisco ASA 1000v appliance with id " + asaResourceId +
+                    " cannot be deleted as it is associated with guest network");
+        }
+
+        _ciscoAsa1000vDao.remove(asaResourceId);
+
+        return true;
+    }
+
+    @Override
+    public List<CiscoAsa1000vDeviceVO> listCiscoAsa1000vResources(
+            ListCiscoAsa1000vResourcesCmd cmd) {
+        Long physicalNetworkId = cmd.getPhysicalNetworkId();
+        Long ciscoAsa1000vResourceId = cmd.getCiscoAsa1000vResourceId();
+        List<CiscoAsa1000vDeviceVO> responseList = new ArrayList<CiscoAsa1000vDeviceVO>();
+
+        if (physicalNetworkId == null && ciscoAsa1000vResourceId == null) {
+            throw new InvalidParameterValueException("Either physical network Id or Asa 1000v device Id must be specified");
+        }
+
+        if (ciscoAsa1000vResourceId != null) {
+            CiscoAsa1000vDeviceVO ciscoAsa1000vResource = _ciscoAsa1000vDao.findById(ciscoAsa1000vResourceId);
+            if (ciscoAsa1000vResource == null) {
+                throw new InvalidParameterValueException("Could not find Cisco Asa 1000v device with id: " + ciscoAsa1000vResourceId);
+            }
+            responseList.add(ciscoAsa1000vResource);
+        } else {
+            PhysicalNetworkVO physicalNetwork = _physicalNetworkDao.findById(physicalNetworkId);
+            if (physicalNetwork == null) {
+                throw new InvalidParameterValueException("Could not find a physical network with id: " + physicalNetworkId);
+            }
+            responseList = _ciscoAsa1000vDao.listByPhysicalNetwork(physicalNetworkId);
+        }
+
+        return responseList;
+    }
+
+    @Override
+    public CiscoAsa1000vDevice assignAsa1000vToNetwork(Network network) {
+        List<CiscoAsa1000vDeviceVO> asaList = _ciscoAsa1000vDao.listByPhysicalNetwork(network.getPhysicalNetworkId());
+        for (CiscoAsa1000vDeviceVO asa : asaList) {
+            NetworkAsa1000vMapVO assignedToNetwork = _networkAsa1000vMapDao.findByAsa1000vId(asa.getId());
+            if (assignedToNetwork == null) {
+                NetworkAsa1000vMapVO networkAsaMap = new NetworkAsa1000vMapVO(network.getId(), asa.getId());
+                _networkAsa1000vMapDao.persist(networkAsaMap);
+                return asa;
+            }
+        }
+        return null;
+    }
+
+    private void unassignAsa1000vFromNetwork(Network network) {
+        NetworkAsa1000vMapVO networkAsaMap = _networkAsa1000vMapDao.findByNetworkId(network.getId());
+        if (networkAsaMap != null) {
+            _networkAsa1000vMapDao.remove(networkAsaMap.getId());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElementService.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElementService.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElementService.java
new file mode 100644
index 0000000..e8eb473
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElementService.java
@@ -0,0 +1,42 @@
+// 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.element;
+
+import java.util.List;
+
+import com.cloud.api.commands.AddCiscoVnmcResourceCmd;
+import com.cloud.api.commands.DeleteCiscoVnmcResourceCmd;
+import com.cloud.api.commands.ListCiscoVnmcResourcesCmd;
+import com.cloud.api.response.CiscoVnmcResourceResponse;
+import com.cloud.network.cisco.CiscoVnmcController;
+import com.cloud.network.cisco.CiscoVnmcControllerVO;
+import com.cloud.utils.component.PluggableService;
+
+public interface CiscoVnmcElementService extends PluggableService {
+
+    //public static final Provider CiscoVnmc = new Provider("CiscoVnmc", true);
+
+    public CiscoVnmcController addCiscoVnmcResource(AddCiscoVnmcResourceCmd cmd);
+
+    public CiscoVnmcResourceResponse createCiscoVnmcResourceResponse(
+            CiscoVnmcController CiscoVnmcResourceVO);
+
+    boolean deleteCiscoVnmcResource(DeleteCiscoVnmcResourceCmd cmd);
+
+    List<CiscoVnmcControllerVO> listCiscoVnmcResources(ListCiscoVnmcResourcesCmd cmd);
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/network/resource/CiscoVnmcResource.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/resource/CiscoVnmcResource.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/resource/CiscoVnmcResource.java
new file mode 100644
index 0000000..9155978
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/resource/CiscoVnmcResource.java
@@ -0,0 +1,780 @@
+// 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.resource;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import org.apache.log4j.Logger;
+
+import com.cloud.agent.IAgentControl;
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.AssociateAsaWithLogicalEdgeFirewallCommand;
+import com.cloud.agent.api.CleanupLogicalEdgeFirewallCommand;
+import com.cloud.agent.api.Command;
+import com.cloud.agent.api.ConfigureNexusVsmForAsaCommand;
+import com.cloud.agent.api.CreateLogicalEdgeFirewallCommand;
+import com.cloud.agent.api.ExternalNetworkResourceUsageAnswer;
+import com.cloud.agent.api.ExternalNetworkResourceUsageCommand;
+import com.cloud.agent.api.MaintainAnswer;
+import com.cloud.agent.api.MaintainCommand;
+import com.cloud.agent.api.PingCommand;
+import com.cloud.agent.api.ReadyAnswer;
+import com.cloud.agent.api.ReadyCommand;
+import com.cloud.agent.api.StartupCommand;
+import com.cloud.agent.api.StartupExternalFirewallCommand;
+import com.cloud.agent.api.routing.IpAssocAnswer;
+import com.cloud.agent.api.routing.IpAssocCommand;
+import com.cloud.agent.api.routing.NetworkElementCommand;
+import com.cloud.agent.api.routing.SetFirewallRulesCommand;
+import com.cloud.agent.api.routing.SetPortForwardingRulesCommand;
+import com.cloud.agent.api.routing.SetSourceNatCommand;
+import com.cloud.agent.api.routing.SetStaticNatRulesCommand;
+import com.cloud.agent.api.to.FirewallRuleTO;
+import com.cloud.agent.api.to.PortForwardingRuleTO;
+import com.cloud.agent.api.to.StaticNatRuleTO;
+import com.cloud.host.Host;
+import com.cloud.network.cisco.CiscoVnmcConnectionImpl;
+import com.cloud.network.rules.FirewallRule.TrafficType;
+import com.cloud.resource.ServerResource;
+import com.cloud.utils.NumbersUtil;
+import com.cloud.utils.Pair;
+import com.cloud.utils.cisco.n1kv.vsm.NetconfHelper;
+import com.cloud.utils.cisco.n1kv.vsm.VsmCommand.OperationType;
+import com.cloud.utils.cisco.n1kv.vsm.VsmCommand.SwitchPortMode;
+import com.cloud.utils.exception.ExecutionException;
+import com.cloud.utils.net.NetUtils;
+
+public class CiscoVnmcResource implements ServerResource {
+
+    private String _name;
+    private String _zoneId;
+    private String _physicalNetworkId;
+    private String _ip;
+    private String _username;
+    private String _password;
+    private String _guid;
+    private Integer _numRetries;
+
+    private CiscoVnmcConnectionImpl _connection;
+
+    public void setConnection(CiscoVnmcConnectionImpl connection) {
+        this._connection = connection;
+    }
+
+    private final Logger s_logger = Logger.getLogger(CiscoVnmcResource.class);
+
+    public Answer executeRequest(Command cmd) {
+        if (cmd instanceof ReadyCommand) {
+            return execute((ReadyCommand) cmd);
+        } else if (cmd instanceof MaintainCommand) {
+            return execute((MaintainCommand) cmd);
+        } else if (cmd instanceof IpAssocCommand) {
+            return execute((IpAssocCommand) cmd);
+        } else if (cmd instanceof SetSourceNatCommand) {
+            return execute((SetSourceNatCommand) cmd);
+        } else if (cmd instanceof SetFirewallRulesCommand) {
+            return execute((SetFirewallRulesCommand) cmd);
+        } else if (cmd instanceof SetStaticNatRulesCommand) {
+            return execute((SetStaticNatRulesCommand) cmd);
+        } else if (cmd instanceof SetPortForwardingRulesCommand) {
+            return execute((SetPortForwardingRulesCommand) cmd);
+        } else if (cmd instanceof ExternalNetworkResourceUsageCommand) {
+            return execute((ExternalNetworkResourceUsageCommand) cmd);
+        } else if (cmd instanceof CreateLogicalEdgeFirewallCommand) {
+            return execute((CreateLogicalEdgeFirewallCommand)cmd);
+        } else if (cmd instanceof CleanupLogicalEdgeFirewallCommand) {
+            return execute((CleanupLogicalEdgeFirewallCommand)cmd);
+        } else if (cmd instanceof ConfigureNexusVsmForAsaCommand) {
+            return execute((ConfigureNexusVsmForAsaCommand)cmd);
+        } else if (cmd instanceof AssociateAsaWithLogicalEdgeFirewallCommand) {
+            return execute((AssociateAsaWithLogicalEdgeFirewallCommand)cmd);
+        } else {
+            return Answer.createUnsupportedCommandAnswer(cmd);
+        }
+    }
+
+    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
+        try {
+            _name = (String) params.get("name");
+            if (_name == null) {
+                throw new ConfigurationException("Unable to find name");
+            }
+
+            _zoneId = (String) params.get("zoneId");
+            if (_zoneId == null) {
+                throw new ConfigurationException("Unable to find zone");
+            }
+
+            _physicalNetworkId = (String) params.get("physicalNetworkId");
+            if (_physicalNetworkId == null) {
+                throw new ConfigurationException("Unable to find physical network id in the configuration parameters");
+            }
+
+            _ip = (String) params.get("ip");
+            if (_ip == null) {
+                throw new ConfigurationException("Unable to find IP");
+            }
+
+            _username = (String) params.get("username");
+            if (_username == null) {
+                throw new ConfigurationException("Unable to find username");
+            }
+
+            _password = (String) params.get("password");
+            if (_password == null) {
+                throw new ConfigurationException("Unable to find password");
+            }
+
+            _guid = (String)params.get("guid");
+            if (_guid == null) {
+                throw new ConfigurationException("Unable to find the guid");
+            }
+
+            _numRetries = NumbersUtil.parseInt((String) params.get("numretries"), 1);
+
+            NumbersUtil.parseInt((String) params.get("timeout"), 300);
+
+            // Open a socket and login
+            _connection = new CiscoVnmcConnectionImpl(_ip, _username, _password);
+            //if (!refreshVnmcConnection()) {
+            //    throw new ConfigurationException("Unable to open a connection to the VNMC.");
+            //}
+
+            return true;
+        } catch (Exception e) {
+            throw new ConfigurationException(e.getMessage());
+        }
+
+    }
+
+    public StartupCommand[] initialize() {
+        StartupExternalFirewallCommand cmd = new StartupExternalFirewallCommand();
+        cmd.setName(_name);
+        cmd.setDataCenter(_zoneId);
+        cmd.setPod("");
+        cmd.setPrivateIpAddress(_ip);
+        cmd.setStorageIpAddress("");
+        cmd.setVersion("");
+        cmd.setGuid(_guid);
+        return new StartupCommand[] { cmd };
+    }
+
+    public Host.Type getType() {
+        return Host.Type.ExternalFirewall;
+    }
+
+    @Override
+    public String getName() {
+        return _name;
+    }
+
+    @Override
+    public boolean start() {
+        return true;
+    }
+
+    @Override
+    public boolean stop() {
+        return true;
+    }
+
+    @Override
+    public PingCommand getCurrentStatus(final long id) {
+        if (!refreshVnmcConnection()) {
+            return null;
+        }
+        return new PingCommand(Host.Type.ExternalFirewall, id);
+    }
+
+    @Override
+    public void disconnected() {
+    }
+
+    public IAgentControl getAgentControl() {
+        return null;
+    }
+
+    public void setAgentControl(IAgentControl agentControl) {
+        return;
+    }
+
+    private Answer execute(ReadyCommand cmd) {
+        return new ReadyAnswer(cmd);
+    }
+
+    private Answer execute(MaintainCommand cmd) {
+        return new MaintainAnswer(cmd);
+    }
+
+    private ExternalNetworkResourceUsageAnswer execute(ExternalNetworkResourceUsageCommand cmd) {
+        return new ExternalNetworkResourceUsageAnswer(cmd);
+    }
+
+    /*
+     * Login
+     */
+    private boolean refreshVnmcConnection() {
+        boolean ret = false;
+        try {
+            ret = _connection.login();
+        } catch (ExecutionException ex) {
+            s_logger.error("Login to Vnmc failed", ex);
+        }
+        return ret;
+    }
+
+    private synchronized Answer execute(IpAssocCommand cmd) {
+        refreshVnmcConnection();
+        return execute(cmd, _numRetries);
+    }
+
+    private Answer execute(IpAssocCommand cmd, int numRetries) {
+        String[] results = new String[cmd.getIpAddresses().length];
+        return new IpAssocAnswer(cmd, results);
+    }
+
+    private String[] getIpRangeFromCidr(String cidr) {
+        String[] result = new String[2];
+        String[] cidrData = cidr.split("\\/");
+        assert (cidrData.length == 2) : "Something is wrong with source cidr " + cidr;
+        long size = Long.valueOf(cidrData[1]);
+        result[0] = cidrData[0];
+        result[1] = cidrData[0];
+        if (size < 32) {
+            result[0] = NetUtils.getIpRangeStartIpFromCidr(cidrData[0], size);
+            result[1] = NetUtils.getIpRangeEndIpFromCidr(cidrData[0], size);
+        }
+        return result;
+    }
+
+    /*
+     * Source NAT
+     */
+    private synchronized Answer execute(SetSourceNatCommand cmd) {
+        refreshVnmcConnection();
+        return execute(cmd, _numRetries);
+    }
+
+    private Answer execute(SetSourceNatCommand cmd, int numRetries) {
+        String vlanId = cmd.getContextParam(NetworkElementCommand.GUEST_VLAN_TAG);
+        String tenant = "vlan-" + vlanId;
+        String policyIdentifier = cmd.getIpAddress().getPublicIp().replace('.', '-');
+        try {
+            if (!_connection.createTenantVDCNatPolicySet(tenant)) {
+                throw new Exception("Failed to create NAT policy set in VNMC for guest network with vlan " + vlanId);
+            }
+
+            if (!_connection.createTenantVDCSourceNatPolicy(tenant, policyIdentifier)) {
+                throw new Exception("Failed to create source NAT policy in VNMC for guest network with vlan " + vlanId);
+            }
+
+            if (!_connection.createTenantVDCSourceNatPolicyRef(tenant, policyIdentifier)) {
+                throw new Exception("Failed to associate source NAT policy with NAT policy set in VNMC for guest network with vlan " + vlanId);
+            }
+
+            if (!_connection.createTenantVDCSourceNatIpPool(tenant, policyIdentifier, cmd.getIpAddress().getPublicIp())) {
+                throw new Exception("Failed to create source NAT ip pool in VNMC for guest network with vlan " + vlanId);
+            }
+
+            String[] ipRange = getIpRangeFromCidr(cmd.getContextParam(NetworkElementCommand.GUEST_NETWORK_CIDR));
+            if (!_connection.createTenantVDCSourceNatRule(tenant, policyIdentifier, ipRange[0], ipRange[1])) {
+                throw new Exception("Failed to create source NAT rule in VNMC for guest network with vlan " + vlanId);
+            }
+
+            if (!_connection.associateNatPolicySet(tenant)) {
+                throw new Exception("Failed to associate source NAT policy set with edge security profile in VNMC for guest network with vlan " + vlanId);
+            }
+        } catch (Throwable e) {
+            String msg = "SetSourceNatCommand failed due to " + e.getMessage();
+            s_logger.error(msg, e);
+            return new Answer(cmd, false, msg);
+        }
+
+        return new Answer(cmd, true, "Success");
+    }
+
+    /*
+     * Firewall rule
+     */
+    private synchronized Answer execute(SetFirewallRulesCommand cmd) {
+        refreshVnmcConnection();
+        return execute(cmd, _numRetries);
+    }
+
+    private Answer execute(SetFirewallRulesCommand cmd, int numRetries) {
+        String vlanId = cmd.getContextParam(NetworkElementCommand.GUEST_VLAN_TAG);
+        String tenant = "vlan-" + vlanId;
+
+        FirewallRuleTO[] rules = cmd.getRules();
+        Map<String, List<FirewallRuleTO>> publicIpRulesMap = new HashMap<String, List<FirewallRuleTO>>();
+        for (FirewallRuleTO rule : rules) {
+            String publicIp = rule.getSrcIp();
+            if (!publicIpRulesMap.containsKey(publicIp)) {
+                List<FirewallRuleTO> publicIpRulesList = new ArrayList<FirewallRuleTO>();
+                publicIpRulesMap.put(publicIp, publicIpRulesList);
+            }
+            publicIpRulesMap.get(publicIp).add(rule);
+        }
+
+        try {
+            if (!_connection.createTenantVDCAclPolicySet(tenant, true)) {
+                throw new Exception("Failed to create ACL ingress policy set in VNMC for guest network with vlan " + vlanId);
+            }
+            if (!_connection.createTenantVDCAclPolicySet(tenant, false)) {
+                throw new Exception("Failed to create ACL egress policy set in VNMC for guest network with vlan " + vlanId);
+            }
+
+            for (String publicIp : publicIpRulesMap.keySet()) {
+                String policyIdentifier = publicIp.replace('.', '-');
+
+                if (!_connection.createTenantVDCAclPolicy(tenant, policyIdentifier)) {
+                    throw new Exception("Failed to create ACL policy in VNMC for guest network with vlan " + vlanId);
+                }
+                if (!_connection.createTenantVDCAclPolicyRef(tenant, policyIdentifier, true)) {
+                    throw new Exception("Failed to associate ACL policy with ACL ingress policy set in VNMC for guest network with vlan " + vlanId);
+                }
+                if (!_connection.createTenantVDCAclPolicyRef(tenant, policyIdentifier, false)) {
+                    throw new Exception("Failed to associate ACL policy with ACL egress policy set in VNMC for guest network with vlan " + vlanId);
+                }
+
+                for (FirewallRuleTO rule : publicIpRulesMap.get(publicIp)) {
+                    if (rule.revoked()) {
+                        if (!_connection.deleteTenantVDCAclRule(tenant, Long.toString(rule.getId()), policyIdentifier)) {
+                            throw new Exception("Failed to delete ACL rule in VNMC for guest network with vlan " + vlanId);
+                        }
+                    } else {
+                        String[] externalIpRange = getIpRangeFromCidr(rule.getSourceCidrList().get(0));
+                        if (rule.getTrafficType() == TrafficType.Ingress) {
+                            if (!rule.getProtocol().equalsIgnoreCase("icmp")) {
+                                if (!_connection.createTenantVDCIngressAclRule(tenant,
+                                        Long.toString(rule.getId()), policyIdentifier,
+                                        rule.getProtocol().toUpperCase(), externalIpRange[0], externalIpRange[1],
+                                        Integer.toString(rule.getSrcPortRange()[0]), Integer.toString(rule.getSrcPortRange()[1]), publicIp)) {
+                                    throw new Exception("Failed to create ACL ingress rule in VNMC for guest network with vlan " + vlanId);
+                                }
+                            } else {
+                                if (!_connection.createTenantVDCIngressAclRule(tenant,
+                                        Long.toString(rule.getId()), policyIdentifier,
+                                        rule.getProtocol().toUpperCase(), externalIpRange[0], externalIpRange[1], publicIp)) {
+                                    throw new Exception("Failed to create ACL ingress rule in VNMC for guest network with vlan " + vlanId);
+                                }
+                            }
+                        } else {
+                            if (!rule.getProtocol().equalsIgnoreCase("icmp")) {
+                                if (!_connection.createTenantVDCEgressAclRule(tenant,
+                                        Long.toString(rule.getId()), policyIdentifier,
+                                        rule.getProtocol().toUpperCase(),
+                                        Integer.toString(rule.getSrcPortRange()[0]), Integer.toString(rule.getSrcPortRange()[1]), publicIp,
+                                        externalIpRange[0], externalIpRange[1])) {
+                                    throw new Exception("Failed to create ACL egress rule in VNMC for guest network with vlan " + vlanId);
+                                }
+                            } else {
+                                if (!_connection.createTenantVDCEgressAclRule(tenant,
+                                        Long.toString(rule.getId()), policyIdentifier,
+                                        rule.getProtocol().toUpperCase(), publicIp, externalIpRange[0], externalIpRange[1])) {
+                                    throw new Exception("Failed to create ACL egress rule in VNMC for guest network with vlan " + vlanId);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
+            if (!_connection.associateAclPolicySet(tenant)) {
+                throw new Exception("Failed to associate ACL policy set with edge security profile in VNMC for guest network with vlan " + vlanId);
+            }
+        } catch (Throwable e) {
+            String msg = "SetFirewallRulesCommand failed due to " + e.getMessage();
+            s_logger.error(msg, e);
+            return new Answer(cmd, false, msg);
+        }
+
+        return new Answer(cmd, true, "Success");
+    }
+
+    /*
+     * Static NAT
+     */
+    private synchronized Answer execute(SetStaticNatRulesCommand cmd) {
+        refreshVnmcConnection();
+        return execute(cmd, _numRetries);
+    }
+
+    private Answer execute(SetStaticNatRulesCommand cmd, int numRetries) {
+        String vlanId = cmd.getContextParam(NetworkElementCommand.GUEST_VLAN_TAG);
+        String tenant = "vlan-" + vlanId;
+
+        StaticNatRuleTO[] rules = cmd.getRules();
+        Map<String, List<StaticNatRuleTO>> publicIpRulesMap = new HashMap<String, List<StaticNatRuleTO>>();
+        for (StaticNatRuleTO rule : rules) {
+            String publicIp = rule.getSrcIp();
+            if (!publicIpRulesMap.containsKey(publicIp)) {
+                List<StaticNatRuleTO> publicIpRulesList = new ArrayList<StaticNatRuleTO>();
+                publicIpRulesMap.put(publicIp, publicIpRulesList);
+            }
+            publicIpRulesMap.get(publicIp).add(rule);
+        }
+
+        try {
+            if (!_connection.createTenantVDCNatPolicySet(tenant)) {
+                throw new Exception("Failed to create NAT policy set in VNMC for guest network with vlan " + vlanId);
+            }
+
+            if (!_connection.createTenantVDCAclPolicySet(tenant, true)) {
+                throw new Exception("Failed to create ACL ingress policy set in VNMC for guest network with vlan " + vlanId);
+            }
+
+            if (!_connection.createTenantVDCAclPolicySet(tenant, false)) {
+                throw new Exception("Failed to create ACL egress policy set in VNMC for guest network with vlan " + vlanId);
+            }
+
+            for (String publicIp : publicIpRulesMap.keySet()) {
+                String policyIdentifier = publicIp.replace('.', '-');
+
+                if (!_connection.createTenantVDCDNatPolicy(tenant, policyIdentifier)) {
+                    throw new Exception("Failed to create DNAT policy in VNMC for guest network with vlan " + vlanId);
+                }
+                if (!_connection.createTenantVDCDNatPolicyRef(tenant, policyIdentifier)) {
+                    throw new Exception("Failed to associate DNAT policy with NAT policy set in VNMC for guest network with vlan " + vlanId);
+                }
+
+                if (!_connection.createTenantVDCAclPolicy(tenant, policyIdentifier)) {
+                    throw new Exception("Failed to create ACL policy in VNMC for guest network with vlan " + vlanId);
+                }
+                if (!_connection.createTenantVDCAclPolicyRef(tenant, policyIdentifier, true)) {
+                    throw new Exception("Failed to associate ACL policy with ACL ingress policy set in VNMC for guest network with vlan " + vlanId);
+                }
+                if (!_connection.createTenantVDCAclPolicyRef(tenant, policyIdentifier, false)) {
+                    throw new Exception("Failed to associate ACL policy with ACL egress policy set in VNMC for guest network with vlan " + vlanId);
+                }
+
+                for (StaticNatRuleTO rule : publicIpRulesMap.get(publicIp)) {
+                    if (rule.revoked()) {
+                        if (!_connection.deleteTenantVDCDNatRule(tenant, Long.toString(rule.getId()), policyIdentifier)) {
+                            throw new Exception("Failed to delete DNAT rule in VNMC for guest network with vlan " + vlanId);
+                        }
+
+                        if (!_connection.deleteTenantVDCAclRule(tenant, Long.toString(rule.getId()), policyIdentifier)) {
+                            throw new Exception("Failed to delete ACL ingress rule for DNAT in VNMC for guest network with vlan " + vlanId);
+                        }
+                    } else {
+                        if (!_connection.createTenantVDCDNatIpPool(tenant, policyIdentifier + "-" + rule.getId(), rule.getDstIp())) {
+                            throw new Exception("Failed to create DNAT ip pool in VNMC for guest network with vlan " + vlanId);
+                        }
+
+                        if (!_connection.createTenantVDCDNatRule(tenant,
+                                Long.toString(rule.getId()), policyIdentifier, rule.getSrcIp())) {
+                            throw new Exception("Failed to create DNAT rule in VNMC for guest network with vlan " + vlanId);
+                        }
+
+                        if (!_connection.createTenantVDCAclRuleForDNat(tenant,
+                                Long.toString(rule.getId()), policyIdentifier, rule.getDstIp())) {
+                            throw new Exception("Failed to create ACL rule for DNAT in VNMC for guest network with vlan " + vlanId);
+                        }
+                    }
+                }
+            }
+
+            if (!_connection.associateAclPolicySet(tenant)) {
+                throw new Exception("Failed to associate source NAT policy set with edge security profile in VNMC for guest network with vlan " + vlanId);
+            }
+        } catch (Throwable e) {
+            String msg = "SetSourceNatCommand failed due to " + e.getMessage();
+            s_logger.error(msg, e);
+            return new Answer(cmd, false, msg);
+        }
+
+        return new Answer(cmd, true, "Success");
+    }
+
+    /*
+     * Destination NAT
+     */
+    private synchronized Answer execute(SetPortForwardingRulesCommand cmd) {
+        refreshVnmcConnection();
+        return execute(cmd, _numRetries);
+    }
+
+    private Answer execute(SetPortForwardingRulesCommand cmd, int numRetries) {
+        String vlanId = cmd.getContextParam(NetworkElementCommand.GUEST_VLAN_TAG);
+        String tenant = "vlan-" + vlanId;
+
+        PortForwardingRuleTO[] rules = cmd.getRules();
+        Map<String, List<PortForwardingRuleTO>> publicIpRulesMap = new HashMap<String, List<PortForwardingRuleTO>>();
+        for (PortForwardingRuleTO rule : rules) {
+            String publicIp = rule.getSrcIp();
+            if (!publicIpRulesMap.containsKey(publicIp)) {
+                List<PortForwardingRuleTO> publicIpRulesList = new ArrayList<PortForwardingRuleTO>();
+                publicIpRulesMap.put(publicIp, publicIpRulesList);
+            }
+            publicIpRulesMap.get(publicIp).add(rule);
+        }
+
+        try {
+            if (!_connection.createTenantVDCNatPolicySet(tenant)) {
+                throw new Exception("Failed to create NAT policy set in VNMC for guest network with vlan " + vlanId);
+            }
+
+            if (!_connection.createTenantVDCAclPolicySet(tenant, true)) {
+                throw new Exception("Failed to create ACL ingress policy set in VNMC for guest network with vlan " + vlanId);
+            }
+
+            if (!_connection.createTenantVDCAclPolicySet(tenant, false)) {
+                throw new Exception("Failed to create ACL egress policy set in VNMC for guest network with vlan " + vlanId);
+            }
+
+            for (String publicIp : publicIpRulesMap.keySet()) {
+                String policyIdentifier = publicIp.replace('.', '-');
+
+                if (!_connection.createTenantVDCPFPolicy(tenant, policyIdentifier)) {
+                    throw new Exception("Failed to create PF policy in VNMC for guest network with vlan " + vlanId);
+                }
+                if (!_connection.createTenantVDCPFPolicyRef(tenant, policyIdentifier)) {
+                    throw new Exception("Failed to associate PF policy with NAT policy set in VNMC for guest network with vlan " + vlanId);
+                }
+
+                if (!_connection.createTenantVDCAclPolicy(tenant, policyIdentifier)) {
+                    throw new Exception("Failed to create ACL policy in VNMC for guest network with vlan " + vlanId);
+                }
+                if (!_connection.createTenantVDCAclPolicyRef(tenant, policyIdentifier, true)) {
+                    throw new Exception("Failed to associate ACL policy with ACL ingress policy set in VNMC for guest network with vlan " + vlanId);
+                }
+                if (!_connection.createTenantVDCAclPolicyRef(tenant, policyIdentifier, false)) {
+                    throw new Exception("Failed to associate ACL policy with ACL egress policy set in VNMC for guest network with vlan " + vlanId);
+                }
+
+                for (PortForwardingRuleTO rule : publicIpRulesMap.get(publicIp)) {
+                    if (rule.revoked()) {
+                        if (!_connection.deleteTenantVDCPFRule(tenant, Long.toString(rule.getId()), policyIdentifier)) {
+                            throw new Exception("Failed to delete PF rule in VNMC for guest network with vlan " + vlanId);
+                        }
+
+                        if (!_connection.deleteTenantVDCAclRule(tenant, Long.toString(rule.getId()), policyIdentifier)) {
+                            throw new Exception("Failed to delete ACL ingress rule for PF in VNMC for guest network with vlan " + vlanId);
+                        }
+                    } else {
+                        if (!_connection.createTenantVDCPFIpPool(tenant, policyIdentifier + "-" + rule.getId(), rule.getDstIp())) {
+                            throw new Exception("Failed to create PF ip pool in VNMC for guest network with vlan " + vlanId);
+                        }
+                        if (!_connection.createTenantVDCPFPortPool(tenant, policyIdentifier + "-" + rule.getId(),
+                                Integer.toString(rule.getDstPortRange()[0]), Integer.toString(rule.getDstPortRange()[1]))) {
+                            throw new Exception("Failed to create PF port pool in VNMC for guest network with vlan " + vlanId);
+                        }
+
+                        if (!_connection.createTenantVDCPFRule(tenant,
+                                Long.toString(rule.getId()), policyIdentifier,
+                                rule.getProtocol().toUpperCase(), rule.getSrcIp(),
+                                Integer.toString(rule.getSrcPortRange()[0]), Integer.toString(rule.getSrcPortRange()[1]))) {
+                            throw new Exception("Failed to create PF rule in VNMC for guest network with vlan " + vlanId);
+                        }
+
+                        if (!_connection.createTenantVDCAclRuleForPF(tenant,
+                                Long.toString(rule.getId()), policyIdentifier,
+                                rule.getProtocol().toUpperCase(), rule.getDstIp(),
+                                Integer.toString(rule.getDstPortRange()[0]), Integer.toString(rule.getDstPortRange()[1]))) {
+                            throw new Exception("Failed to create ACL rule for PF in VNMC for guest network with vlan " + vlanId);
+                        }
+                    }
+                }
+            }
+
+            if (!_connection.associateAclPolicySet(tenant)) {
+                throw new Exception("Failed to associate source NAT policy set with edge security profile in VNMC for guest network with vlan " + vlanId);
+            }
+        } catch (Throwable e) {
+            String msg = "SetSourceNatCommand failed due to " + e.getMessage();
+            s_logger.error(msg, e);
+            return new Answer(cmd, false, msg);
+        }
+
+        return new Answer(cmd, true, "Success");
+    }
+
+    /*
+     * Logical edge firewall
+     */
+    private synchronized Answer execute(CreateLogicalEdgeFirewallCommand cmd) {
+        refreshVnmcConnection();
+        return execute(cmd, _numRetries);
+    }
+
+    private void createEdgeDeviceProfile(String tenant, List<String> gateways, Long vlanId) throws Exception {
+        // create edge device profile
+        if (!_connection.createTenantVDCEdgeDeviceProfile(tenant))
+            throw new Exception("Failed to create tenant edge device profile in VNMC for guest network with vlan " + vlanId);
+
+        // create edge static route policy
+        if (!_connection.createTenantVDCEdgeStaticRoutePolicy(tenant))
+            throw new Exception("Failed to create tenant edge static route policy in VNMC for guest network with vlan " + vlanId);
+
+        // create edge static route for all gateways
+        for (String gateway : gateways) {
+            if (!_connection.createTenantVDCEdgeStaticRoute(tenant, gateway, "0.0.0.0", "0.0.0.0"))
+                throw new Exception("Failed to create tenant edge static route in VNMC for guest network with vlan " + vlanId);
+        }
+
+        // associate edge 
+        if (!_connection.associateTenantVDCEdgeStaticRoutePolicy(tenant))
+            throw new Exception("Failed to associate edge static route policy with edge device profile in VNMC for guest network with vlan " + vlanId);
+    }
+
+    private Answer execute(CreateLogicalEdgeFirewallCommand cmd, int numRetries) {
+        String tenant = "vlan-" + cmd.getVlanId();
+        try {
+            // create tenant
+            if (!_connection.createTenant(tenant))
+                throw new Exception("Failed to create tenant in VNMC for guest network with vlan " + cmd.getVlanId());
+
+            // create tenant VDC
+            if (!_connection.createTenantVDC(tenant))
+                throw new Exception("Failed to create tenant VDC in VNMC for guest network with vlan " + cmd.getVlanId());
+
+            // create edge security profile
+            if (!_connection.createTenantVDCEdgeSecurityProfile(tenant))
+                throw new Exception("Failed to create tenant edge security profile in VNMC for guest network with vlan " + cmd.getVlanId());
+
+            // create edge device profile and associated route
+            createEdgeDeviceProfile(tenant, cmd.getPublicGateways(), cmd.getVlanId());
+
+            // create logical edge firewall
+            if (!_connection.createEdgeFirewall(tenant, cmd.getPublicIp(), cmd.getInternalIp(), cmd.getPublicSubnet(), cmd.getInternalSubnet()))
+                throw new Exception("Failed to create edge firewall in VNMC for guest network with vlan " + cmd.getVlanId());
+        } catch (Throwable e) {
+            String msg = "CreateLogicalEdgeFirewallCommand failed due to " + e.getMessage();
+            s_logger.error(msg, e);
+            return new Answer(cmd, false, msg);
+        }
+
+        return new Answer(cmd, true, "Success");
+    }
+
+    /*
+     * Create vservice node and update inside port profile for ASA appliance in VSM
+     */
+    private synchronized Answer execute(ConfigureNexusVsmForAsaCommand cmd) {
+        return execute(cmd, _numRetries);
+    }
+
+    private Answer execute(ConfigureNexusVsmForAsaCommand cmd, int numRetries) {
+        String vlanId = Long.toString(cmd.getVlanId());
+        NetconfHelper helper = null;
+        List<Pair<OperationType, String>> params = new ArrayList<Pair<OperationType, String>>();
+        params.add(new Pair<OperationType, String>(OperationType.addvlanid, vlanId));
+        try {
+            helper = new NetconfHelper(cmd.getVsmIp(), cmd.getVsmUsername(), cmd.getVsmPassword());
+            s_logger.debug("Connected to Cisco VSM " + cmd.getVsmIp());
+            helper.addVServiceNode(vlanId, cmd.getIpAddress());
+            s_logger.debug("Created vservice node for ASA appliance in Cisco VSM for vlan " + vlanId);
+            helper.updatePortProfile(cmd.getAsaInPortProfile(), SwitchPortMode.access, params);
+            s_logger.debug("Updated inside port profile for ASA appliance in Cisco VSM with new vlan " + vlanId);
+        } catch (Throwable e) {
+            String msg = "ConfigureVSMForASACommand failed due to " + e.getMessage();
+            s_logger.error(msg, e);
+            return new Answer(cmd, false, msg);
+        } finally {
+            helper.disconnect();
+        }
+
+        return new Answer(cmd, true, "Success");
+    }
+
+    /*
+     * Associates ASA 1000v with logical edge firewall in VNMC
+     */
+    private synchronized Answer execute(AssociateAsaWithLogicalEdgeFirewallCommand cmd) {
+        return execute(cmd, _numRetries);
+    }
+
+    private Answer execute(AssociateAsaWithLogicalEdgeFirewallCommand cmd, int numRetries) {
+        String tenant = "vlan-" + cmd.getVlanId();
+        try {
+            Map<String, String> availableAsaAppliances = _connection.listUnAssocAsa1000v();
+            if (availableAsaAppliances.isEmpty()) {
+                throw new Exception("No ASA 1000v available to associate with logical edge firewall for guest vlan " + cmd.getVlanId());
+            }
+
+            String asaInstanceDn = availableAsaAppliances.get(cmd.getAsaMgmtIp());
+            if (asaInstanceDn == null) {
+                throw new Exception("Requested ASA 1000v (" + cmd.getAsaMgmtIp() + ") is not available");
+            }
+
+            if (!_connection.assignAsa1000v(tenant, asaInstanceDn)) {
+                throw new Exception("Failed to associate ASA 1000v (" + cmd.getAsaMgmtIp() + ") with logical edge firewall for guest vlan " + cmd.getVlanId());
+            }
+        } catch (Throwable e) {
+            String msg = "AssociateAsaWithLogicalEdgeFirewallCommand failed due to " + e.getMessage();
+            s_logger.error(msg, e);
+            return new Answer(cmd, false, msg);
+        }
+
+        return new Answer(cmd, true, "Success");
+    }
+
+    /*
+     * Cleanup
+     */
+    private synchronized Answer execute(CleanupLogicalEdgeFirewallCommand cmd) {
+        refreshVnmcConnection();
+        return execute(cmd, _numRetries);
+    }
+
+    private Answer execute(CleanupLogicalEdgeFirewallCommand cmd, int numRetries) {
+        String tenant = "vlan-" + cmd.getVlanId();
+        try {
+            _connection.deleteTenant(tenant);
+        } catch (Throwable e) {
+            String msg = "CleanupLogicalEdgeFirewallCommand failed due to " + e.getMessage();
+            s_logger.error(msg, e);
+            return new Answer(cmd, false, msg);
+        }
+
+        return new Answer(cmd, true, "Success");
+    }
+
+    @Override
+    public void setName(String name) {
+        // TODO Auto-generated method stub
+    }
+
+    @Override
+    public void setConfigParams(Map<String, Object> params) {
+        // TODO Auto-generated method stub
+    }
+
+    @Override
+    public Map<String, Object> getConfigParams() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public int getRunLevel() {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    @Override
+    public void setRunLevel(int level) {
+        // TODO Auto-generated method stub
+    }
+
+}


[27/33] Squashed commit of the following:

Posted by bf...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-generic-egress-acl-rule.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-generic-egress-acl-rule.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-generic-egress-acl-rule.xml
new file mode 100755
index 0000000..92c2504
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-generic-egress-acl-rule.xml
@@ -0,0 +1,122 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+
+    <pair key="%aclruledn%">
+      <policyRule
+        descr="%descr%"
+        dn="%aclruledn%"
+        name="%aclrulename%"
+        order="%order%"
+        status="created"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-action-0">
+      <fwpolicyAction
+        actionType="%actiontype%"
+        dn="%aclruledn%/rule-action-0"
+        id="0"
+        status="created"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-cond-2">
+      <policyRuleCondition
+        dn="%aclruledn%/rule-cond-2"
+        id="2"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-2/nw-expr2">
+      <policyNetworkExpression
+        dn="%aclruledn%/rule-cond-2/nw-expr2"
+        id="2"
+        opr="eq"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-2/nw-expr2/nw-protocol-2">
+      <policyProtocol
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-2/nw-expr2/nw-protocol-2"
+        id="2"
+        name=""
+        placement="none"
+        status="created"
+        value="%protocolvalue%"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-cond-3">
+      <policyRuleCondition
+        dn="%aclruledn%/rule-cond-3"
+        id="3"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2">
+      <policyNetworkExpression
+        dn="%aclruledn%/rule-cond-3/nw-expr2"
+        id="2"
+        opr="range"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2/nw-attr-qual">
+      <policyNwAttrQualifier
+        attrEp="destination"
+        dn="%aclruledn%/rule-cond-3/nw-expr2/nw-attr-qual"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2/nw-ip-2">
+      <policyIPAddress
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-3/nw-expr2/nw-ip-2"
+        id="2"
+        name=""
+        placement="begin"
+        status="created"
+        value="%deststartip%"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2/nw-ip-3">
+      <policyIPAddress
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-3/nw-expr2/nw-ip-3"
+        id="3"
+        name=""
+        placement="end"
+        status="created"
+        value="%destendip%"/>
+    </pair>
+
+  </inConfigs>
+</configConfMos>
+
+<!--
+    aclruledn="org-root/org-vlan-123/org-VDC-vlan-123/pol-test_policy/rule-dummy"
+    aclrulename="dummy"
+    descr=value
+    actiontype="drop" or "permit"
+    protocolvalue = "TCP" or "UDP" or "ICMP"
+    deststartip="destination start ip"
+    destendip="destination end ip"
+    sourceip="source ip"
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-generic-ingress-acl-rule.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-generic-ingress-acl-rule.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-generic-ingress-acl-rule.xml
new file mode 100755
index 0000000..7c11641
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-generic-ingress-acl-rule.xml
@@ -0,0 +1,121 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+
+    <pair key="%aclruledn%">
+      <policyRule
+        descr="%descr%"
+        dn="%aclruledn%"
+        name="%aclrulename%"
+        order="%order%"
+        status="created"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-action-0">
+      <fwpolicyAction
+        actionType="%actiontype%"
+        dn="%aclruledn%/rule-action-0"
+        id="0"
+        status="created"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-cond-2">
+      <policyRuleCondition
+        dn="%aclruledn%/rule-cond-2"
+        id="2"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-2/nw-expr2">
+      <policyNetworkExpression
+        dn="%aclruledn%/rule-cond-2/nw-expr2"
+        id="2"
+        opr="eq"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-2/nw-expr2/nw-protocol-2">
+      <policyProtocol
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-2/nw-expr2/nw-protocol-2"
+        id="2"
+        name=""
+        placement="none"
+        status="created"
+        value="%protocolvalue%"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-cond-3">
+      <policyRuleCondition
+        dn="%aclruledn%/rule-cond-3"
+        id="3"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2">
+      <policyNetworkExpression
+        dn="%aclruledn%/rule-cond-3/nw-expr2"
+        id="2"
+        opr="range"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2/nw-attr-qual">
+      <policyNwAttrQualifier
+        attrEp="source"
+        dn="%aclruledn%/rule-cond-3/nw-expr2/nw-attr-qual"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2/nw-ip-2">
+      <policyIPAddress
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-3/nw-expr2/nw-ip-2"
+        id="2"
+        name=""
+        placement="begin"
+        status="created"
+        value="%sourcestartip%"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2/nw-ip-3">
+      <policyIPAddress
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-3/nw-expr2/nw-ip-3"
+        id="3"
+        name=""
+        placement="end"
+        status="created"
+        value="%sourceendip%"/>
+    </pair>
+
+  </inConfigs>
+</configConfMos>
+
+<!--
+    aclruledn="org-root/org-vlan-123/org-VDC-vlan-123/pol-test_policy/rule-dummy"
+    aclrulename="dummy"
+    descr=value
+    actiontype="drop" or "permit"
+    protocolvalue = "TCP" or "UDP" or "ICMP"
+    sourcestartip = "source start IP"
+    sourceendip = "source end IP"
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-ingress-acl-rule.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-ingress-acl-rule.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-ingress-acl-rule.xml
new file mode 100755
index 0000000..1af30b4
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-ingress-acl-rule.xml
@@ -0,0 +1,201 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+
+    <pair key="%aclruledn%">
+      <policyRule
+        descr="%descr%"
+        dn="%aclruledn%"
+        name="%aclrulename%"
+        order="%order%"
+        status="created"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-action-0">
+      <fwpolicyAction
+        actionType="%actiontype%"
+        dn="%aclruledn%/rule-action-0"
+        id="0"
+        status="created"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-cond-2">
+      <policyRuleCondition
+        dn="%aclruledn%/rule-cond-2"
+        id="2"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-2/nw-expr2">
+      <policyNetworkExpression
+        dn="%aclruledn%/rule-cond-2/nw-expr2"
+        id="2"
+        opr="eq"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-2/nw-expr2/nw-protocol-2">
+      <policyProtocol
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-2/nw-expr2/nw-protocol-2"
+        id="2"
+        name=""
+        placement="none"
+        status="created"
+        value="%protocolvalue%"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-cond-3">
+      <policyRuleCondition
+        dn="%aclruledn%/rule-cond-3"
+        id="3"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2">
+      <policyNetworkExpression
+        dn="%aclruledn%/rule-cond-3/nw-expr2"
+        id="2"
+        opr="range"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2/nw-attr-qual">
+      <policyNwAttrQualifier
+        attrEp="source"
+        dn="%aclruledn%/rule-cond-3/nw-expr2/nw-attr-qual"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2/nw-ip-2">
+      <policyIPAddress
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-3/nw-expr2/nw-ip-2"
+        id="2"
+        name=""
+        placement="begin"
+        status="created"
+        value="%sourcestartip%"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2/nw-ip-3">
+      <policyIPAddress
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-3/nw-expr2/nw-ip-3"
+        id="3"
+        name=""
+        placement="end"
+        status="created"
+        value="%sourceendip%"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-cond-4">
+      <policyRuleCondition
+        dn="%aclruledn%/rule-cond-4"
+        id="4"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-4/nw-expr2">
+      <policyNetworkExpression
+        dn="%aclruledn%/rule-cond-4/nw-expr2"
+        id="2"
+        opr="eq"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-4/nw-expr2/nw-attr-qual">
+      <policyNwAttrQualifier
+        attrEp="destination"
+        dn="%aclruledn%/rule-cond-4/nw-expr2/nw-attr-qual"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-4/nw-expr2/nw-ip-2">
+      <policyIPAddress
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-4/nw-expr2/nw-ip-2"
+        id="2"
+        name=""
+        placement="none"
+        status="created"
+        value="%destip%"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-cond-5">
+      <policyRuleCondition
+        dn="%aclruledn%/rule-cond-5"
+        id="5"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-5/nw-expr2">
+      <policyNetworkExpression
+        dn="%aclruledn%/rule-cond-5/nw-expr2"
+        id="2"
+        opr="range"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-5/nw-expr2/nw-attr-qual">
+      <policyNwAttrQualifier
+        attrEp="destination"
+        dn="%aclruledn%/rule-cond-5/nw-expr2/nw-attr-qual"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-5/nw-expr2/nw-port-2">
+      <policyNetworkPort
+        appType="Other"
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-5/nw-expr2/nw-port-2"
+        id="2"
+        name=""
+        placement="begin"
+        status="created"
+        value="%deststartport%"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-5/nw-expr2/nw-port-3">
+      <policyNetworkPort
+        appType="Other"
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-5/nw-expr2/nw-port-3"
+        id="3"
+        name=""
+        placement="end"
+        status="created"
+        value="%destendport%"/>
+    </pair>
+
+  </inConfigs>
+</configConfMos>
+
+<!--
+    aclruledn="org-root/org-vlan-123/org-VDC-vlan-123/pol-test_policy/rule-dummy"
+    aclrulename="dummy"
+    descr=value
+    actiontype="drop" or "permit"
+    protocolvalue = "TCP" or "UDP"
+    sourcestartip="source start ip"
+    sourceendip="source end ip"
+    deststartport="start port at destination"
+    destendport="end port at destination"
+    destip="destination ip"
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-ip-pool.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-ip-pool.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-ip-pool.xml
new file mode 100755
index 0000000..4cf0451
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-ip-pool.xml
@@ -0,0 +1,58 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+
+    <pair key="%ippooldn%">
+      <policyObjectGroup
+        descr="%descr%"
+        dn="%ippooldn%"
+        name="%ippoolname%"
+        status="created"/>
+    </pair>
+    <pair key="%ippooldn%/objgrp-expr-2">
+      <policyObjectGroupExpression
+        dn="%ippooldn%/objgrp-expr-2"
+        id="2"
+        opr="eq"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%ippooldn%/objgrp-expr-2/nw-ip-2">
+      <policyIPAddress
+        dataType="string"
+        descr=""
+        dn="%ippooldn%/objgrp-expr-2/nw-ip-2"
+        id="2"
+        name=""
+        placement="none"
+        status="created"
+        value="%ipvalue%"/>
+    </pair>
+
+  </inConfigs>
+</configConfMos>
+
+<!--
+    ippooldn="org-root/org-vlan-123/org-VDC-vlan-123/objgrp-ccc"
+    ippoolname="ccc"
+    ipvalue="10.1.1.20"
+--!>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-nat-policy-ref.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-nat-policy-ref.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-nat-policy-ref.xml
new file mode 100755
index 0000000..450d40c
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-nat-policy-ref.xml
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+<configConfMos 
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+
+    <pair key="%natpolicyrefdn%" >
+      <policyPolicyNameRef
+        dn="%natpolicyrefdn%"
+        order="%order%"
+        policyName="%natpolicyname%"
+        status="created"/>
+    </pair>
+
+  </inConfigs>
+</configConfMos>
+
+<!--
+    natpolicyrefdn="org-root/org-TenantD/org-VDC-TenantD/natpset-TenantD-NAT-Policy-Set/polref-Source-NAT-Policy-TenantD"
+    natpolicyname="Source-NAT-Policy-TenantD"
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-nat-policy-set.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-nat-policy-set.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-nat-policy-set.xml
new file mode 100644
index 0000000..090caf1
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-nat-policy-set.xml
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+    <pair key="%natpolicysetdn%">
+      <natpolicyNatPolicySet
+        adminState="enabled"
+        descr="%descr%"
+        dn="%natpolicysetdn%"
+        name="%natpolicysetname%"
+        status="created"/>
+    </pair>
+  </inConfigs>
+</configConfMos>
+
+<!--
+    natpolicysetdn="org-root/org-TenantD/org-VDC-TenantD/natpset-TenantD-NAT-Policy-Set"
+    natpolicysetname="Source-NAT-Policy-Set-TenantD"
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-nat-policy.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-nat-policy.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-nat-policy.xml
new file mode 100755
index 0000000..0b556f4
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-nat-policy.xml
@@ -0,0 +1,33 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+
+    <pair key="%natpolicydn%">
+      <natpolicyNatRuleBasedPolicy
+        descr=""
+        dn="%natpolicydn%"
+        name="%natpolicyname%"
+        status="created"/>
+    </pair>
+
+  </inConfigs>
+</configConfMos>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-pf-rule.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-pf-rule.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-pf-rule.xml
new file mode 100755
index 0000000..a8a631f
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-pf-rule.xml
@@ -0,0 +1,166 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+
+    <pair key="%natruledn%">
+      <policyRule
+        descr="%descr%"
+        dn="%natruledn%"
+        name="%natrulename%"
+        order="%order%"
+        status="created"/>
+    </pair>
+
+    <pair key="%natruledn%/nat-action">
+      <natpolicyNatAction
+        actionType="static"
+        destTranslatedIpPool="%ippoolname%"
+        destTranslatedPortPool="%portpoolname%"
+        dn="%natruledn%/nat-action"
+        id="0"
+        isBidirectionalEnabled="yes"
+        isDnsEnabled="no"
+        isNoProxyArpEnabled="no"
+        isRoundRobinIpEnabled="no"
+        srcTranslatedIpPatPool=""
+        srcTranslatedIpPool=""
+        srcTranslatedPortPool=""
+        status="created"/>
+    </pair>
+
+    <pair key="%natruledn%/rule-cond-2">
+      <policyRuleCondition
+        dn="%natruledn%/rule-cond-2"
+        id="2"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%natruledn%/rule-cond-2/nw-expr2/nw-attr-qual">
+      <policyNwAttrQualifier
+        attrEp="destination"
+        dn="%natruledn%/rule-cond-2/nw-expr2/nw-attr-qual"
+        status="created"/>
+    </pair>
+    <pair key="%natruledn%/rule-cond-2/nw-expr2">
+      <policyNetworkExpression
+        dn="%natruledn%/rule-cond-2/nw-expr2"
+        id="2"
+        opr="eq"
+        status="created"/>
+    </pair>
+    <pair key="%natruledn%/rule-cond-2/nw-expr2/nw-ip-2">
+      <policyIPAddress
+        dataType="string"
+        descr=""
+        dn="%natruledn%/rule-cond-2/nw-expr2/nw-ip-2"
+        id="2"
+        name=""
+        placement="none"
+        status="created"
+        value="%ip%"/>
+    </pair>
+
+    <pair key="%natruledn%/rule-cond-3">
+      <policyRuleCondition
+        dn="%natruledn%/rule-cond-3"
+        id="3"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%natruledn%/rule-cond-3/nw-expr2/nw-attr-qual">
+      <policyNwAttrQualifier
+        attrEp="destination"
+        dn="%natruledn%/rule-cond-3/nw-expr2/nw-attr-qual"
+        status="created"/>
+    </pair>
+    <pair key="%natruledn%/rule-cond-3/nw-expr2">
+      <policyNetworkExpression
+        dn="%natruledn%/rule-cond-3/nw-expr2"
+        id="2"
+        opr="range"
+        status="created"/>
+    </pair>
+    <pair key="%natruledn%/rule-cond-3/nw-expr2/nw-port-2">
+      <policyNetworkPort
+        appType="Other"
+        dataType="string"
+        descr=""
+        dn="%natruledn%/rule-cond-3/nw-expr2/nw-port-2"
+        id="2"
+        name=""
+        placement="begin"
+        status="created"
+        value="%startport%"/>
+    </pair>
+    <pair key="%natruledn%/rule-cond-3/nw-expr2/nw-port-3">
+      <policyNetworkPort
+        appType="Other"
+        dataType="string"
+        descr=""
+        dn="%natruledn%/rule-cond-3/nw-expr2/nw-port-3"
+        id="3"
+        name=""
+        placement="end"
+        status="created"
+        value="%endport%"/>
+    </pair>
+
+    <pair key="%natruledn%/rule-cond-4">
+      <policyRuleCondition
+        dn="%natruledn%/rule-cond-4"
+        id="4"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%natruledn%/rule-cond-4/nw-expr2">
+      <policyNetworkExpression
+        dn="%natruledn%/rule-cond-4/nw-expr2"
+        id="2"
+        opr="eq"
+        status="created"/>
+    </pair>
+    <pair key="%natruledn%/rule-cond-4/nw-expr2/nw-protocol-2">
+      <policyProtocol
+        dataType="string"
+        descr=""
+        dn="%natruledn%/rule-cond-4/nw-expr2/nw-protocol-2"
+        id="2"
+        name=""
+        placement="none"
+        status="created"
+        value="%protocolvalue%"/>
+    </pair>
+
+  </inConfigs>
+</configConfMos>
+
+<!--
+    natruledn="org-root/org-vlan-123/org-VDC-vlan-123/natpol-aaa/rule-bbb"
+    natrulename="bbb"
+    descr=value
+    ippoolname="ccc"
+    portpoolname="ddd"
+    ip="10.147.30.230"
+    startport="22"
+    endport="22"
+    protocolvalue="TCP"
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-port-pool.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-port-pool.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-port-pool.xml
new file mode 100755
index 0000000..e1b7be0
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-port-pool.xml
@@ -0,0 +1,72 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+
+    <pair key="%portpooldn%">
+      <policyObjectGroup
+        descr="%descr%"
+        dn="%portpooldn%"
+        name="%portpoolname%"
+        status="created"/>
+    </pair>
+    <pair key="%portpooldn%/objgrp-expr-2">
+      <policyObjectGroupExpression
+        dn="%portpooldn%/objgrp-expr-2"
+        id="2"
+        opr="range"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%portpooldn%/objgrp-expr-2/nw-port-2">
+      <policyNetworkPort
+        appType="Other"
+        dataType="string"
+        descr=""
+        dn="%portpooldn%/objgrp-expr-2/nw-port-2"
+        id="2"
+        name=""
+        placement="begin"
+        status="created"
+        value="%startport%"/>
+    </pair>
+    <pair key="%portpooldn%/objgrp-expr-2/nw-port-3">
+      <policyNetworkPort
+        appType="Other"
+        dataType="string"
+        descr=""
+        dn="%portpooldn%/objgrp-expr-2/nw-port-3"
+        id="3"
+        name=""
+        placement="end"
+        status="created"
+        value="%endport%"/>
+    </pair>
+
+  </inConfigs>
+</configConfMos>
+
+<!--
+    portpooldn="org-root/org-vlan-123/org-VDC-vlan-123/objgrp-ddd"
+    portpoolname="ddd"
+    startport="22"
+    endport="22"
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-source-nat-pool.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-source-nat-pool.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-source-nat-pool.xml
new file mode 100644
index 0000000..2ad1e87
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-source-nat-pool.xml
@@ -0,0 +1,58 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+    <pair key="%snatpoolexprdn%" >
+      <policyObjectGroupExpression
+        dn="%snatpoolexprdn%" 
+        opr="eq"
+        order="unspecified"
+        status="created"/>
+    </pair>
+
+    <pair key="%publicipdn%" >
+      <policyIPAddress
+        dataType="string"
+        descr=""
+        dn="%publicipdn%"
+        name=""
+        placement="none"
+        status="created"
+        value="%publicip%"/>
+    </pair>
+
+    <pair key="%snatpooldn%">
+      <policyObjectGroup
+        descr="%descr%"
+        dn="%snatpooldn%"
+        name="%name%"
+        status="created"/>
+    </pair>
+
+  </inConfigs>
+</configConfMos>
+
+<!--
+    snatpoolexprdn="org-root/org-TestTenant3/org-Tenant3-VDC/objgrp-Source-NAT-Pool-For-Tenant3/objgrp-expr-2"
+    publicipdn="org-root/org-TestTenant3/org-Tenant3-VDC/objgrp-Source-NAT-Pool-For-Tenant3/objgrp-expr-2/nw-ip-2"
+    snatpooldn= "org-root/org-TestTenant3/org-Tenant3-VDC/objgrp-Source-NAT-Pool-For-Tenant3"
+    value="10.223.136.10"
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-source-nat-rule.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-source-nat-rule.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-source-nat-rule.xml
new file mode 100644
index 0000000..a3ee987
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-source-nat-rule.xml
@@ -0,0 +1,103 @@
+<!--
+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.
+-->
+<configConfMos 
+  cookie="%cookie%" 
+  inHierarchical="false">
+    <inConfigs>
+
+      <pair key="%natruledn%">
+        <policyRule
+          descr="%descr%"
+          dn="%natruledn%"
+          name="%natrulename%"
+          order="%order%"
+          status="created"/>
+      </pair>
+
+      <pair key="%natruledn%/nat-action">
+        <natpolicyNatAction
+          actionType="static"
+          destTranslatedIpPool=""
+          destTranslatedPortPool=""
+          dn="%natruledn%/nat-action"
+          id="0"
+          isBidirectionalEnabled="yes"
+          isDnsEnabled="yes"
+          isNoProxyArpEnabled="no"
+          isRoundRobinIpEnabled="no"
+          srcTranslatedIpPatPool=""
+          srcTranslatedIpPool="%ippoolname%"
+          srcTranslatedPortPool=""
+          status="created"/>
+      </pair>
+
+      <pair key="%natruledn%/rule-cond-2">
+        <policyRuleCondition
+          dn="%natruledn%/rule-cond-2"
+          id="2"
+          order="unspecified"
+          status="created"/>
+      </pair>
+      <pair key="%natruledn%/rule-cond-2/nw-expr2">
+        <policyNetworkExpression
+          dn="%natruledn%/rule-cond-2/nw-expr2" 
+          id="2"
+          opr="range"
+          status="created"/>
+      </pair>
+      <pair key="%natruledn%/rule-cond-2/nw-expr2/nw-attr-qual">
+        <policyNwAttrQualifier
+          attrEp="source"
+          dn="%natruledn%/rule-cond-2/nw-expr2/nw-attr-qual"
+          status="created"/>
+      </pair>
+      <pair key="%natruledn%/rule-cond-2/nw-expr2/nw-ip-2">
+        <policyIPAddress
+          dataType="string"
+          descr=""
+          dn="%natruledn%/rule-cond-2/nw-expr2/nw-ip-2"
+          id="2"
+          name=""
+          placement="begin"
+          status="created"
+          value="%srcstartip%"/>
+      </pair>
+      <pair key="%natruledn%/rule-cond-2/nw-expr2/nw-ip-3">
+        <policyIPAddress
+          dataType="string"
+          descr=""
+          dn="%natruledn%/rule-cond-2/nw-expr2/nw-ip-3"
+          id="3"
+          name=""
+          placement="end"
+          status="created"
+          value="%srcendip%"/>
+      </pair>
+
+    </inConfigs>
+</configConfMos>
+
+<!--
+    natruledn="org-root/org-TestTenant3/org-Tenant3-VDC/natpol-Source-NAT-For-Tenant3/rule-Source-NAT-Policy-Rule"
+    natrulename="Source-NAT-Policy-Rule"
+    descr="Source NAT Policy Rule for Tenant3"
+    ippoolname=value
+    srcstartip=value
+    srcendip=value
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-tenant.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-tenant.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-tenant.xml
new file mode 100644
index 0000000..085b7a2
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-tenant.xml
@@ -0,0 +1,29 @@
+<!--
+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.
+-->
+<configConfMo
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfig>
+    <orgTenant
+      descr="%descr%"
+      dn="%dn%"
+      name="%name%"
+      status="created"/>
+  </inConfig>
+</configConfMo>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-vdc.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-vdc.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-vdc.xml
new file mode 100644
index 0000000..4cb805e
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-vdc.xml
@@ -0,0 +1,30 @@
+<!--
+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.
+-->
+<configConfMo
+  dn=""
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfig>
+    <orgDatacenter
+      descr="%descr%"
+      dn="%dn%"
+      name="%name%"
+      status="created"/>
+  </inConfig>
+</configConfMo>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-acl-policy-set.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-acl-policy-set.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-acl-policy-set.xml
new file mode 100755
index 0000000..2c55786
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-acl-policy-set.xml
@@ -0,0 +1,30 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+    <pair key="%aclpolicysetdn%">
+      <policyPolicySet
+        dn="%aclpolicysetdn%"
+        name="%aclpolicysetname%"
+        status="deleted,modified"/>
+    </pair>
+  </inConfigs>
+</configConfMos>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-acl-policy.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-acl-policy.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-acl-policy.xml
new file mode 100755
index 0000000..b1a2765
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-acl-policy.xml
@@ -0,0 +1,33 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+    <inConfigs>
+
+      <pair key="%aclpolicydn%">
+        <policyRuleBasedPolicy
+          descr=""
+          dn="%aclpolicydn%"
+          name="%aclpolicyname%"
+          status="deleted,modified"/>
+      </pair>
+
+    </inConfigs>
+</configConfMos>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-edge-firewall.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-edge-firewall.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-edge-firewall.xml
new file mode 100755
index 0000000..992d6a1
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-edge-firewall.xml
@@ -0,0 +1,30 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+    <pair key="%edgefwdn%">
+      <fwEdgeFirewall
+        dn="%edgefwdn%"
+        name="%edgefwname%"
+        status="deleted"/>
+      </pair>
+  </inConfigs>
+</configConfMos>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-edge-security-profile.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-edge-security-profile.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-edge-security-profile.xml
new file mode 100755
index 0000000..f394fe9
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-edge-security-profile.xml
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+    <pair key="%espdn%">
+      <policyVirtualNetworkEdgeProfile
+        connTimeoutRef=""
+        dn="%espdn%"
+        egressAclPsetRef=""
+        ingressAclPsetRef=""
+        inspectRef=""
+        ipAuditRef=""
+        name="%name%"
+        natPsetRef=""
+        status="deleted,modified"
+        tcpInterceptRef=""
+        vpnRef=""/>
+    </pair>
+  </inConfigs>
+</configConfMos>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-nat-policy-set.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-nat-policy-set.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-nat-policy-set.xml
new file mode 100755
index 0000000..3f4c08d
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-nat-policy-set.xml
@@ -0,0 +1,30 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+    <pair key="%natpolicysetdn%">
+      <natpolicyNatPolicySet
+        dn="%natpolicysetdn%"
+        name="%natpolicysetname%"
+        status="deleted,modified"/>
+    </pair>
+  </inConfigs>
+</configConfMos>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-nat-policy.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-nat-policy.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-nat-policy.xml
new file mode 100755
index 0000000..6c3ed7b
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-nat-policy.xml
@@ -0,0 +1,33 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+    <inConfigs>
+
+      <pair key="%natpolicydn%">
+        <natpolicyNatRuleBasedPolicy
+          descr=""
+          dn="%natpolicydn%"
+          name="%natpolicyname%"
+          status="deleted,modified"/>
+      </pair>
+
+    </inConfigs>
+</configConfMos>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-rule.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-rule.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-rule.xml
new file mode 100755
index 0000000..e56e919
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-rule.xml
@@ -0,0 +1,31 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+    <pair key="%ruledn%">
+      <policyRule
+        descr=""
+        dn="%ruledn%"
+        name="%rulename%"
+        status="deleted"/>
+    </pair>
+  </inConfigs>
+</configConfMos>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-tenant.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-tenant.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-tenant.xml
new file mode 100755
index 0000000..05bef9a
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-tenant.xml
@@ -0,0 +1,30 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+    <pair key="%dn%">
+      <orgTenant
+        dn="%dn%"
+        name="%name%"
+        status="deleted,modified"/>
+    </pair>
+  </inConfigs>
+</configConfMos>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-vdc.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-vdc.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-vdc.xml
new file mode 100755
index 0000000..fbc2312
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/delete-vdc.xml
@@ -0,0 +1,30 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+  <pair key="%dn%">
+    <orgDatacenter
+      dn="%dn%"
+      name="%name%"
+      status="deleted,modified"/>
+    </pair>
+  </inConfigs>
+</configConfMos>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/disassoc-asa1000v.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/disassoc-asa1000v.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/disassoc-asa1000v.xml
new file mode 100755
index 0000000..448b65f
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/disassoc-asa1000v.xml
@@ -0,0 +1,30 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+    <pair key="%binddn%">
+      <fwResourceBinding
+        assignedToDn="%fwdn%"
+        dn="%binddn%"
+        status="deleted"/>
+      </pair>
+    </inConfigs>
+</configConfMos>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-acl-policies.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-acl-policies.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-acl-policies.xml
new file mode 100755
index 0000000..aec800e
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-acl-policies.xml
@@ -0,0 +1,31 @@
+<!--
+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.
+-->
+<orgResolveInScope
+  dn="%vdcdn%"
+  cookie="%cookie%"
+  inClass="policyRuleBasedPolicy"
+  inSingleLevel="false"
+  inHierarchical="false">
+  <inFilter>
+  </inFilter>
+</orgResolveInScope>
+
+<!--
+    vdcdn="org-root/org-vlan-123/org-VDC-vlan-123"
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-children.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-children.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-children.xml
new file mode 100755
index 0000000..f272999
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-children.xml
@@ -0,0 +1,27 @@
+<!--
+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.
+-->
+<configResolveChildren
+  cookie="%cookie%"
+  inDn="%dn%"
+  inHierarchical="true">
+  <inFilter>
+  </inFilter>
+</configResolveChildren>
+
+<!--dn="org-root/org-vlan-517/org-VDC-vlan-517/natpol-DNAT-vlan-517-10-147-30-235"--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-nat-policies.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-nat-policies.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-nat-policies.xml
new file mode 100755
index 0000000..720ced0
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-nat-policies.xml
@@ -0,0 +1,31 @@
+<!--
+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.
+-->
+<orgResolveInScope
+  dn="%vdcdn%"
+  cookie="%cookie%"
+  inClass="natpolicyNatRuleBasedPolicy"
+  inSingleLevel="false"
+  inHierarchical="false">
+  <inFilter>
+  </inFilter>
+</orgResolveInScope>
+
+<!--
+    vdcdn="org-root/org-vlan-123/org-VDC-vlan-123"
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-policyrefs-in-policyset.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-policyrefs-in-policyset.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-policyrefs-in-policyset.xml
new file mode 100755
index 0000000..c53af90
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-policyrefs-in-policyset.xml
@@ -0,0 +1,31 @@
+<!--
+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.
+-->
+<orgResolveInScope
+  dn="%vdcdn%"
+  cookie="%cookie%"
+  inClass="policyPolicyNameRef"
+  inSingleLevel="false"
+  inHierarchical="false">
+  <inFilter>
+  </inFilter>
+</orgResolveInScope>
+
+<!--
+    vdcdn="org-root/org-vlan-123/org-VDC-vlan-123"
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-tenants.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-tenants.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-tenants.xml
new file mode 100644
index 0000000..63ae848
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-tenants.xml
@@ -0,0 +1,26 @@
+<!--
+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.
+-->
+<configResolveChildren
+  cookie="%cookie%"
+  classId="orgTenant"
+  inDn="org-root"
+  inHierarchical="false">
+  <inFilter>
+  </inFilter>
+</configResolveChildren>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-unassigned-asa1000v.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-unassigned-asa1000v.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-unassigned-asa1000v.xml
new file mode 100644
index 0000000..539f330
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/list-unassigned-asa1000v.xml
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+<configResolveChildren
+  cookie="%cookie%"
+  classId="fwInstance"
+  inDn="fw"
+  inHierarchical="false">
+  <inFilter>
+    <and>
+      <eq class="fwInstance" property="capability" value="infra-fw"/>
+      <eq class="fwInstance" property="assoc" value="none"/>
+    </and>
+  </inFilter>
+</configResolveChildren>
+
+<!-- resource-mgr -->
+<!--
+<configResolveChildren cookie="1349366974/592be573-8a27-48d3-aab1-cf6cb94f23ab" commCookie="5/12/0/1cae" srcExtSys="10.223.56.5" destExtSys="10.223.56.5" srcSvc="sam_extXMLApi" destSvc="resource-mgr_dme" response="yes" classId="fwInstance">
+  <outConfigs>
+    <fwInstance assignedToDn="" assoc="none" capability="infra-fw" descr="" dn="fw/inst-1007" fltAggr="0" fsmDescr="" fsmPrev="DisassociateSuccess" fsmProgr="100" fsmRmtInvErrCode="none" fsmRmtInvErrDescr="" fsmRmtInvRslt="" fsmStageDescr="" fsmStamp="2012-10-04T16:07:40.110" fsmStatus="nop" fsmTry="0" intId="11818" mgmtIp="10.223.56.7" model="" name="ASA 1000V" pooled="0" registeredClientDn="extpol/reg/clients/client-1007" revision="0" serial="" svcId="1007" vendor=""/>
+  </outConfigs>
+</configResolveChildren>
+-->

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/login.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/login.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/login.xml
new file mode 100644
index 0000000..8e1c435
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/login.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="us-ascii"?>
+<!--
+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.
+-->
+<aaaLogin inName="%username%" inPassword="%password%" />

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/AssociateAsaWithLogicalEdgeFirewallCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/AssociateAsaWithLogicalEdgeFirewallCommand.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/AssociateAsaWithLogicalEdgeFirewallCommand.java
new file mode 100755
index 0000000..a438cbc
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/AssociateAsaWithLogicalEdgeFirewallCommand.java
@@ -0,0 +1,53 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+// 
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.agent.api;
+
+/**
+ * Associates an ASA 1000v appliance with logical edge firewall in VNMC
+ */
+public class AssociateAsaWithLogicalEdgeFirewallCommand extends Command {
+    private long _vlanId;
+    private String _asaMgmtIp;
+
+    public AssociateAsaWithLogicalEdgeFirewallCommand(long vlanId, String asaMgmtIp) {
+        super();
+        this._vlanId = vlanId;
+        this._asaMgmtIp = asaMgmtIp;
+    }
+
+    @Override
+    public boolean executeInSequence() {
+        return false;
+    }
+
+    public long getVlanId() {
+        return _vlanId;
+    }
+
+    public void setVlanId(long vlanId) {
+        this._vlanId = vlanId;
+    }
+
+    public String getAsaMgmtIp() {
+        return _asaMgmtIp;
+    }
+
+    public void setAsaMgmtIp(String asaMgmtIp) {
+        this._asaMgmtIp = asaMgmtIp;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/CleanupLogicalEdgeFirewallCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/CleanupLogicalEdgeFirewallCommand.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/CleanupLogicalEdgeFirewallCommand.java
new file mode 100755
index 0000000..c9f7f8c
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/CleanupLogicalEdgeFirewallCommand.java
@@ -0,0 +1,43 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+// 
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.agent.api;
+
+/**
+ * Command for cleaning up logical edge firewall in VNMC
+ */
+public class CleanupLogicalEdgeFirewallCommand extends Command {
+    private long _vlanId;
+
+    public CleanupLogicalEdgeFirewallCommand(long vlanId) {
+        super();
+        this._vlanId = vlanId;
+    }
+
+    @Override
+    public boolean executeInSequence() {
+        return false;
+    }
+
+    public long getVlanId() {
+        return _vlanId;
+    }
+
+    public void setVlanId(long vlanId) {
+        this._vlanId = vlanId;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/ConfigureNexusVsmForAsaCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/ConfigureNexusVsmForAsaCommand.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/ConfigureNexusVsmForAsaCommand.java
new file mode 100755
index 0000000..b20ad1f
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/ConfigureNexusVsmForAsaCommand.java
@@ -0,0 +1,95 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+// 
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.agent.api;
+
+/**
+ * Command for configuring n1kv VSM for asa1kv device. It does the following in VSM:
+ * a. creating vservice node for asa1kv
+ * b. updating vlan of inside port profile associated with asa1kv
+ */
+public class ConfigureNexusVsmForAsaCommand extends Command {
+    private long _vlanId;
+    private String _ipAddress;
+    private String _vsmUsername;
+    private String _vsmPassword;
+    private String _vsmIp;
+    private String _asaInPortProfile;
+
+    public ConfigureNexusVsmForAsaCommand(long vlanId, String ipAddress,
+            String vsmUsername, String vsmPassword, String vsmIp, String asaInPortProfile) {
+        super();
+        this._vlanId = vlanId;
+        this._ipAddress = ipAddress;
+        this._vsmUsername = vsmUsername;
+        this._vsmPassword = vsmPassword;
+        this._vsmIp = vsmIp;
+        this._asaInPortProfile = asaInPortProfile;
+    }
+
+    @Override
+    public boolean executeInSequence() {
+        return false;
+    }
+
+    public long getVlanId() {
+        return _vlanId;
+    }
+
+    public void setVlanId(long _vlanId) {
+        this._vlanId = _vlanId;
+    }
+
+    public String getIpAddress() {
+        return _ipAddress;
+    }
+
+    public void setIpAddress(String _ipAddress) {
+        this._ipAddress = _ipAddress;
+    }
+
+    public String getVsmUsername() {
+        return _vsmUsername;
+    }
+
+    public void setVsmUsername(String _vsmUsername) {
+        this._vsmUsername = _vsmUsername;
+    }
+
+    public String getVsmPassword() {
+        return _vsmPassword;
+    }
+
+    public void setVsmPassword(String _vsmPassword) {
+        this._vsmPassword = _vsmPassword;
+    }
+
+    public String getVsmIp() {
+        return _vsmIp;
+    }
+
+    public void setVsmIp(String _vsmIp) {
+        this._vsmIp = _vsmIp;
+    }
+
+    public String getAsaInPortProfile() {
+        return _asaInPortProfile;
+    }
+
+    public void setAsaInPortProfile(String _asaInPortProfile) {
+        this._asaInPortProfile = _asaInPortProfile;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/CreateLogicalEdgeFirewallCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/CreateLogicalEdgeFirewallCommand.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/CreateLogicalEdgeFirewallCommand.java
new file mode 100755
index 0000000..def8225
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/CreateLogicalEdgeFirewallCommand.java
@@ -0,0 +1,94 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+// 
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.agent.api;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Command for creating a logical edge firewall in VNMC
+ */
+public class CreateLogicalEdgeFirewallCommand extends Command {
+    private long _vlanId;
+    private String _publicIp;
+    private String _internalIp;
+    private String _publicSubnet;
+    private String _internalSubnet;
+    private List<String> _publicGateways;
+
+    public CreateLogicalEdgeFirewallCommand(long vlanId,
+            String publicIp, String internalIp,
+            String publicSubnet, String internalSubnet) {
+        super();
+        this._vlanId = vlanId;
+        this._publicIp = publicIp;
+        this._internalIp = internalIp;
+        this._publicSubnet = publicSubnet;
+        this.setInternalSubnet(internalSubnet);
+        _publicGateways = new ArrayList<String>();
+    }
+
+    @Override
+    public boolean executeInSequence() {
+        return false;
+    }
+
+    public long getVlanId() {
+        return _vlanId;
+    }
+
+    public void setVlanId(long vlanId) {
+        this._vlanId = vlanId;
+    }
+
+    public String getPublicIp() {
+        return _publicIp;
+    }
+
+    public void setPublicIp(String publicIp) {
+        this._publicIp = publicIp;
+    }
+
+    public String getInternalIp() {
+        return _internalIp;
+    }
+
+    public void setInternalIp(String internalIp) {
+        this._internalIp = internalIp;
+    }
+
+    public String getPublicSubnet() {
+        return _publicSubnet;
+    }
+
+    public void setPublicSubnet(String publicSubnet) {
+        this._publicSubnet = publicSubnet;
+    }
+
+    public String getInternalSubnet() {
+        return _internalSubnet;
+    }
+
+    public void setInternalSubnet(String _internalSubnet) {
+        this._internalSubnet = _internalSubnet;
+    }
+
+    public List<String> getPublicGateways() {
+        return _publicGateways;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/AddCiscoAsa1000vResourceCmd.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/AddCiscoAsa1000vResourceCmd.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/AddCiscoAsa1000vResourceCmd.java
new file mode 100755
index 0000000..c880199
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/commands/AddCiscoAsa1000vResourceCmd.java
@@ -0,0 +1,116 @@
+// 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.api.commands;
+
+import javax.inject.Inject;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.ClusterResponse;
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
+import org.apache.log4j.Logger;
+
+import com.cloud.api.response.CiscoAsa1000vResourceResponse;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.cisco.CiscoAsa1000vDevice;
+import com.cloud.network.element.CiscoAsa1000vService;
+import com.cloud.user.UserContext;
+import com.cloud.utils.exception.CloudRuntimeException;
+
+@APICommand(name="addCiscoAsa1000vResource", responseObject=CiscoAsa1000vResourceResponse.class, description="Adds a Cisco Asa 1000v appliance")
+public class AddCiscoAsa1000vResourceCmd extends BaseCmd {
+    private static final Logger s_logger = Logger.getLogger(AddCiscoAsa1000vResourceCmd.class.getName());
+    private static final String s_name = "addCiscoAsa1000vResource";
+    @Inject CiscoAsa1000vService _ciscoAsa1000vService;
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.UUID, entityType = PhysicalNetworkResponse.class, required=true, description="the Physical Network ID")
+    private Long physicalNetworkId;
+
+    @Parameter(name=ApiConstants.HOST_NAME, type=CommandType.STRING, required = true, description="Hostname or ip address of the Cisco ASA 1000v appliance.")
+    private String host;
+
+    @Parameter(name=ApiConstants.ASA_INSIDE_PORT_PROFILE, type=CommandType.STRING, required = true, description="Nexus port profile associated with inside interface of ASA 1000v")
+    private String inPortProfile;
+
+    @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.UUID, entityType = ClusterResponse.class, required=true, description="the Cluster ID")
+    private Long clusterId;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getPhysicalNetworkId() {
+        return physicalNetworkId;
+    }
+
+    public String getManagementIp() {
+        return host;
+    }
+
+    public String getInPortProfile() {
+        return inPortProfile;
+    }
+
+    public Long getClusterId() {
+        return clusterId;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    @Override
+    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
+        try {
+            CiscoAsa1000vDevice ciscoAsa1000v = _ciscoAsa1000vService.addCiscoAsa1000vResource(this);
+            if (ciscoAsa1000v != null) {
+                CiscoAsa1000vResourceResponse response = _ciscoAsa1000vService.createCiscoAsa1000vResourceResponse(ciscoAsa1000v);
+                response.setObjectName("CiscoAsa1000vResource");
+                response.setResponseName(getCommandName());
+                this.setResponseObject(response);
+            } else {
+                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to add Cisco ASA 1000v appliance due to internal error.");
+            }
+        }  catch (InvalidParameterValueException invalidParamExcp) {
+            throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage());
+        } catch (CloudRuntimeException runtimeExcp) {
+            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage());
+        }
+    }
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public long getEntityOwnerId() {
+        return UserContext.current().getCaller().getId();
+    }
+}


[10/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
CLOUDSTACK-574: Add Ceph RBD documentation

This commit also add some extra information about NFS and iSCSI
Primary Storage on a KVM hypervisor.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ed2aa9f9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ed2aa9f9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ed2aa9f9

Branch: refs/heads/ui-vm-affinity
Commit: ed2aa9f9da2afcb6c28eff1ebbf79baa5a2e25dd
Parents: c5b10a7
Author: Wido den Hollander <wi...@42on.com>
Authored: Sat Apr 13 11:13:26 2013 +0200
Committer: Wido den Hollander <wi...@42on.com>
Committed: Sat Apr 13 11:13:26 2013 +0200

----------------------------------------------------------------------
 docs/en-US/hypervisor-kvm-install-flow.xml |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed2aa9f9/docs/en-US/hypervisor-kvm-install-flow.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/hypervisor-kvm-install-flow.xml b/docs/en-US/hypervisor-kvm-install-flow.xml
index 6cc73e4..7dfd47d 100644
--- a/docs/en-US/hypervisor-kvm-install-flow.xml
+++ b/docs/en-US/hypervisor-kvm-install-flow.xml
@@ -34,4 +34,5 @@
     <xi:include href="hypervisor-host-install-network-openvswitch.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
     <xi:include href="hypervisor-host-install-firewall.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
     <xi:include href="hypervisor-host-install-finish.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+    <xi:include href="hypervisor-host-install-primary-storage.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
 </section>


[05/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
QuickCloud: accidental commit, removing


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7b4e1953
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7b4e1953
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7b4e1953

Branch: refs/heads/ui-vm-affinity
Commit: 7b4e1953d87555d432386ea34aebd15bce257f16
Parents: 45f852b
Author: Chiradeep Vittal <ch...@apache.org>
Authored: Fri Apr 12 12:08:01 2013 -0700
Committer: Chiradeep Vittal <ch...@apache.org>
Committed: Fri Apr 12 12:08:13 2013 -0700

----------------------------------------------------------------------
 .../AgentBasedConsoleProxyManager.java.orig        |  298 ---------------
 1 files changed, 0 insertions(+), 298 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7b4e1953/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java.orig
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java.orig b/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java.orig
deleted file mode 100755
index 134d59d..0000000
--- a/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java.orig
+++ /dev/null
@@ -1,298 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-// 
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.consoleproxy;
-
-import java.util.Map;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.AgentManager;
-import com.cloud.agent.api.GetVncPortAnswer;
-import com.cloud.agent.api.GetVncPortCommand;
-import com.cloud.agent.api.StartupProxyCommand;
-import com.cloud.configuration.dao.ConfigurationDao;
-import com.cloud.host.HostVO;
-import com.cloud.host.dao.HostDao;
-import com.cloud.info.ConsoleProxyInfo;
-import com.cloud.keystore.KeystoreManager;
-import com.cloud.utils.NumbersUtil;
-import com.cloud.utils.component.ManagerBase;
-import com.cloud.vm.ConsoleProxyVO;
-import com.cloud.vm.UserVmVO;
-import com.cloud.vm.VMInstanceVO;
-import com.cloud.vm.VirtualMachineManager;
-import com.cloud.vm.dao.ConsoleProxyDao;
-import com.cloud.vm.dao.UserVmDao;
-import com.cloud.vm.dao.VMInstanceDao;
-
-@Local(value = { ConsoleProxyManager.class })
-public class AgentBasedConsoleProxyManager extends ManagerBase implements ConsoleProxyManager {
-    private static final Logger s_logger = Logger.getLogger(AgentBasedConsoleProxyManager.class);
-
-    @Inject
-    protected HostDao _hostDao;
-    @Inject
-    protected UserVmDao _userVmDao;
-    private String _instance;
-    protected String _consoleProxyUrlDomain;
-    @Inject
-    private VMInstanceDao _instanceDao;
-    private ConsoleProxyListener _listener;
-    protected int _consoleProxyUrlPort = ConsoleProxyManager.DEFAULT_PROXY_URL_PORT;
-    protected int _consoleProxyPort = ConsoleProxyManager.DEFAULT_PROXY_VNC_PORT;
-    protected boolean _sslEnabled = false;
-    @Inject
-    AgentManager _agentMgr;
-    @Inject
-    VirtualMachineManager _itMgr;
-    @Inject
-    protected ConsoleProxyDao _cpDao;
-    @Inject
-    protected KeystoreManager _ksMgr;
-
-    @Inject ConfigurationDao _configDao;
-
-    public class AgentBasedAgentHook extends AgentHookBase {
-
-        public AgentBasedAgentHook(VMInstanceDao instanceDao, HostDao hostDao, ConfigurationDao cfgDao,
-                KeystoreManager ksMgr, AgentManager agentMgr) {
-            super(instanceDao, hostDao, cfgDao, ksMgr, agentMgr);
-        }
-
-        @Override
-        protected HostVO findConsoleProxyHost(StartupProxyCommand cmd) {
-            return _hostDao.findByGuid(cmd.getGuid());
-        }
-
-    }
-
-    public int getVncPort(VMInstanceVO vm) {
-        if (vm.getHostId() == null) {
-            return -1;
-        }
-        GetVncPortAnswer answer = (GetVncPortAnswer) _agentMgr.easySend(vm.getHostId(), new GetVncPortCommand(vm.getId(), vm.getHostName()));
-        return (answer == null || !answer.getResult()) ? -1 : answer.getPort();
-    }
-
-    @Override
-    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-
-        if (s_logger.isInfoEnabled()) {
-            s_logger.info("Start configuring AgentBasedConsoleProxyManager");
-        }
-
-        Map<String, String> configs = _configDao.getConfiguration("management-server", params);
-        String value = configs.get("consoleproxy.url.port");
-        if (value != null) {
-            _consoleProxyUrlPort = NumbersUtil.parseInt(value, ConsoleProxyManager.DEFAULT_PROXY_URL_PORT);
-        }
-
-        value = configs.get("consoleproxy.port");
-        if (value != null) {
-            _consoleProxyPort = NumbersUtil.parseInt(value, ConsoleProxyManager.DEFAULT_PROXY_VNC_PORT);
-        }
-
-        value = configs.get("consoleproxy.sslEnabled");
-        if (value != null && value.equalsIgnoreCase("true")) {
-            _sslEnabled = true;
-        }
-
-        _instance = configs.get("instance.name");
-
-        _consoleProxyUrlDomain = configs.get("consoleproxy.url.domain");
-
-        _listener =
-                new ConsoleProxyListener(new AgentBasedAgentHook(_instanceDao, _hostDao, _configDao, _ksMgr, _agentMgr));
-        _agentMgr.registerForHostEvents(_listener, true, true, false);
-
-        if (s_logger.isInfoEnabled()) {
-            s_logger.info("AgentBasedConsoleProxyManager has been configured. SSL enabled: " + _sslEnabled);
-        }
-        return true;
-    }
-
-    HostVO findHost(VMInstanceVO vm) {
-        return _hostDao.findById(vm.getHostId());
-    }
-
-    @Override
-    public ConsoleProxyInfo assignProxy(long dataCenterId, long userVmId) {
-        UserVmVO userVm = _userVmDao.findById(userVmId);
-        if (userVm == null) {
-            s_logger.warn("User VM " + userVmId + " no longer exists, return a null proxy for user vm:" + userVmId);
-            return null;
-        }
-
-        HostVO host = findHost(userVm);
-        if (host != null) {
-            if (s_logger.isDebugEnabled()) {
-                s_logger.debug("Assign embedded console proxy running at " + host.getName() + " to user vm " + userVmId + " with public IP "
-                        + host.getPublicIpAddress());
-            }
-
-            // only private IP, public IP, host id have meaningful values, rest
-            // of all are place-holder values
-            String publicIp = host.getPublicIpAddress();
-            if (publicIp == null) {
-                if (s_logger.isDebugEnabled()) {
-                    s_logger.debug("Host " + host.getName() + "/" + host.getPrivateIpAddress()
-                            + " does not have public interface, we will return its private IP for cosole proxy.");
-                }
-                publicIp = host.getPrivateIpAddress();
-            }
-
-            int urlPort = _consoleProxyUrlPort;
-
-            if (host.getProxyPort() != null && host.getProxyPort().intValue() > 0) {
-                urlPort = host.getProxyPort().intValue();
-            }
-
-            return new ConsoleProxyInfo(_sslEnabled, publicIp, _consoleProxyPort, urlPort, _consoleProxyUrlDomain);
-        } else {
-            s_logger.warn("Host that VM is running is no longer available, console access to VM " + userVmId + " will be temporarily unavailable.");
-        }
-        return null;
-    }
-
-
-
-
-    @Override
-    public ConsoleProxyVO startProxy(long proxyVmId) {
-        return null;
-    }
-
-    @Override
-    public boolean destroyProxy(long proxyVmId) {
-        return false;
-    }
-
-    @Override
-    public boolean rebootProxy(long proxyVmId) {
-        return false;
-    }
-
-    @Override
-    public boolean stopProxy(long proxyVmId) {
-        return false;
-    }
-
-    @Override
-    public void setManagementState(ConsoleProxyManagementState state) {
-    }
-
-    @Override
-    public ConsoleProxyManagementState getManagementState() {
-        return null;
-    }
-
-    @Override
-    public void resumeLastManagementState() {
-    }
-
-    @Override
-    public String getName() {
-        return _name;
-    }
-<<<<<<< HEAD
-
-    @Override
-    public Long convertToId(String vmName) {
-        if (!VirtualMachineName.isValidConsoleProxyName(vmName, _instance)) {
-            return null;
-        }
-        return VirtualMachineName.getConsoleProxyId(vmName);
-    }
-
-    @Override
-    public ConsoleProxyVO findByName(String name) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public ConsoleProxyVO findById(long id) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public ConsoleProxyVO persist(ConsoleProxyVO vm) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public boolean finalizeVirtualMachineProfile(VirtualMachineProfile<ConsoleProxyVO> profile, DeployDestination dest, ReservationContext context) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean finalizeDeployment(Commands cmds, VirtualMachineProfile<ConsoleProxyVO> profile, DeployDestination dest, ReservationContext context) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile<ConsoleProxyVO> profile) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean finalizeStart(VirtualMachineProfile<ConsoleProxyVO> profile, long hostId, Commands cmds, ReservationContext context) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public void finalizeStop(VirtualMachineProfile<ConsoleProxyVO> profile, StopAnswer answer) {
-        // TODO Auto-generated method stub
-    }
-
-    @Override 
-    public void finalizeExpunge(ConsoleProxyVO proxy) {
-    }
-
-    @Override
-    public boolean plugNic(Network network, NicTO nic, VirtualMachineTO vm,
-            ReservationContext context, DeployDestination dest) throws ConcurrentOperationException, ResourceUnavailableException,
-            InsufficientCapacityException {
-        //not supported
-        throw new UnsupportedOperationException("Plug nic is not supported for vm of type " + vm.getType());
-    }
-
-
-    @Override
-    public boolean unplugNic(Network network, NicTO nic, VirtualMachineTO vm,
-            ReservationContext context, DeployDestination dest) throws ConcurrentOperationException, ResourceUnavailableException {
-        //not supported
-        throw new UnsupportedOperationException("Unplug nic is not supported for vm of type " + vm.getType());
-    }
-
-    @Override
-    public void prepareStop(VirtualMachineProfile<ConsoleProxyVO> profile) {
-    }
-}
-=======
-}
->>>>>>> QuickCloud: refactor to avoid copy paste of authentication and startup code


[23/33] Squashed commit of the following:

Posted by bf...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java b/plugins/network-elements/cisco-vnmc/src/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java
new file mode 100644
index 0000000..52f0ea6
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java
@@ -0,0 +1,232 @@
+/*
+ * $HeadURL$
+ * $Revision$
+ * $Date$
+ * 
+ * ====================================================================
+ *
+ *  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.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.commons.httpclient.contrib.ssl;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.net.SocketAddress;
+import java.net.UnknownHostException;
+
+import javax.net.SocketFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+
+import org.apache.commons.httpclient.ConnectTimeoutException;
+import org.apache.commons.httpclient.HttpClientError;
+import org.apache.commons.httpclient.params.HttpConnectionParams;
+import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * <p>
+ * EasySSLProtocolSocketFactory can be used to creats SSL {@link Socket}s 
+ * that accept self-signed certificates. 
+ * </p>
+ * <p>
+ * This socket factory SHOULD NOT be used for productive systems 
+ * due to security reasons, unless it is a concious decision and 
+ * you are perfectly aware of security implications of accepting 
+ * self-signed certificates
+ * </p>
+ *
+ * <p>
+ * Example of using custom protocol socket factory for a specific host:
+ *     <pre>
+ *     Protocol easyhttps = new Protocol("https", new EasySSLProtocolSocketFactory(), 443);
+ *
+ *     URI uri = new URI("https://localhost/", true);
+ *     // use relative url only
+ *     GetMethod httpget = new GetMethod(uri.getPathQuery());
+ *     HostConfiguration hc = new HostConfiguration();
+ *     hc.setHost(uri.getHost(), uri.getPort(), easyhttps);
+ *     HttpClient client = new HttpClient();
+ *     client.executeMethod(hc, httpget);
+ *     </pre>
+ * </p>
+ * <p>
+ * Example of using custom protocol socket factory per default instead of the standard one:
+ *     <pre>
+ *     Protocol easyhttps = new Protocol("https", new EasySSLProtocolSocketFactory(), 443);
+ *     Protocol.registerProtocol("https", easyhttps);
+ *
+ *     HttpClient client = new HttpClient();
+ *     GetMethod httpget = new GetMethod("https://localhost/");
+ *     client.executeMethod(httpget);
+ *     </pre>
+ * </p>
+ * 
+ * @author <a href="mailto:oleg -at- ural.ru">Oleg Kalnichevski</a>
+ * 
+ * <p>
+ * DISCLAIMER: HttpClient developers DO NOT actively support this component.
+ * The component is provided as a reference material, which may be inappropriate
+ * for use without additional customization.
+ * </p>
+ */
+
+public class EasySSLProtocolSocketFactory implements SecureProtocolSocketFactory {
+
+    /** Log object for this class. */
+    private static final Log LOG = LogFactory.getLog(EasySSLProtocolSocketFactory.class);
+
+    private SSLContext sslcontext = null;
+
+    /**
+     * Constructor for EasySSLProtocolSocketFactory.
+     */
+    public EasySSLProtocolSocketFactory() {
+        super();
+    }
+
+    private static SSLContext createEasySSLContext() {
+        try {
+            SSLContext context = SSLContext.getInstance("SSL");
+            context.init(
+              null, 
+              new TrustManager[] {new EasyX509TrustManager(null)}, 
+              null);
+            return context;
+        } catch (Exception e) {
+            LOG.error(e.getMessage(), e);
+            throw new HttpClientError(e.toString());
+        }
+    }
+
+    private SSLContext getSSLContext() {
+        if (this.sslcontext == null) {
+            this.sslcontext = createEasySSLContext();
+        }
+        return this.sslcontext;
+    }
+
+    /**
+     * @see SecureProtocolSocketFactory#createSocket(java.lang.String,int,java.net.InetAddress,int)
+     */
+    public Socket createSocket(
+        String host,
+        int port,
+        InetAddress clientHost,
+        int clientPort)
+        throws IOException, UnknownHostException {
+
+        return getSSLContext().getSocketFactory().createSocket(
+            host,
+            port,
+            clientHost,
+            clientPort
+        );
+    }
+
+    /**
+     * Attempts to get a new socket connection to the given host within the given time limit.
+     * <p>
+     * To circumvent the limitations of older JREs that do not support connect timeout a 
+     * controller thread is executed. The controller thread attempts to create a new socket 
+     * within the given limit of time. If socket constructor does not return until the 
+     * timeout expires, the controller terminates and throws an {@link ConnectTimeoutException}
+     * </p>
+     *  
+     * @param host the host name/IP
+     * @param port the port on the host
+     * @param clientHost the local host name/IP to bind the socket to
+     * @param clientPort the port on the local machine
+     * @param params {@link HttpConnectionParams Http connection parameters}
+     * 
+     * @return Socket a new socket
+     * 
+     * @throws IOException if an I/O error occurs while creating the socket
+     * @throws UnknownHostException if the IP address of the host cannot be
+     * determined
+     */
+    public Socket createSocket(
+        final String host,
+        final int port,
+        final InetAddress localAddress,
+        final int localPort,
+        final HttpConnectionParams params
+    ) throws IOException, UnknownHostException, ConnectTimeoutException {
+        if (params == null) {
+            throw new IllegalArgumentException("Parameters may not be null");
+        }
+        int timeout = params.getConnectionTimeout();
+        SocketFactory socketfactory = getSSLContext().getSocketFactory();
+        if (timeout == 0) {
+            return socketfactory.createSocket(host, port, localAddress, localPort);
+        } else {
+            Socket socket = socketfactory.createSocket();
+            SocketAddress localaddr = new InetSocketAddress(localAddress, localPort);
+            SocketAddress remoteaddr = new InetSocketAddress(host, port);
+            socket.bind(localaddr);
+            socket.connect(remoteaddr, timeout);
+            return socket;
+        }
+    }
+
+    /**
+     * @see SecureProtocolSocketFactory#createSocket(java.lang.String,int)
+     */
+    public Socket createSocket(String host, int port)
+        throws IOException, UnknownHostException {
+        return getSSLContext().getSocketFactory().createSocket(
+            host,
+            port
+        );
+    }
+
+    /**
+     * @see SecureProtocolSocketFactory#createSocket(java.net.Socket,java.lang.String,int,boolean)
+     */
+    public Socket createSocket(
+        Socket socket,
+        String host,
+        int port,
+        boolean autoClose)
+        throws IOException, UnknownHostException {
+        return getSSLContext().getSocketFactory().createSocket(
+            socket,
+            host,
+            port,
+            autoClose
+        );
+    }
+
+    public boolean equals(Object obj) {
+        return ((obj != null) && obj.getClass().equals(EasySSLProtocolSocketFactory.class));
+    }
+
+    public int hashCode() {
+        return EasySSLProtocolSocketFactory.class.hashCode();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/org/apache/commons/httpclient/contrib/ssl/EasyX509TrustManager.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/org/apache/commons/httpclient/contrib/ssl/EasyX509TrustManager.java b/plugins/network-elements/cisco-vnmc/src/org/apache/commons/httpclient/contrib/ssl/EasyX509TrustManager.java
new file mode 100644
index 0000000..ae9f938
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/org/apache/commons/httpclient/contrib/ssl/EasyX509TrustManager.java
@@ -0,0 +1,114 @@
+/*
+ * ====================================================================
+ *
+ *  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.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.commons.httpclient.contrib.ssl;
+
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.TrustManagerFactory;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import org.apache.commons.logging.Log; 
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * <p>
+ * EasyX509TrustManager unlike default {@link X509TrustManager} accepts 
+ * self-signed certificates. 
+ * </p>
+ * <p>
+ * This trust manager SHOULD NOT be used for productive systems 
+ * due to security reasons, unless it is a concious decision and 
+ * you are perfectly aware of security implications of accepting 
+ * self-signed certificates
+ * </p>
+ * 
+ * @author <a href="mailto:adrian.sutton@ephox.com">Adrian Sutton</a>
+ * @author <a href="mailto:oleg@ural.ru">Oleg Kalnichevski</a>
+ * 
+ * <p>
+ * DISCLAIMER: HttpClient developers DO NOT actively support this component.
+ * The component is provided as a reference material, which may be inappropriate
+ * for use without additional customization.
+ * </p>
+ */
+
+public class EasyX509TrustManager implements X509TrustManager
+{
+    private X509TrustManager standardTrustManager = null;
+
+    /** Log object for this class. */
+    private static final Log LOG = LogFactory.getLog(EasyX509TrustManager.class);
+
+    /**
+     * Constructor for EasyX509TrustManager.
+     */
+    public EasyX509TrustManager(KeyStore keystore) throws NoSuchAlgorithmException, KeyStoreException {
+        super();
+        TrustManagerFactory factory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+        factory.init(keystore);
+        TrustManager[] trustmanagers = factory.getTrustManagers();
+        if (trustmanagers.length == 0) {
+            throw new NoSuchAlgorithmException("no trust manager found");
+        }
+        this.standardTrustManager = (X509TrustManager)trustmanagers[0];
+    }
+
+    /**
+     * @see javax.net.ssl.X509TrustManager#checkClientTrusted(X509Certificate[],String authType)
+     */
+    public void checkClientTrusted(X509Certificate[] certificates,String authType) throws CertificateException {
+        standardTrustManager.checkClientTrusted(certificates,authType);
+    }
+
+    /**
+     * @see javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[],String authType)
+     */
+    public void checkServerTrusted(X509Certificate[] certificates,String authType) throws CertificateException {
+        if ((certificates != null) && LOG.isDebugEnabled()) {
+            LOG.debug("Server certificate chain:");
+            for (int i = 0; i < certificates.length; i++) {
+                LOG.debug("X509Certificate[" + i + "]=" + certificates[i]);
+            }
+        }
+        if ((certificates != null) && (certificates.length == 1)) {
+            certificates[0].checkValidity();
+        } else {
+            standardTrustManager.checkServerTrusted(certificates,authType);
+        }
+    }
+
+    /**
+     * @see javax.net.ssl.X509TrustManager#getAcceptedIssuers()
+     */
+    public X509Certificate[] getAcceptedIssuers() {
+        return this.standardTrustManager.getAcceptedIssuers();
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/test/com/cloud/network/cisco/CiscoVnmcConnectionTest.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/test/com/cloud/network/cisco/CiscoVnmcConnectionTest.java b/plugins/network-elements/cisco-vnmc/test/com/cloud/network/cisco/CiscoVnmcConnectionTest.java
new file mode 100644
index 0000000..bf52356
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/test/com/cloud/network/cisco/CiscoVnmcConnectionTest.java
@@ -0,0 +1,248 @@
+// 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.cisco;
+
+import static org.junit.Assert.assertTrue;
+
+import java.util.Map;
+
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import com.cloud.network.cisco.CiscoVnmcConnectionImpl;
+import com.cloud.utils.exception.ExecutionException;
+
+
+@Ignore("Requires actual VNMC to connect to")
+public class CiscoVnmcConnectionTest {
+    static CiscoVnmcConnectionImpl connection;
+    static String tenantName = "TenantE";
+    static Map<String, String> fwDns = null;
+
+    @BeforeClass
+    public static void setUpClass() throws Exception {
+        connection = new CiscoVnmcConnectionImpl("10.223.56.5", "admin", "C1sco123");
+        try {
+            boolean response = connection.login();
+            assertTrue(response);
+        } catch (ExecutionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    
+    @Test
+    public void testLogin() {
+        //fail("Not yet implemented");
+        try {
+            boolean response = connection.login();
+            assertTrue(response);
+        } catch (ExecutionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    
+    @Test
+    public void testCreateTenant() {
+        //fail("Not yet implemented");
+        try {
+            boolean response = connection.createTenant(tenantName);
+            assertTrue(response);
+        } catch (ExecutionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void testCreateTenantVDC() {
+        //fail("Not yet implemented");
+        try {
+            boolean response = connection.createTenantVDC(tenantName);
+            assertTrue(response);
+        } catch (ExecutionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void testCreateTenantVDCEdgeDeviceProfile() {
+        //fail("Not yet implemented");
+        try {
+            boolean response = connection.createTenantVDCEdgeDeviceProfile(tenantName);
+            assertTrue(response);
+        } catch (ExecutionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void testCreateTenantVDCEdgeDeviceRoutePolicy() {
+        try {
+            boolean response = connection.createTenantVDCEdgeStaticRoutePolicy(tenantName);
+            assertTrue(response);
+        } catch (ExecutionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void testCreateTenantVDCEdgeDeviceRoute() {
+        try {
+            boolean response = connection.createTenantVDCEdgeStaticRoute(tenantName,
+                    "10.223.136.1", "0.0.0.0", "0.0.0.0");
+            assertTrue(response);
+        } catch (ExecutionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void testAssociateRoutePolicyWithEdgeProfile() {
+        try {
+            boolean response = connection.associateTenantVDCEdgeStaticRoutePolicy(tenantName);
+            assertTrue(response);
+        } catch (ExecutionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void testAssociateTenantVDCEdgeDhcpPolicy() {
+        try {
+            boolean response = connection.associateTenantVDCEdgeDhcpPolicy(tenantName, "Edge_Inside");
+            assertTrue(response);
+        } catch (ExecutionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void testCreateTenantVDCEdgeDhcpPolicy() {
+        try {
+            boolean response = connection.createTenantVDCEdgeDhcpPolicy(tenantName,
+                    "10.1.1.2", "10.1.1.254", "255.255.255.0","4.4.4.4", tenantName+ ".net");
+            assertTrue(response);
+        } catch (ExecutionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void testCreateTenantVDCEdgeSecurityProfile() {
+        try {
+            boolean response = connection.createTenantVDCEdgeSecurityProfile(tenantName);
+            assertTrue(response);
+        } catch (ExecutionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void testCreateTenantVDCSourceNatIpPool() {
+        try {
+            boolean response = connection.createTenantVDCSourceNatIpPool(tenantName, "1", "10.223.136.10");
+            assertTrue(response);
+        } catch (ExecutionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void testCreateTenantVDCSourceNatPolicy() {
+        try {
+            boolean response = connection.createTenantVDCSourceNatPolicy(tenantName, "1");
+            assertTrue(response);
+            response = connection.createTenantVDCSourceNatPolicyRef(tenantName, "1");
+            assertTrue(response);
+            response = connection.createTenantVDCSourceNatRule(tenantName, "1", "10.1.1.2", "10.1.1.254");
+            assertTrue(response);
+        } catch (ExecutionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void testCreateTenantVDCNatPolicySet() {
+        try {
+            boolean response = connection.createTenantVDCNatPolicySet(tenantName);
+            assertTrue(response);
+        } catch (ExecutionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void testAssociateNatPolicySet() {
+        try {
+            boolean response = connection.associateNatPolicySet(tenantName);
+            assertTrue(response);
+        } catch (ExecutionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void testCreateEdgeFirewall() {
+        try {
+            boolean response = connection.createEdgeFirewall(tenantName,
+                    "44.44.44.44", "192.168.1.1", "255.255.255.0", "255.255.255.192");
+            assertTrue(response);
+        } catch (ExecutionException e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void testListUnassocAsa1000v() {
+        try {
+            Map<String, String> response = connection.listUnAssocAsa1000v();
+            assertTrue(response.size() >=0);
+            fwDns = response;
+        } catch (ExecutionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void assocAsa1000v() {
+        try {
+            boolean result = connection.assignAsa1000v(tenantName, fwDns.get(0));
+            assertTrue(result);
+        } catch (ExecutionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/test/com/cloud/network/element/CiscoVnmcElementTest.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/test/com/cloud/network/element/CiscoVnmcElementTest.java b/plugins/network-elements/cisco-vnmc/test/com/cloud/network/element/CiscoVnmcElementTest.java
new file mode 100755
index 0000000..a16733b
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/test/com/cloud/network/element/CiscoVnmcElementTest.java
@@ -0,0 +1,401 @@
+// 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.element;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.naming.ConfigurationException;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.internal.matchers.Any;
+
+import com.cloud.agent.AgentManager;
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.AssociateAsaWithLogicalEdgeFirewallCommand;
+import com.cloud.agent.api.CleanupLogicalEdgeFirewallCommand;
+import com.cloud.agent.api.ConfigureNexusVsmForAsaCommand;
+import com.cloud.agent.api.CreateLogicalEdgeFirewallCommand;
+import com.cloud.agent.api.routing.SetFirewallRulesCommand;
+import com.cloud.agent.api.routing.SetPortForwardingRulesCommand;
+import com.cloud.agent.api.routing.SetSourceNatCommand;
+import com.cloud.agent.api.routing.SetStaticNatRulesCommand;
+import com.cloud.configuration.ConfigurationManager;
+import com.cloud.dc.ClusterVSMMapVO;
+import com.cloud.dc.DataCenter;
+import com.cloud.dc.VlanVO;
+import com.cloud.dc.DataCenter.NetworkType;
+import com.cloud.dc.dao.ClusterVSMMapDao;
+import com.cloud.dc.dao.VlanDao;
+import com.cloud.deploy.DeployDestination;
+import com.cloud.domain.Domain;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.host.HostVO;
+import com.cloud.host.dao.HostDao;
+import com.cloud.network.Network;
+import com.cloud.network.Network.GuestType;
+import com.cloud.network.Network.Provider;
+import com.cloud.network.Network.Service;
+import com.cloud.network.CiscoNexusVSMDeviceVO;
+import com.cloud.network.IpAddress;
+import com.cloud.network.NetworkManager;
+import com.cloud.network.NetworkModel;
+import com.cloud.network.Networks.BroadcastDomainType;
+import com.cloud.network.Networks.TrafficType;
+import com.cloud.network.addr.PublicIp;
+import com.cloud.network.cisco.CiscoAsa1000vDeviceVO;
+import com.cloud.network.cisco.CiscoVnmcControllerVO;
+import com.cloud.network.cisco.NetworkAsa1000vMapVO;
+import com.cloud.network.dao.CiscoAsa1000vDao;
+import com.cloud.network.dao.CiscoNexusVSMDeviceDao;
+import com.cloud.network.dao.CiscoVnmcDao;
+import com.cloud.network.dao.NetworkAsa1000vMapDao;
+import com.cloud.network.dao.NetworkServiceMapDao;
+import com.cloud.network.rules.FirewallRule;
+import com.cloud.network.rules.PortForwardingRule;
+import com.cloud.network.rules.StaticNat;
+import com.cloud.network.rules.StaticNatRule;
+import com.cloud.offering.NetworkOffering;
+import com.cloud.resource.ResourceManager;
+import com.cloud.user.Account;
+import com.cloud.utils.net.Ip;
+import com.cloud.vm.ReservationContext;
+
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*;
+
+public class CiscoVnmcElementTest {
+
+    CiscoVnmcElement _element = new CiscoVnmcElement();
+    AgentManager _agentMgr = mock(AgentManager.class);
+    NetworkManager _networkMgr = mock(NetworkManager.class);
+    NetworkModel _networkModel = mock(NetworkModel.class);
+    HostDao _hostDao = mock(HostDao.class);
+    NetworkServiceMapDao _ntwkSrvcDao = mock(NetworkServiceMapDao.class);
+    ConfigurationManager _configMgr = mock(ConfigurationManager.class);
+    CiscoVnmcDao _ciscoVnmcDao = mock(CiscoVnmcDao.class);
+    CiscoAsa1000vDao _ciscoAsa1000vDao = mock(CiscoAsa1000vDao.class);
+    NetworkAsa1000vMapDao _networkAsa1000vMapDao = mock(NetworkAsa1000vMapDao.class);
+    ClusterVSMMapDao _clusterVsmMapDao = mock(ClusterVSMMapDao.class);
+    CiscoNexusVSMDeviceDao _vsmDeviceDao = mock(CiscoNexusVSMDeviceDao.class);
+    VlanDao _vlanDao = mock(VlanDao.class);
+
+    @Before
+    public void setUp() throws ConfigurationException {
+        _element._resourceMgr = mock(ResourceManager.class);
+        _element._agentMgr = _agentMgr;
+        _element._networkMgr = _networkMgr;
+        _element._networkModel = _networkModel;
+        _element._hostDao = _hostDao;
+        _element._configMgr = _configMgr;
+        _element._ciscoVnmcDao = _ciscoVnmcDao;
+        _element._ciscoAsa1000vDao = _ciscoAsa1000vDao;
+        _element._networkAsa1000vMapDao = _networkAsa1000vMapDao;
+        _element._clusterVsmMapDao = _clusterVsmMapDao;
+        _element._vsmDeviceDao = _vsmDeviceDao;
+        _element._vlanDao = _vlanDao;
+
+        // Standard responses
+        when(_networkModel.isProviderForNetwork(Provider.CiscoVnmc, 1L)).thenReturn(true);
+
+        _element.configure("CiscoVnmcTestElement", Collections.<String, Object> emptyMap());
+    }
+
+    @Test
+    public void canHandleTest() {
+        Network network = mock(Network.class);
+        when(network.getId()).thenReturn(1L);
+        when(network.getBroadcastDomainType()).thenReturn(BroadcastDomainType.Vlan);
+        assertTrue(_element.canHandle(network));
+
+        when(network.getBroadcastDomainType()).thenReturn(BroadcastDomainType.UnDecided);
+        assertFalse(_element.canHandle(network));
+    }
+
+    @Test
+    public void implementTest() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
+    	URI uri = URI.create("vlan://123");
+
+        Network network = mock(Network.class);
+        when(network.getId()).thenReturn(1L);
+        when(network.getBroadcastDomainType()).thenReturn(BroadcastDomainType.Vlan);
+        when(network.getDataCenterId()).thenReturn(1L);
+        when(network.getGateway()).thenReturn("1.1.1.1");
+        when(network.getBroadcastUri()).thenReturn(uri);
+        when(network.getCidr()).thenReturn("1.1.1.0/24");
+
+        NetworkOffering offering = mock(NetworkOffering.class);
+        when(offering.getId()).thenReturn(1L);
+        when(offering.getTrafficType()).thenReturn(TrafficType.Guest);
+        when(offering.getGuestType()).thenReturn(GuestType.Isolated);
+
+        DeployDestination dest = mock(DeployDestination.class);
+
+        Domain dom = mock(Domain.class);
+        when(dom.getName()).thenReturn("d1");
+        Account acc = mock(Account.class);
+        when(acc.getAccountName()).thenReturn("a1");
+        ReservationContext context = mock(ReservationContext.class);
+        when(context.getDomain()).thenReturn(dom);
+        when(context.getAccount()).thenReturn(acc);
+
+        DataCenter dc = mock(DataCenter.class);
+        when(dc.getNetworkType()).thenReturn(NetworkType.Advanced);
+        when(_configMgr.getZone(network.getDataCenterId())).thenReturn(dc);
+
+        List<CiscoVnmcControllerVO> devices = new ArrayList<CiscoVnmcControllerVO>();
+        devices.add(mock(CiscoVnmcControllerVO.class));
+        when(_ciscoVnmcDao.listByPhysicalNetwork(network.getPhysicalNetworkId())).thenReturn(devices);
+
+        CiscoAsa1000vDeviceVO asaVO = mock(CiscoAsa1000vDeviceVO.class);
+        when(asaVO.getInPortProfile()).thenReturn("foo");
+        when(asaVO.getManagementIp()).thenReturn("1.2.3.4");
+
+        List<CiscoAsa1000vDeviceVO> asaList = new ArrayList<CiscoAsa1000vDeviceVO>();
+        asaList.add(asaVO);
+        when(_ciscoAsa1000vDao.listByPhysicalNetwork(network.getPhysicalNetworkId())).thenReturn(asaList);
+
+        when(_networkAsa1000vMapDao.findByNetworkId(network.getId())).thenReturn(mock(NetworkAsa1000vMapVO.class));
+        when(_networkAsa1000vMapDao.findByAsa1000vId(anyLong())).thenReturn(null);
+        when(_networkAsa1000vMapDao.persist(any(NetworkAsa1000vMapVO.class))).thenReturn(mock(NetworkAsa1000vMapVO.class));
+
+        when(_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.SourceNat, Provider.CiscoVnmc)).thenReturn(true);
+
+        ClusterVSMMapVO clusterVsmMap = mock(ClusterVSMMapVO.class);
+        when(_clusterVsmMapDao.findByClusterId(anyLong())).thenReturn(clusterVsmMap);
+
+        CiscoNexusVSMDeviceVO vsmDevice = mock(CiscoNexusVSMDeviceVO.class);
+        when(vsmDevice.getUserName()).thenReturn("foo");
+        when(vsmDevice.getPassword()).thenReturn("bar");
+        when(vsmDevice.getipaddr()).thenReturn("1.2.3.4");
+        when(_vsmDeviceDao.findById(anyLong())).thenReturn(vsmDevice);
+
+        HostVO hostVO = mock(HostVO.class);
+        when(hostVO.getId()).thenReturn(1L);
+        when(_hostDao.findById(anyLong())).thenReturn(hostVO);
+
+        Ip ip = mock(Ip.class);
+        when(ip.addr()).thenReturn("1.2.3.4");
+
+        PublicIp publicIp = mock(PublicIp.class);
+        when(publicIp.getAddress()).thenReturn(ip);
+        when(publicIp.getState()).thenReturn(IpAddress.State.Releasing);
+        when(publicIp.getAccountId()).thenReturn(1L);
+        when(publicIp.isSourceNat()).thenReturn(true);
+        when(publicIp.getVlanTag()).thenReturn("123");
+        when(publicIp.getGateway()).thenReturn("1.1.1.1");
+        when(publicIp.getNetmask()).thenReturn("1.1.1.1");
+        when(publicIp.getMacAddress()).thenReturn(null);
+        when(publicIp.isOneToOneNat()).thenReturn(true);
+        when(_networkMgr.assignSourceNatIpAddressToGuestNetwork(acc, network)).thenReturn(publicIp);
+
+        VlanVO vlanVO = mock(VlanVO.class);
+        when(vlanVO.getVlanGateway()).thenReturn("1.1.1.1");
+        List<VlanVO> vlanVOList = new ArrayList<VlanVO>();
+        when(_vlanDao.listVlansByPhysicalNetworkId(network.getPhysicalNetworkId())).thenReturn(vlanVOList);
+
+        Answer answer = mock(Answer.class);
+        when(answer.getResult()).thenReturn(true);
+
+        when(_agentMgr.easySend(anyLong(), any(CreateLogicalEdgeFirewallCommand.class))).thenReturn(answer);
+        when(_agentMgr.easySend(anyLong(), any(ConfigureNexusVsmForAsaCommand.class))).thenReturn(answer);
+        when(_agentMgr.easySend(anyLong(), any(SetSourceNatCommand.class))).thenReturn(answer);
+        when(_agentMgr.easySend(anyLong(), any(AssociateAsaWithLogicalEdgeFirewallCommand.class))).thenReturn(answer);
+        
+        assertTrue(_element.implement(network, offering, dest, context));
+    }
+
+    @Test
+    public void shutdownTest() throws ConcurrentOperationException, ResourceUnavailableException {
+    	URI uri = URI.create("vlan://123");
+
+        Network network = mock(Network.class);
+        when(network.getId()).thenReturn(1L);
+        when(network.getBroadcastDomainType()).thenReturn(BroadcastDomainType.Vlan);
+        when(network.getDataCenterId()).thenReturn(1L);
+        when(network.getBroadcastUri()).thenReturn(uri);
+
+        ReservationContext context = mock(ReservationContext.class);
+
+        when(_networkAsa1000vMapDao.findByNetworkId(network.getId())).thenReturn(mock(NetworkAsa1000vMapVO.class));
+
+        List<CiscoVnmcControllerVO> devices = new ArrayList<CiscoVnmcControllerVO>();
+        devices.add(mock(CiscoVnmcControllerVO.class));
+        when(_ciscoVnmcDao.listByPhysicalNetwork(network.getPhysicalNetworkId())).thenReturn(devices);
+
+        HostVO hostVO = mock(HostVO.class);
+        when(hostVO.getId()).thenReturn(1L);
+        when(_hostDao.findById(anyLong())).thenReturn(hostVO);
+
+        Answer answer = mock(Answer.class);
+        when(answer.getResult()).thenReturn(true);
+
+        when(_agentMgr.easySend(anyLong(), any(CleanupLogicalEdgeFirewallCommand.class))).thenReturn(answer);
+
+    	assertTrue(_element.shutdown(network, context, true));
+    }
+
+    @Test
+    public void applyFWRulesTest() throws ResourceUnavailableException {
+    	URI uri = URI.create("vlan://123");
+
+        Network network = mock(Network.class);
+        when(network.getId()).thenReturn(1L);
+        when(network.getBroadcastDomainType()).thenReturn(BroadcastDomainType.Vlan);
+        when(network.getDataCenterId()).thenReturn(1L);
+        when(network.getBroadcastUri()).thenReturn(uri);
+        when(network.getCidr()).thenReturn("1.1.1.0/24");
+        when(network.getState()).thenReturn(Network.State.Implemented);
+
+        Ip ip = mock(Ip.class);
+        when(ip.addr()).thenReturn("1.2.3.4");
+
+        IpAddress ipAddress = mock(IpAddress.class);
+        when(ipAddress.getAddress()).thenReturn(ip);
+
+        when(_networkModel.getIp(anyLong())).thenReturn(ipAddress);
+        when(_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.Firewall, Provider.CiscoVnmc)).thenReturn(true);
+
+        List<CiscoVnmcControllerVO> devices = new ArrayList<CiscoVnmcControllerVO>();
+        devices.add(mock(CiscoVnmcControllerVO.class));
+        when(_ciscoVnmcDao.listByPhysicalNetwork(network.getPhysicalNetworkId())).thenReturn(devices);
+
+        when(_networkAsa1000vMapDao.findByNetworkId(network.getId())).thenReturn(mock(NetworkAsa1000vMapVO.class));
+
+        HostVO hostVO = mock(HostVO.class);
+        when(hostVO.getId()).thenReturn(1L);
+        when(_hostDao.findById(anyLong())).thenReturn(hostVO);
+
+        FirewallRule rule = mock(FirewallRule.class);
+        when(rule.getSourceIpAddressId()).thenReturn(1L);
+        List<FirewallRule> rules = new ArrayList<FirewallRule>();
+        rules.add(rule);
+
+        Answer answer = mock(Answer.class);
+        when(answer.getResult()).thenReturn(true);
+
+        when(_agentMgr.easySend(anyLong(), any(SetFirewallRulesCommand.class))).thenReturn(answer);
+
+        assertTrue(_element.applyFWRules(network, rules));
+    }
+
+    @Test
+    public void applyPRulesTest() throws ResourceUnavailableException {
+    	URI uri = URI.create("vlan://123");
+
+        Network network = mock(Network.class);
+        when(network.getId()).thenReturn(1L);
+        when(network.getBroadcastDomainType()).thenReturn(BroadcastDomainType.Vlan);
+        when(network.getDataCenterId()).thenReturn(1L);
+        when(network.getBroadcastUri()).thenReturn(uri);
+        when(network.getCidr()).thenReturn("1.1.1.0/24");
+        when(network.getState()).thenReturn(Network.State.Implemented);
+
+        Ip ip = mock(Ip.class);
+        when(ip.addr()).thenReturn("1.2.3.4");
+
+        IpAddress ipAddress = mock(IpAddress.class);
+        when(ipAddress.getAddress()).thenReturn(ip);
+        when(ipAddress.getVlanId()).thenReturn(1L);
+
+        when(_networkModel.getIp(anyLong())).thenReturn(ipAddress);
+        when(_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.PortForwarding, Provider.CiscoVnmc)).thenReturn(true);
+
+        List<CiscoVnmcControllerVO> devices = new ArrayList<CiscoVnmcControllerVO>();
+        devices.add(mock(CiscoVnmcControllerVO.class));
+        when(_ciscoVnmcDao.listByPhysicalNetwork(network.getPhysicalNetworkId())).thenReturn(devices);
+
+        when(_networkAsa1000vMapDao.findByNetworkId(network.getId())).thenReturn(mock(NetworkAsa1000vMapVO.class));
+
+        HostVO hostVO = mock(HostVO.class);
+        when(hostVO.getId()).thenReturn(1L);
+        when(_hostDao.findById(anyLong())).thenReturn(hostVO);
+
+        VlanVO vlanVO = mock(VlanVO.class);
+        when(vlanVO.getVlanTag()).thenReturn(null);
+        when(_vlanDao.findById(anyLong())).thenReturn(vlanVO);
+
+        PortForwardingRule rule = mock(PortForwardingRule.class);
+        when(rule.getSourceIpAddressId()).thenReturn(1L);
+        when(rule.getDestinationIpAddress()).thenReturn(ip);
+        List<PortForwardingRule> rules = new ArrayList<PortForwardingRule>();
+        rules.add(rule);
+
+        Answer answer = mock(Answer.class);
+        when(answer.getResult()).thenReturn(true);
+
+        when(_agentMgr.easySend(anyLong(), any(SetPortForwardingRulesCommand.class))).thenReturn(answer);
+
+        assertTrue(_element.applyPFRules(network, rules));
+    }
+
+    @Test
+    public void applyStaticNatsTest() throws ResourceUnavailableException {
+    	URI uri = URI.create("vlan://123");
+
+        Network network = mock(Network.class);
+        when(network.getId()).thenReturn(1L);
+        when(network.getBroadcastDomainType()).thenReturn(BroadcastDomainType.Vlan);
+        when(network.getDataCenterId()).thenReturn(1L);
+        when(network.getBroadcastUri()).thenReturn(uri);
+        when(network.getCidr()).thenReturn("1.1.1.0/24");
+        when(network.getState()).thenReturn(Network.State.Implemented);
+
+        Ip ip = mock(Ip.class);
+        when(ip.addr()).thenReturn("1.2.3.4");
+
+        IpAddress ipAddress = mock(IpAddress.class);
+        when(ipAddress.getAddress()).thenReturn(ip);
+        when(ipAddress.getVlanId()).thenReturn(1L);
+
+        when(_networkModel.getIp(anyLong())).thenReturn(ipAddress);
+        when(_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.StaticNat, Provider.CiscoVnmc)).thenReturn(true);
+
+        List<CiscoVnmcControllerVO> devices = new ArrayList<CiscoVnmcControllerVO>();
+        devices.add(mock(CiscoVnmcControllerVO.class));
+        when(_ciscoVnmcDao.listByPhysicalNetwork(network.getPhysicalNetworkId())).thenReturn(devices);
+
+        when(_networkAsa1000vMapDao.findByNetworkId(network.getId())).thenReturn(mock(NetworkAsa1000vMapVO.class));
+
+        HostVO hostVO = mock(HostVO.class);
+        when(hostVO.getId()).thenReturn(1L);
+        when(_hostDao.findById(anyLong())).thenReturn(hostVO);
+
+        VlanVO vlanVO = mock(VlanVO.class);
+        when(vlanVO.getVlanTag()).thenReturn(null);
+        when(_vlanDao.findById(anyLong())).thenReturn(vlanVO);
+
+        StaticNat rule = mock(StaticNat.class);
+        when(rule.getSourceIpAddressId()).thenReturn(1L);
+        when(rule.getDestIpAddress()).thenReturn("1.2.3.4");
+        when(rule.isForRevoke()).thenReturn(false);
+        List<StaticNat> rules = new ArrayList<StaticNat>();
+        rules.add(rule);
+
+        Answer answer = mock(Answer.class);
+        when(answer.getResult()).thenReturn(true);
+
+        when(_agentMgr.easySend(anyLong(), any(SetStaticNatRulesCommand.class))).thenReturn(answer);
+
+        assertTrue(_element.applyStaticNats(network, rules));
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/test/com/cloud/network/resource/CiscoVnmcResourceTest.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/test/com/cloud/network/resource/CiscoVnmcResourceTest.java b/plugins/network-elements/cisco-vnmc/test/com/cloud/network/resource/CiscoVnmcResourceTest.java
new file mode 100755
index 0000000..e814fdc
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/test/com/cloud/network/resource/CiscoVnmcResourceTest.java
@@ -0,0 +1,285 @@
+// 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.resource;
+
+import static org.junit.Assert.*;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.*;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.ConfigurationException;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.CreateLogicalEdgeFirewallCommand;
+import com.cloud.agent.api.PingCommand;
+import com.cloud.agent.api.StartupCommand;
+import com.cloud.agent.api.routing.NetworkElementCommand;
+import com.cloud.agent.api.routing.SetFirewallRulesCommand;
+import com.cloud.agent.api.routing.SetPortForwardingRulesCommand;
+import com.cloud.agent.api.routing.SetSourceNatCommand;
+import com.cloud.agent.api.routing.SetStaticNatRulesCommand;
+import com.cloud.agent.api.to.FirewallRuleTO;
+import com.cloud.agent.api.to.IpAddressTO;
+import com.cloud.agent.api.to.PortForwardingRuleTO;
+import com.cloud.agent.api.to.StaticNatRuleTO;
+import com.cloud.dc.Vlan;
+import com.cloud.host.Host;
+import com.cloud.network.IpAddress;
+import com.cloud.network.cisco.CiscoVnmcConnectionImpl;
+import com.cloud.network.rules.FirewallRule;
+import com.cloud.network.rules.PortForwardingRule;
+import com.cloud.network.rules.StaticNat;
+import com.cloud.network.rules.FirewallRule.Purpose;
+import com.cloud.network.rules.FirewallRule.TrafficType;
+import com.cloud.network.rules.FirewallRuleVO;
+import com.cloud.utils.exception.ExecutionException;
+
+public class CiscoVnmcResourceTest {
+    CiscoVnmcConnectionImpl _connection = mock(CiscoVnmcConnectionImpl.class);
+    CiscoVnmcResource _resource;
+    Map<String,Object> _parameters;
+
+    @Before
+    public void setUp() throws ConfigurationException {
+        _resource = new CiscoVnmcResource();
+
+        _parameters = new HashMap<String, Object>();
+        _parameters.put("name", "CiscoVnmc");
+        _parameters.put("zoneId", "1");
+        _parameters.put("physicalNetworkId", "100");
+        _parameters.put("ip", "1.2.3.4");
+        _parameters.put("username", "admin");
+        _parameters.put("password", "pass");
+        _parameters.put("guid", "e8e13097-0a08-4e82-b0af-1101589ec3b8");
+        _parameters.put("numretries", "3");
+        _parameters.put("timeout", "300");
+    }
+
+    @Test(expected=ConfigurationException.class)
+    public void resourceConfigureFailure() throws ConfigurationException {
+        _resource.configure("CiscoVnmcResource", Collections.<String,Object>emptyMap());
+    }
+
+    @Test
+    public void resourceConfigure() throws ConfigurationException {
+        _resource.configure("CiscoVnmcResource", _parameters);
+        assertTrue("CiscoVnmc".equals(_resource.getName()));
+        assertTrue(_resource.getType() == Host.Type.ExternalFirewall);
+    }
+
+    @Test
+    public void testInitialization() throws ConfigurationException {
+        _resource.configure("CiscoVnmcResource", _parameters);
+        StartupCommand[] sc = _resource.initialize();
+        assertTrue(sc.length ==1);
+        assertTrue("e8e13097-0a08-4e82-b0af-1101589ec3b8".equals(sc[0].getGuid()));
+        assertTrue("CiscoVnmc".equals(sc[0].getName()));
+        assertTrue("1".equals(sc[0].getDataCenter()));
+    }
+
+    @Test
+    public void testPingCommandStatusOk() throws ConfigurationException, ExecutionException {
+        _resource.configure("CiscoVnmcResource", _parameters);
+        _resource.setConnection(_connection);
+        when(_connection.login()).thenReturn(true);
+        PingCommand ping = _resource.getCurrentStatus(1);
+        assertTrue(ping != null);
+        assertTrue(ping.getHostId() == 1);
+        assertTrue(ping.getHostType() == Host.Type.ExternalFirewall);
+    }
+
+    @Test
+    public void testPingCommandStatusFail() throws ConfigurationException, ExecutionException {
+        _resource.configure("CiscoVnmcResource", _parameters);
+        _resource.setConnection(_connection);
+        when(_connection.login()).thenReturn(false);
+        PingCommand ping = _resource.getCurrentStatus(1);
+        assertTrue(ping == null);
+    }
+
+    @Test
+    public void testSourceNat() throws ConfigurationException, Exception {
+        long vlanId = 123;
+        IpAddressTO ip = new IpAddressTO(1, "1.2.3.4", true, false,
+                false, null, "1.2.3.1", "255.255.255.0", null, null, false);
+        SetSourceNatCommand cmd = new SetSourceNatCommand(ip, true);
+        cmd.setContextParam(NetworkElementCommand.GUEST_VLAN_TAG, Long.toString(vlanId));
+        cmd.setContextParam(NetworkElementCommand.GUEST_NETWORK_CIDR, "1.2.3.4/32");
+
+        _resource.configure("CiscoVnmcResource", _parameters);
+        _resource.setConnection(_connection);
+        when(_connection.login()).thenReturn(true);
+        when(_connection.createTenantVDCNatPolicySet(anyString())).thenReturn(true);
+        when(_connection.createTenantVDCSourceNatPolicy(anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCSourceNatPolicyRef(anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCSourceNatIpPool(anyString(), anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCSourceNatRule(anyString(), anyString(), anyString(), anyString())).thenReturn(true);
+        when(_connection.associateNatPolicySet(anyString())).thenReturn(true);
+
+        Answer answer = _resource.executeRequest(cmd);
+        System.out.println(answer.getDetails());
+        assertTrue(answer.getResult());
+    }
+
+    @Test
+    public void testFirewall() throws ConfigurationException, Exception {
+        long vlanId = 123;
+        List<FirewallRuleTO> rules = new ArrayList<FirewallRuleTO>();
+        List<String> cidrList = new ArrayList<String>();
+        cidrList.add("2.3.2.3/32");
+        FirewallRuleTO active = new FirewallRuleTO(1,
+                null, "1.2.3.4", "tcp", 22, 22, false, false,
+                FirewallRule.Purpose.Firewall, cidrList, null, null);
+        rules.add(active);
+        FirewallRuleTO revoked = new FirewallRuleTO(1,
+                null, "1.2.3.4", "tcp", 22, 22, true, false,
+                FirewallRule.Purpose.Firewall, null, null, null);
+        rules.add(revoked);
+
+        SetFirewallRulesCommand cmd = new SetFirewallRulesCommand(rules);
+        cmd.setContextParam(NetworkElementCommand.GUEST_VLAN_TAG, Long.toString(vlanId));
+        cmd.setContextParam(NetworkElementCommand.GUEST_NETWORK_CIDR, "1.2.3.4/32");
+
+        _resource.configure("CiscoVnmcResource", _parameters);
+        _resource.setConnection(_connection);
+        when(_connection.createTenantVDCAclPolicySet(anyString(), anyBoolean())).thenReturn(true);
+        when(_connection.createTenantVDCAclPolicy(anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCAclPolicyRef(anyString(), anyString(), anyBoolean())).thenReturn(true);
+        when(_connection.deleteTenantVDCAclRule(anyString(), anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCIngressAclRule(
+                anyString(), anyString(), anyString(),
+                anyString(), anyString(), anyString(),
+                anyString(), anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCEgressAclRule(
+                anyString(), anyString(), anyString(),
+                anyString(), anyString(), anyString(),
+                anyString(), anyString(), anyString())).thenReturn(true);
+        when(_connection.associateAclPolicySet(anyString())).thenReturn(true);
+
+        Answer answer = _resource.executeRequest(cmd);
+        System.out.println(answer.getDetails());
+        assertTrue(answer.getResult());
+    }
+
+    @Test
+    public void testStaticNat() throws ConfigurationException, Exception {
+        long vlanId = 123;
+        List<StaticNatRuleTO> rules = new ArrayList<StaticNatRuleTO>();
+        StaticNatRuleTO active = new StaticNatRuleTO(0, "1.2.3.4", null,
+                null, "5.6.7.8", null, null, null, false, false);
+        rules.add(active);
+        StaticNatRuleTO revoked = new StaticNatRuleTO(0, "1.2.3.4", null, 
+                null, "5.6.7.8", null, null, null, true, false);
+        rules.add(revoked);
+
+        SetStaticNatRulesCommand cmd = new SetStaticNatRulesCommand(rules, null);
+        cmd.setContextParam(NetworkElementCommand.GUEST_VLAN_TAG, Long.toString(vlanId));
+        cmd.setContextParam(NetworkElementCommand.GUEST_NETWORK_CIDR, "1.2.3.4/32");
+
+        _resource.configure("CiscoVnmcResource", _parameters);
+        _resource.setConnection(_connection);
+        when(_connection.createTenantVDCNatPolicySet(anyString())).thenReturn(true);
+        when(_connection.createTenantVDCAclPolicySet(anyString(), anyBoolean())).thenReturn(true);
+        when(_connection.createTenantVDCDNatPolicy(anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCDNatPolicyRef(anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCAclPolicy(anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCAclPolicyRef(anyString(), anyString(), anyBoolean())).thenReturn(true);
+        when(_connection.deleteTenantVDCDNatRule(anyString(), anyString(), anyString())).thenReturn(true);
+        when(_connection.deleteTenantVDCAclRule(anyString(), anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCDNatIpPool(anyString(), anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCDNatRule(anyString(),
+                anyString(), anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCAclRuleForDNat(anyString(),
+                anyString(), anyString(), anyString())).thenReturn(true);
+        when(_connection.associateAclPolicySet(anyString())).thenReturn(true);
+
+        Answer answer = _resource.executeRequest(cmd);
+        System.out.println(answer.getDetails());
+        assertTrue(answer.getResult());
+    }
+
+    @Test
+    public void testPortForwarding() throws ConfigurationException, Exception {
+        long vlanId = 123;
+        List<PortForwardingRuleTO> rules = new ArrayList<PortForwardingRuleTO>();
+        PortForwardingRuleTO active = new PortForwardingRuleTO(1, "1.2.3.4", 22, 22,
+                "5.6.7.8", 22, 22, "tcp", false, false);
+        rules.add(active);
+        PortForwardingRuleTO revoked = new PortForwardingRuleTO(1, "1.2.3.4", 22, 22,
+                "5.6.7.8", 22, 22, "tcp", false, false);
+        rules.add(revoked);
+
+        SetPortForwardingRulesCommand cmd = new SetPortForwardingRulesCommand(rules);
+        cmd.setContextParam(NetworkElementCommand.GUEST_VLAN_TAG, Long.toString(vlanId));
+        cmd.setContextParam(NetworkElementCommand.GUEST_NETWORK_CIDR, "1.2.3.4/32");
+
+        _resource.configure("CiscoVnmcResource", _parameters);
+        _resource.setConnection(_connection);
+        when(_connection.createTenantVDCNatPolicySet(anyString())).thenReturn(true);
+        when(_connection.createTenantVDCAclPolicySet(anyString(), anyBoolean())).thenReturn(true);
+        when(_connection.createTenantVDCPFPolicy(anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCPFPolicyRef(anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCAclPolicy(anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCAclPolicyRef(anyString(), anyString(), anyBoolean())).thenReturn(true);
+        when(_connection.deleteTenantVDCPFRule(anyString(), anyString(), anyString())).thenReturn(true);
+        when(_connection.deleteTenantVDCAclRule(anyString(), anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCPFIpPool(anyString(), anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCPFPortPool(anyString(), anyString(), anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCPFRule(anyString(),
+                anyString(), anyString(), anyString(),
+                anyString(), anyString(), anyString())).thenReturn(true);
+        when(_connection.createTenantVDCAclRuleForPF(anyString(),
+                anyString(), anyString(), anyString(),
+                anyString(), anyString(), anyString())).thenReturn(true);
+        when(_connection.associateAclPolicySet(anyString())).thenReturn(true);
+
+        Answer answer = _resource.executeRequest(cmd);
+        System.out.println(answer.getDetails());
+        assertTrue(answer.getResult());
+    }
+
+    @Test
+    public void testCreateEdgeFirewall() throws ConfigurationException, Exception {
+        long vlanId = 123;
+        CreateLogicalEdgeFirewallCommand cmd = new CreateLogicalEdgeFirewallCommand(vlanId, "1.2.3.4", "5.6.7.8", "255.255.255.0", "255.255.255.0");
+        cmd.getPublicGateways().add("1.1.1.1");
+        cmd.getPublicGateways().add("2.2.2.2");
+
+        _resource.configure("CiscoVnmcResource", _parameters);
+        _resource.setConnection(_connection);
+        when(_connection.createTenant(anyString())).thenReturn(true);
+        when(_connection.createTenantVDC(anyString())).thenReturn(true);
+        when(_connection.createTenantVDCEdgeSecurityProfile(anyString())).thenReturn(true);
+        when(_connection.createTenantVDCEdgeDeviceProfile(anyString())).thenReturn(true);
+        when(_connection.createTenantVDCEdgeStaticRoutePolicy(anyString())).thenReturn(true);
+        when(_connection.createTenantVDCEdgeStaticRoute(anyString(), anyString(), anyString(), anyString())).thenReturn(true);
+        when(_connection.associateTenantVDCEdgeStaticRoutePolicy(anyString())).thenReturn(true);
+        when(_connection.createEdgeFirewall(anyString(), anyString(), anyString(), anyString(), anyString())).thenReturn(true);
+
+        Answer answer = _resource.executeRequest(cmd);
+        System.out.println(answer.getDetails());
+        assertTrue(answer.getResult());
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/pom.xml b/plugins/pom.xml
index 12c85ff..471253f 100755
--- a/plugins/pom.xml
+++ b/plugins/pom.xml
@@ -138,6 +138,7 @@
       </activation>
       <modules>
         <module>hypervisors/vmware</module>
+        <module>network-elements/cisco-vnmc</module>
       </modules>
     </profile>
     <profile>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index 50c137a..cfe0e00 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -2717,8 +2717,8 @@ public class ApiResponseHelper implements ResponseGenerator {
         List<? extends Network.Provider> serviceProviders = ApiDBUtils.getProvidersForService(service);
         List<ProviderResponse> serviceProvidersResponses = new ArrayList<ProviderResponse>();
         for (Network.Provider serviceProvider : serviceProviders) {
-            // return only Virtual Router/JuniperSRX as a provider for the firewall
-            if (service == Service.Firewall && !(serviceProvider == Provider.VirtualRouter || serviceProvider == Provider.JuniperSRX)) {
+            // return only Virtual Router/JuniperSRX/CiscoVnmc as a provider for the firewall
+            if (service == Service.Firewall && !(serviceProvider == Provider.VirtualRouter || serviceProvider == Provider.JuniperSRX || serviceProvider == Provider.CiscoVnmc)) {
                 continue;
             }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index fce3c01..5b6d81e 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -3302,8 +3302,8 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
                             throw new InvalidParameterValueException("Invalid service provider: " + prvNameStr);
                         }
 
-                        if (provider == Provider.JuniperSRX) {
-                            firewallProvider = Provider.JuniperSRX;
+                        if (provider == Provider.JuniperSRX || provider == Provider.CiscoVnmc) {
+                            firewallProvider = provider;
                         }
                         
                         if ((service == Service.PortForwarding || service == Service.StaticNat) && provider == Provider.VirtualRouter){

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 92b2d9c..fb760bf 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -680,7 +680,41 @@ CREATE VIEW `cloud`.`affinity_group_view` AS
             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;
-		
+        `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;
+
 -- Re-enable foreign key checking, at the end of the upgrade path
 SET foreign_key_checks = 1;			
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/test/integration/component/test_asa1000v_fw.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_asa1000v_fw.py b/test/integration/component/test_asa1000v_fw.py
new file mode 100755
index 0000000..0b66f97
--- /dev/null
+++ b/test/integration/component/test_asa1000v_fw.py
@@ -0,0 +1,134 @@
+# 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.
+
+""" Cisco ASA1000v external firewall
+"""
+#Import Local Modules
+import marvin
+from nose.plugins.attrib import attr
+from marvin.cloudstackTestCase import *
+from marvin.cloudstackAPI import *
+from marvin.integration.lib.utils import *
+from marvin.integration.lib.base import *
+from marvin.integration.lib.common import *
+from marvin.remoteSSHClient import remoteSSHClient
+import datetime
+
+
+class Services:
+    """Test Cisco ASA1000v services
+    """
+
+    def __init__(self):
+        self.services = {
+                        "vnmc": {
+                                    "ipaddress": '10.147.28.236',
+                                    "username": 'admin',
+                                    "password": 'Password_123',
+                        },
+                        "asa": {
+                                    "ipaddress": '10.147.28.238',
+                                    "insideportprofile": 'asa-in123',
+                        },
+                        "network_offering": {
+                                    "name": 'CiscoVnmc',
+                                    "displaytext": 'CiscoVnmc',
+                                    "guestiptype": 'Isolated',
+                                    "supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding,Firewall,UserData,StaticNat',
+                                    "traffictype": 'GUEST',
+                                    "availability": 'Optional',
+                                    "serviceProviderList": {
+                                            "Dhcp": 'VirtualRouter',
+                                            "Dns": 'VirtualRouter',
+                                            "SourceNat": 'CiscoVnmc',
+                                            "PortForwarding": 'CiscoVnmc',
+                                            "Firewall": 'CiscoVnmc',
+                                            "UserData": 'VirtualRouter',
+                                            "StaticNat": 'CiscoVnmc',
+                                    },
+                        },
+                        "network": {
+                                    "name": "CiscoVnmc",
+                                    "displaytext": "CiscoVnmc",
+                        },
+                    }
+
+class TestASASetup(cloudstackTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        cls.apiclient = super(
+                            TestASASetup,
+                            cls
+                            ).getClsTestClient().getApiClient()
+        cls.services = Services().services
+        cls.network_offering = NetworkOffering.create(
+                            cls.apiclient,
+                            cls.services["network_offering"],
+                            conservemode=True)
+        # Enable network offering
+        cls.network_offering.update(cls.apiclient, state='Enabled')
+
+        cls._cleanup = [
+                        cls.network_offering,
+                      ]
+        return
+
+    @classmethod
+    def tearDownClass(cls):
+        try:
+            # Cleanup
+            cleanup_resources(cls.apiclient, cls._cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
+    def setUp(self):
+        self.apiclient = self.testClient.getApiClient()
+        self.dbclient = self.testClient.getDbConnection()
+
+        self.zone = get_zone(self.apiclient, self.services)
+        self.physicalnetworks = PhysicalNetwork.list(self.apiclient, zoneid=self.zone.id)
+        self.assertNotEqual(len(self.physicalnetworks), 0, "Check if the list physical network API returns a non-empty response")
+        self.clusters = Cluster.list(self.apiclient, hypervisor='VMware')
+        self.assertNotEqual(len(self.clusters), 0, "Check if the list cluster API returns a non-empty response")
+
+        return
+
+    def tearDown(self):
+        try:
+            self.debug("Cleaning up the resources")
+            # Cleanup
+            cleanup_resources(self.apiclient, self._cleanup)
+            self.debug("Cleanup complete!")
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
+    def test_registerVnmc(self):
+        Vnmc = VNMC.create(self.apiclient, self.services["vnmc"]["ipaddress"], self.services["vnmc"]["username"], self.services["vnmc"]["password"], self.physicalnetworks[0].id)
+        self.debug("Cisco VNMC appliance with id %s deployed"%(Vnmc.id))
+        VnmcList = VNMC.list(self.apiclient, physicalnetworkid = self.physicalnetworks[0].id)
+        self.assertNotEqual(len(VnmcList), 0, "List VNMC API returned an empty response")
+        Vnmc.delete(self.apiclient)
+
+    def test_registerAsa1000v(self):
+        Asa = ASA1000V.create(self.apiclient, self.services["asa"]["ipaddress"], self.services["asa"]["insideportprofile"], self.clusters[0].id, self.physicalnetworks[0].id)
+        self.debug("Cisco ASA 1000v appliance with id %s deployed"%(Asa.id))
+        AsaList = ASA1000V.list(self.apiclient, physicalnetworkid = self.physicalnetworks[0].id)
+        self.assertNotEqual(len(AsaList), 0, "List ASA 1000v API returned an empty response")
+        Asa.delete(self.apiclient)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/tools/marvin/marvin/integration/lib/base.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base.py b/tools/marvin/marvin/integration/lib/base.py
index 3df68ab..0185c87 100755
--- a/tools/marvin/marvin/integration/lib/base.py
+++ b/tools/marvin/marvin/integration/lib/base.py
@@ -2444,7 +2444,6 @@ class VPC:
         [setattr(cmd, k, v) for k, v in kwargs.items()]
         return(apiclient.listVPCs(cmd))
 
-
 class AffinityGroup:
     def __init__(self, items):
         self.__dict__.update(items)
@@ -2467,9 +2466,71 @@ class AffinityGroup:
         cmd.id = self.id
         return apiclient.deleteVPC(cmd)
 
-
     @classmethod
     def list(cls, apiclient, **kwargs):
         cmd = listAffinityGroups.listAffinityGroupsCmd()
         [setattr(cmd, k, v) for k, v in kwargs.items()]
         return(apiclient.listVPCs(cmd))
+
+class VNMC:
+    """Manage VNMC lifecycle"""
+
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+    def create(cls, apiclient, hostname, username, password, physicalnetworkid):
+        """Registers VNMC appliance"""
+
+        cmd = addCiscoVnmcResource.addCiscoVnmcResourceCmd()
+        cmd.hostname = hostname
+        cmd.username = username
+        cmd.password = password
+        cmd.physicalnetworkid = physicalnetworkid
+        return VNMC(apiclient.addCiscoVnmcResource(cmd))
+
+    def delete(self, apiclient):
+        """Removes VNMC appliance"""
+
+        cmd = deleteCiscoVnmcResource.deleteCiscoVnmcResourceCmd()
+        cmd.resourceid = self.resourceid
+        return apiclient.deleteCiscoVnmcResource(cmd)
+
+    @classmethod
+    def list(cls, apiclient, **kwargs):
+        """List VNMC appliances"""
+
+        cmd = listCiscoVnmcResources.listCiscoVnmcResourcesCmd()
+        [setattr(cmd, k, v) for k, v in kwargs.items()]
+        return(apiclient.listCiscoVnmcResources(cmd))
+
+class ASA1000V:
+    """Manage ASA 1000v lifecycle"""
+
+    def __init__(self, items):
+        self.__dict__.update(items)
+
+    @classmethod
+    def create(cls, apiclient, hostname, insideportprofile, clusterid, physicalnetworkid):
+        """Registers ASA 1000v appliance"""
+
+        cmd = addCiscoAsa1000vResource.addCiscoAsa1000vResourceCmd()
+        cmd.hostname = hostname
+        cmd.insideportprofile = insideportprofile
+        cmd.clusterid = clusterid
+        cmd.physicalnetworkid = physicalnetworkid
+        return ASA1000V(apiclient.addCiscoAsa1000vResource(cmd))
+
+    def delete(self, apiclient):
+        """Removes ASA 1000v appliance"""
+
+        cmd = deleteCiscoAsa1000vResource.deleteCiscoAsa1000vResourceCmd()
+        cmd.resourceid = self.resourceid
+        return apiclient.deleteCiscoAsa1000vResource(cmd)
+
+    @classmethod
+    def list(cls, apiclient, **kwargs):
+        """List ASA 1000v appliances"""
+
+        cmd = listCiscoAsa1000vResources.listCiscoAsa1000vResourcesCmd()
+        [setattr(cmd, k, v) for k, v in kwargs.items()]
+        return(apiclient.listCiscoAsa1000vResources(cmd))

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/utils/src/com/cloud/utils/cisco/n1kv/vsm/NetconfHelper.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/cisco/n1kv/vsm/NetconfHelper.java b/utils/src/com/cloud/utils/cisco/n1kv/vsm/NetconfHelper.java
index be8d68a..06718d0 100644
--- a/utils/src/com/cloud/utils/cisco/n1kv/vsm/NetconfHelper.java
+++ b/utils/src/com/cloud/utils/cisco/n1kv/vsm/NetconfHelper.java
@@ -80,6 +80,17 @@ public class NetconfHelper {
     }
 
     public void addPortProfile(String name, PortProfileType type, BindingType binding,
+            SwitchPortMode mode, int vlanid, String vdc, String espName) throws CloudRuntimeException {
+        String command = VsmCommand.getAddPortProfile(name, type, binding, mode, vlanid, vdc, espName);
+        if (command != null) {
+            command = command.concat(SSH_NETCONF_TERMINATOR);
+            parseOkReply(sendAndReceive(command));
+        } else {
+            throw new CloudRuntimeException("Error generating rpc request for adding port profile.");
+        }
+    }
+
+    public void addPortProfile(String name, PortProfileType type, BindingType binding,
             SwitchPortMode mode, int vlanid) throws CloudRuntimeException {
         String command = VsmCommand.getAddPortProfile(name, type, binding, mode, vlanid);
         if (command != null) {
@@ -160,6 +171,17 @@ public class NetconfHelper {
         }
     }
 
+    public void addVServiceNode(String vlanId, String ipAddr)
+            throws CloudRuntimeException {
+        String command = VsmCommand.getVServiceNode(vlanId, ipAddr);
+        if (command != null) {
+            command = command.concat(SSH_NETCONF_TERMINATOR);
+            parseOkReply(sendAndReceive(command));
+        } else {
+            throw new CloudRuntimeException("Error generating rpc request for adding vservice node for vlan " + vlanId);
+        }
+    }
+
     public PortProfile getPortProfileByName(String name) throws CloudRuntimeException {
         String command = VsmCommand.getPortProfile(name);
         if (command != null) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/utils/src/com/cloud/utils/cisco/n1kv/vsm/VsmCommand.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/cisco/n1kv/vsm/VsmCommand.java b/utils/src/com/cloud/utils/cisco/n1kv/vsm/VsmCommand.java
index d1887f6..fdab390 100644
--- a/utils/src/com/cloud/utils/cisco/n1kv/vsm/VsmCommand.java
+++ b/utils/src/com/cloud/utils/cisco/n1kv/vsm/VsmCommand.java
@@ -70,6 +70,40 @@ public class VsmCommand {
     }
 
     public static String getAddPortProfile(String name, PortProfileType type,
+            BindingType binding, SwitchPortMode mode, int vlanid, String vdc, String espName) {
+        try {
+            // Create the document and root element.
+            DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+            DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
+            DOMImplementation domImpl = docBuilder.getDOMImplementation();
+            Document doc = createDocument(domImpl);
+
+            // Edit configuration command.
+            Element editConfig = doc.createElement("nf:edit-config");
+            doc.getDocumentElement().appendChild(editConfig);
+
+            // Command to get into exec configure mode.
+            Element target = doc.createElement("nf:target");
+            Element running = doc.createElement("nf:running");
+            target.appendChild(running);
+            editConfig.appendChild(target);
+
+            // Command to create the port profile with the desired configuration.
+            Element config = doc.createElement("nf:config");
+            config.appendChild(configPortProfileDetails(doc, name, type, binding, mode, vlanid, vdc, espName));
+            editConfig.appendChild(config);
+
+            return serialize(domImpl, doc);
+        } catch (ParserConfigurationException e) {
+            s_logger.error("Error while creating add port profile message : " + e.getMessage());
+            return null;
+        } catch (DOMException e) {
+            s_logger.error("Error while creating add port profile message : " + e.getMessage());
+            return null;
+        }
+    }
+
+    public static String getAddPortProfile(String name, PortProfileType type,
             BindingType binding, SwitchPortMode mode, int vlanid) {
         try {
             // Create the document and root element.
@@ -366,6 +400,184 @@ public class VsmCommand {
         }
     }
 
+    public static String getVServiceNode(String vlanId, String ipAddr) {
+        try {
+            // Create the document and root element.
+            DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+            DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
+            DOMImplementation domImpl = docBuilder.getDOMImplementation();
+            Document doc = createDocument(domImpl);
+
+            // Edit configuration command.
+            Element editConfig = doc.createElement("nf:edit-config");
+            doc.getDocumentElement().appendChild(editConfig);
+
+            // Command to get into exec configure mode.
+            Element target = doc.createElement("nf:target");
+            Element running = doc.createElement("nf:running");
+            target.appendChild(running);
+            editConfig.appendChild(target);
+
+            // Command to create the port profile with the desired configuration.
+            Element config = doc.createElement("nf:config");
+            config.appendChild(configVServiceNodeDetails(doc, vlanId, ipAddr));
+            editConfig.appendChild(config);
+
+            return serialize(domImpl, doc);
+        } catch (ParserConfigurationException e) {
+            s_logger.error("Error while adding vservice node for vlan " + vlanId + ", " + e.getMessage());
+            return null;
+        } catch (DOMException e) {
+            s_logger.error("Error while adding vservice node for vlan " + vlanId + ", " + e.getMessage());
+            return null;
+        }
+    }
+
+    private static Element configVServiceNodeDetails(Document doc, String vlanId, String ipAddr) {
+        // In mode, exec_configure.
+        Element configure = doc.createElementNS(s_ciscons, "nxos:configure");
+        Element modeConfigure = doc.createElement("nxos:" + s_configuremode);
+        configure.appendChild(modeConfigure);
+
+        // vservice node %name% type asa
+        Element vservice = doc.createElement("vservice");
+        vservice.appendChild(doc.createElement("node"))
+                .appendChild(doc.createElement("ASA_" + vlanId))
+                .appendChild(doc.createElement("type"))
+                .appendChild(doc.createElement("asa"));
+        modeConfigure.appendChild(vservice);
+
+        Element address = doc.createElement(s_paramvalue);
+        address.setAttribute("isKey", "true");
+        address.setTextContent(ipAddr);
+
+        // ip address %ipAddr%
+        modeConfigure.appendChild(doc.createElement("ip"))
+        		.appendChild(doc.createElement("address"))
+                .appendChild(doc.createElement("value"))
+        		.appendChild(address);
+
+        Element vlan = doc.createElement(s_paramvalue);
+        vlan.setAttribute("isKey", "true");
+        vlan.setTextContent(vlanId);
+
+        // adjacency l2 vlan %vlanId%
+        modeConfigure.appendChild(doc.createElement("adjacency"))
+                .appendChild(doc.createElement("l2"))
+                .appendChild(doc.createElement("vlan"))
+                .appendChild(doc.createElement("value"))
+                .appendChild(vlan);
+
+        // fail-mode close
+        modeConfigure.appendChild(doc.createElement("fail-mode"))
+                .appendChild(doc.createElement("close"));
+
+        // Persist the configuration across reboots.
+        modeConfigure.appendChild(persistConfiguration(doc));
+
+        return configure;
+    }
+
+    private static Element configPortProfileDetails(Document doc, String name, PortProfileType type,
+            BindingType binding, SwitchPortMode mode, int vlanid, String vdc, String espName) {
+
+        // In mode, exec_configure.
+        Element configure = doc.createElementNS(s_ciscons, "nxos:configure");
+        Element modeConfigure = doc.createElement("nxos:" + s_configuremode);
+        configure.appendChild(modeConfigure);
+
+        // Port profile name and type configuration.
+        Element portProfile = doc.createElement("port-profile");
+        modeConfigure.appendChild(portProfile);
+
+        // Port profile type.
+        Element portDetails = doc.createElement("name");
+        switch (type) {
+        case none:
+            portProfile.appendChild(portDetails);
+            break;
+        case ethernet:
+            {
+                Element typetag = doc.createElement("type");
+                Element ethernettype = doc.createElement("ethernet");
+                portProfile.appendChild(typetag);
+                typetag.appendChild(ethernettype);
+                ethernettype.appendChild(portDetails);
+            }
+            break;
+        case vethernet:
+            {
+                Element typetag = doc.createElement("type");
+                Element ethernettype = doc.createElement("vethernet");
+                portProfile.appendChild(typetag);
+                typetag.appendChild(ethernettype);
+                ethernettype.appendChild(portDetails);
+            }
+            break;
+        }
+
+        // Port profile name.
+        Element value = doc.createElement(s_paramvalue);
+        value.setAttribute("isKey", "true");
+        value.setTextContent(name);
+        portDetails.appendChild(value);
+
+        // element for port prof mode.
+        Element portProf = doc.createElement(s_portprofmode);
+        portDetails.appendChild(portProf);
+
+        // Binding type.
+        if (binding != BindingType.none) {
+            portProf.appendChild(getBindingType(doc, binding));
+        }
+
+        if (mode != SwitchPortMode.none) {
+            // Switchport mode.
+            portProf.appendChild(getSwitchPortMode(doc, mode));
+            // Adding vlan details.
+            if (vlanid > 0) {
+                portProf.appendChild(getAddVlanDetails(doc, mode, Integer.toString(vlanid)));
+            }
+        }
+
+        // Command "vmware port-group".
+        Element vmware = doc.createElement("vmware");
+        Element portgroup = doc.createElement("port-group");
+        vmware.appendChild(portgroup);
+        portProf.appendChild(vmware);
+
+        // org root/%vdc%
+        // vservice node <Node Name> profile <Edge Security Profile Name in VNMC>
+        Element org = doc.createElement("org");
+        org.appendChild(doc.createElement(vdc));
+        portProf.appendChild(org);
+
+        String asaNodeName = "ASA_" + vlanid;
+        Element vservice = doc.createElement("vservice");
+        vservice.appendChild(doc.createElement("node"))
+                .appendChild(doc.createElement(asaNodeName))
+                .appendChild(doc.createElement("profile"))
+                .appendChild(doc.createElement(espName));
+        portProf.appendChild(vservice);
+
+        // no shutdown.
+        Element no = doc.createElement("no");
+        Element shutdown = doc.createElement("shutdown");
+        no.appendChild(shutdown);
+        portProf.appendChild(no);
+
+        // Enable the port profile.
+        Element state = doc.createElement("state");
+        Element enabled = doc.createElement("enabled");
+        state.appendChild(enabled);
+        portProf.appendChild(state);
+
+        // Persist the configuration across reboots.
+        modeConfigure.appendChild(persistConfiguration(doc));
+
+        return configure;
+    }
+    
     private static Element configPortProfileDetails(Document doc, String name, PortProfileType type,
             BindingType binding, SwitchPortMode mode, int vlanid) {
 
@@ -433,6 +645,7 @@ public class VsmCommand {
         Element portgroup = doc.createElement("port-group");
         vmware.appendChild(portgroup);
         portProf.appendChild(vmware);
+        
 
         // no shutdown.
         Element no = doc.createElement("no");


[17/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
CLOUDSTACK-1995: Enhance resize volume tests to support xenserver hypervisor and fix few test flow errors

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0abfe240
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0abfe240
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0abfe240

Branch: refs/heads/ui-vm-affinity
Commit: 0abfe240c31e410e286169ac1f75aa564f267280
Parents: 48c1c00
Author: Talluri <Sr...@citrix.com>
Authored: Mon Apr 15 16:47:34 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Mon Apr 15 12:00:08 2013 +0530

----------------------------------------------------------------------
 test/integration/smoke/test_volumes.py |   55 ++++++++++++++++++++++-----
 1 files changed, 45 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0abfe240/test/integration/smoke/test_volumes.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py
index 36eb5de..7d910d4 100644
--- a/test/integration/smoke/test_volumes.py
+++ b/test/integration/smoke/test_volumes.py
@@ -78,13 +78,13 @@ class Services:
                         "password": "password",
                         "ssh_port": 22,
                         "diskname": "TestDiskServ",
-                        "hypervisor": 'XenServer',
+                        "hypervisor": 'KVM',
                         "privateport": 22,
                         "publicport": 22,
                         "protocol": 'TCP',
                         "diskdevice": "/dev/xvdb",
-                        "ostype": 'CentOS 5.3 (64-bit)',
-                        "mode": 'basic',
+                        "ostype": 'CentOS 5.5 (64-bit)',
+                        "mode": 'advanced',
                         "sleep": 10,
                         "timeout": 600,
                     }
@@ -358,6 +358,12 @@ class TestVolumes(cloudstackTestCase):
     def setUp(self):
         self.apiClient = self.testClient.getApiClient()
         self.dbclient = self.testClient.getDbConnection()
+        self.cleanup = []
+
+    def tearDown(self):
+        #Clean up, terminate the created volumes
+        cleanup_resources(self.apiClient, self.cleanup)
+        return
 
     @attr(tags = ["advanced", "advancedns", "smoke"])
     def test_02_attach_volume(self):
@@ -535,9 +541,13 @@ class TestVolumes(cloudstackTestCase):
         try:
             response = self.apiClient.resizeVolume(cmd)
         except Exception as ex:
-            if str(ex) == "HTTP Error 431: 431":
+            #print str(ex)
+            if "HTTP Error 431:" in str(ex):
                 success = True
-        self.assertEqual(success, True, "ResizeVolume - verify invalid id is handled appropriately")
+        self.assertEqual(
+                success,
+                True,
+                "ResizeVolume - verify invalid id is handled appropriately")
 
         # Next, we'll try an invalid disk offering id
         cmd.id             = self.volume.id
@@ -546,16 +556,29 @@ class TestVolumes(cloudstackTestCase):
         try:
             response = self.apiClient.resizeVolume(cmd)
         except Exception as ex:
-            if "need to specify a disk offering" in str(ex):
+            if "HTTP Error 431:" in str(ex):
                 success = True
-        self.assertEqual(success, True, "ResizeVolume - verify disk offering is handled appropriately")
-
+        self.assertEqual(
+                success,
+                True,
+                "ResizeVolume - verify disk offering is handled appropriately")
         # Ok, now let's try and resize a volume that is not custom.
         cmd.id             = self.volume.id
         cmd.diskofferingid = self.services['diskofferingid']
         cmd.size           = 4
         currentSize        = self.volume.size
 
+        self.debug(
+                "Attaching volume (ID: %s) to VM (ID: %s)" % (
+                                                    self.volume.id,
+                                                    self.virtual_machine.id)
+                 )
+        #attach the volume
+        self.virtual_machine.attach_volume(self.apiClient, self.volume)
+        #stop the vm if it is on xenserver
+        if self.services['hypervisor'].lower() == "xenserver":
+            self.virtual_machine.stop(self.apiClient)
+
         self.apiClient.resizeVolume(cmd)
         count = 0
         success = True
@@ -566,7 +589,7 @@ class TestVolumes(cloudstackTestCase):
                                                 type='DATADISK'
                                                 )
             for vol in list_volume_response:
-                if vol.id == self.volume.id and vol.size != currentSize:
+                if vol.id == self.volume.id and vol.size != currentSize and vol.state != "Resizing":
                     success = False
             if success:
                 break
@@ -579,12 +602,21 @@ class TestVolumes(cloudstackTestCase):
                          True,
                          "Verify the volume did not resize"
                          )
-
+        self.virtual_machine.detach_volume(self.apiClient, self.volume)
+        self.cleanup.append(self.volume)
 
     @attr(tags = ["advanced", "advancedns", "smoke"])
     def test_08_resize_volume(self):
         """Resize a volume"""
         # Verify the size is the new size is what we wanted it to be.
+        self.debug(
+                "Attaching volume (ID: %s) to VM (ID: %s)" % (
+                                                    self.volume.id,
+                                                    self.virtual_machine.id
+                                                    ))
+        self.virtual_machine.attach_volume(self.apiClient, self.volume)
+        if self.services['hypervisor'].lower() == "xenserver":
+            self.virtual_machine.stop(self.apiClient)
         self.debug("Resize Volume ID: %s" % self.volume.id)
 
         cmd                = resizeVolume.resizeVolumeCmd()
@@ -616,6 +648,9 @@ class TestVolumes(cloudstackTestCase):
                          "Check if the volume resized appropriately"
                          )
 
+        self.virtual_machine.detach_volume(self.apiClient, self.volume)
+        self.cleanup.append(self.volume)
+
     @attr(tags = ["advanced", "advancedns", "smoke"])
     def test_09_delete_detached_volume(self):
         """Delete a Volume unattached to an VM


[12/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
Removing DISCLAIMER as we're no longer in the Incubator.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/886fe012
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/886fe012
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/886fe012

Branch: refs/heads/ui-vm-affinity
Commit: 886fe0128ecd13ceac0ae928ce7d45b70a65964c
Parents: 2061459
Author: Joe Brockmeier <jz...@zonker.net>
Authored: Sat Apr 13 16:18:22 2013 -0500
Committer: Joe Brockmeier <jz...@zonker.net>
Committed: Sat Apr 13 16:18:22 2013 -0500

----------------------------------------------------------------------
 DISCLAIMER |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/886fe012/DISCLAIMER
----------------------------------------------------------------------
diff --git a/DISCLAIMER b/DISCLAIMER
deleted file mode 100644
index fa1e926..0000000
--- a/DISCLAIMER
+++ /dev/null
@@ -1,7 +0,0 @@
-Apache CloudStack is an effort undergoing incubation at The Apache Software Foundation (ASF), 
-sponsored by the Apache Incubator. Incubation is required of all newly accepted 
-projects until a further review indicates that the infrastructure, communications, and 
-decision making process have stabilized in a manner consistent with other successful ASF 
-projects. While incubation status is not necessarily a reflection of the completeness or 
-stability of the code, it does indicate that the project has yet to be fully endorsed by 
-the ASF.


[20/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
CLOUDSTACK-2032: populate mode in the services dict from the list zones instead of hard coding

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e7090e69
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e7090e69
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e7090e69

Branch: refs/heads/ui-vm-affinity
Commit: e7090e6933f7fa2731c817ead10dfafd650a8e85
Parents: 97911e9
Author: Srikanteswararao Talluri <sr...@citrix.com>
Authored: Mon Apr 15 16:47:40 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Mon Apr 15 18:12:23 2013 +0530

----------------------------------------------------------------------
 test/integration/smoke/test_iso.py           |    3 +--
 test/integration/smoke/test_network.py       |    4 +---
 test/integration/smoke/test_routers.py       |    2 +-
 test/integration/smoke/test_templates.py     |    3 +--
 test/integration/smoke/test_vm_life_cycle.py |    2 +-
 test/integration/smoke/test_volumes.py       |    2 +-
 6 files changed, 6 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e7090e69/test/integration/smoke/test_iso.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_iso.py b/test/integration/smoke/test_iso.py
index 5bd7bb3..3f8f11a 100644
--- a/test/integration/smoke/test_iso.py
+++ b/test/integration/smoke/test_iso.py
@@ -79,8 +79,6 @@ class Services:
             "timeout": 10,
             "ostype": "CentOS 5.3 (64-bit)",
             # CentOS 5.3 (64 bit)
-            "mode": 'advanced'
-            # Networking mode: Basic or Advanced
         }
 
 
@@ -93,6 +91,7 @@ class TestCreateIso(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
         self.services["domainid"] = self.domain.id
         self.services["iso_2"]["zoneid"] = self.zone.id
         

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e7090e69/test/integration/smoke/test_network.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py
index e78cc43..e2c63a4 100644
--- a/test/integration/smoke/test_network.py
+++ b/test/integration/smoke/test_network.py
@@ -38,8 +38,6 @@ class Services:
         self.services = {
                             "ostype": "CentOS 5.3 (64-bit)",
                             # Cent OS 5.3 (64 bit)
-                            "mode": 'advanced',
-                            # Networking mode: Basic or advanced
                             "lb_switch_wait": 10,
                             # Time interval after which LB switches the requests
                             "sleep": 60,
@@ -120,7 +118,7 @@ class TestPublicIP(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
         # Create Accounts & networks
         cls.account = Account.create(
                             cls.api_client,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e7090e69/test/integration/smoke/test_routers.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_routers.py b/test/integration/smoke/test_routers.py
index 435c7e4..93116bf 100644
--- a/test/integration/smoke/test_routers.py
+++ b/test/integration/smoke/test_routers.py
@@ -64,7 +64,6 @@ class Services:
                          "ostype": "CentOS 5.3 (64-bit)",
                          "sleep": 60,
                          "timeout": 10,
-                         "mode": 'advanced', #Networking mode: Basic, Advanced
                         }
 
 
@@ -81,6 +80,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)
+        self.services['mode'] = zone.networktype
         template = get_template(
                             cls.api_client,
                             cls.zone.id,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e7090e69/test/integration/smoke/test_templates.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_templates.py b/test/integration/smoke/test_templates.py
index 663b174..2b0e2f5 100644
--- a/test/integration/smoke/test_templates.py
+++ b/test/integration/smoke/test_templates.py
@@ -93,8 +93,6 @@ class Services:
                         "bootable": True,
                         "passwordenabled": True,
                         "ostype": "CentOS 5.3 (64-bit)",
-                        "mode": 'advanced',
-                        # Networking mode: Advanced, basic
                         "sleep": 30,
                         "timeout": 10,
                      }
@@ -126,6 +124,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.disk_offering = DiskOffering.create(
                                     cls.api_client,
                                     cls.services["disk_offering"]

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e7090e69/test/integration/smoke/test_vm_life_cycle.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py
index 564f6e8..cf9fd75 100644
--- a/test/integration/smoke/test_vm_life_cycle.py
+++ b/test/integration/smoke/test_vm_life_cycle.py
@@ -1038,4 +1038,4 @@ class TestVMLifeCycle(cloudstackTestCase):
                          False,
                          "Check if ISO is detached from virtual machine"
                          )
-        return
\ No newline at end of file
+        return

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e7090e69/test/integration/smoke/test_volumes.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py
index 7d910d4..9aa44eb 100644
--- a/test/integration/smoke/test_volumes.py
+++ b/test/integration/smoke/test_volumes.py
@@ -84,7 +84,6 @@ class Services:
                         "protocol": 'TCP',
                         "diskdevice": "/dev/xvdb",
                         "ostype": 'CentOS 5.5 (64-bit)',
-                        "mode": 'advanced',
                         "sleep": 10,
                         "timeout": 600,
                     }
@@ -100,6 +99,7 @@ class TestCreateVolume(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"]


[14/33] Adding issues fixed in 4.1.0

Posted by bf...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b0bbffb7/docs/en-US/Release_Notes.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/Release_Notes.xml b/docs/en-US/Release_Notes.xml
index b8c5c01..5b9571e 100644
--- a/docs/en-US/Release_Notes.xml
+++ b/docs/en-US/Release_Notes.xml
@@ -27,6 +27,3942 @@ under the License.
         <para>This document contains information specific to this release of &PRODUCT;, including upgrade instructions from prior releases, new features added to &PRODUCT;, API changes, and issues fixed in the release. For installation instructions, please see the <ulink url="http://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.1.0/html/Installation_Guide/index.html">Installation Guide</ulink>. For usage and administration instructions, please see the <ulink url="http://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.1.0/html/Admin_Guide/index.html">&PRODUCT; Administrator's Guide</ulink>. Developers and users who wish to work with the API will find instruction in the <ulink url="http://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.0.1-incubating/html/API_Developers_Guide/index.html">&PRODUCT; API Developer's Guide</ulink></para>
         <para>If you find any errors or problems in this guide, please see <xref linkend="feedback" />. We hope you enjoy working with &PRODUCT;!</para>
     </chapter>
+    <chapter id="version-4.1">
+        <title>Version 4.1.0</title>
+        <section id="what-new-in-4.1">
+            <title>What’s New in 4.1</title>
+            <para>Apache CloudStack 4.1.0 includes many new features. This section covers the most prominent new features and changes.</para>
+            <section id="localization">
+                <title>Localization</title>
+                <para>The 4.1.0 release adds partial User Interface (UI) support for Catalan, Chinese, French, German, Italian, Japanese, Korean, Norwegian, Portuguese, Russian, and Spanish. Not all languages are complete.</para>
+                <para>The 4.1.0 release also adds documentation translations for Chinese, Chinese (Taiwan), Italian, Japanese, Korean, and Portuguese.</para>
+            </section>
+        </section>
+        <section id="issues-fixed-4.0">
+            <title>Issues Fixed in 4.1.0</title>
+            <para>Apache CloudStack uses <ulink url="https://issues.apache.org/jira/browse/CLOUDSTACK">Jira</ulink>
+                to track its issues. All new features and bugs for 4.1.0 have been tracked in Jira, and have 
+                a standard naming convention of "CLOUDSTACK-NNNN" where "NNNN" is the issue number.</para>
+            <para>This section includes a summary of known issues against 4.0.0 that were fixed in 4.1.0. Approximately 470 bugs were resolved or closed in the 4.1.0 cycle.</para>
+            <informaltable>
+                <tgroup cols="2" align="left" colsep="1" rowsep="1">
+                    <colspec colwidth="1*" colname="1" colnum="1"/>
+                    <colspec colwidth="2*" colname="2" colnum="2"/>
+                    <thead>
+                        <row>
+                            <entry>
+                                <para>Defect</para>
+                            </entry>
+                            <entry>
+                                <para>Description</para>
+                            </entry>
+                        </row>
+                    </thead>
+                    <tbody>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-46</para>
+                            </entry>
+                            <entry>
+                                <para>Remnants of mycloud remain.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-70</para>
+                            </entry>
+                            <entry>
+                                <para>Improve Network Restart Behaviour for Basic Zone: Restarting Network Fail</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-94</para>
+                            </entry>
+                            <entry>
+                                <para>"API command, listIsos documentation clarity</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-95</para>
+                            </entry>
+                            <entry>
+                                <para>IP address allocation not working when a user tries to allocate IP addresses in a Project</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-97</para>
+                            </entry>
+                            <entry>
+                                <para>Vmware network labels are ignored when creating a Zone using basic networkin</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-108</para>
+                            </entry>
+                            <entry>
+                                <para>VM should not be allowed to be deployed on two Isolated Networks of an Account that were created from DefaultNetworkOfferingwithSourceNATService</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-118</para>
+                            </entry>
+                            <entry>
+                                <para>"Status of host resorce stuck in ""ErrorInMaintenance""</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-119</para>
+                            </entry>
+                            <entry>
+                                <para>Move Agent-Simulator in to the hypervisor plugin mode</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-130</para>
+                            </entry>
+                            <entry>
+                                <para>Clarify docs on tags parameter in API referenc</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-152</para>
+                            </entry>
+                            <entry>
+                                <para>Routes on the User VM are programmed incorrectly on a VM present on both Isolated and Shared Guest Network</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-178</para>
+                            </entry>
+                            <entry>
+                                <para>Expose name parameter of VM in list Vm view</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-198</para>
+                            </entry>
+                            <entry>
+                                <para>vpn:failto add VPN Users deletes all the existing Vpn use</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-222</para>
+                            </entry>
+                            <entry>
+                                <para>Admin UI prompts to restart Management server with cancel edit operatio</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-225</para>
+                            </entry>
+                            <entry>
+                                <para>API Docs: Request params repeated with different description</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-226</para>
+                            </entry>
+                            <entry>
+                                <para>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</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-227</para>
+                            </entry>
+                            <entry>
+                                <para>ReconnectHostCmd: NullPointerException: Unable to get host Information for XenServer 6.0.2 host - on intentionally changing the traffic labels on the physical networ</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-228</para>
+                            </entry>
+                            <entry>
+                                <para>UI provides an option to reconnect a disconnected host - ServerApiException is thrown on an attemp</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-232</para>
+                            </entry>
+                            <entry>
+                                <para>Zone infrastructure chart -- disable resource total displa</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-235</para>
+                            </entry>
+                            <entry>
+                                <para>Network rate can be set in 2 places. Clarify docs on how this works</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-249</para>
+                            </entry>
+                            <entry>
+                                <para>Add host id to failed VM deploy alert</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-250</para>
+                            </entry>
+                            <entry>
+                                <para>Incorrect description of maintenance mode in admin guid</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-256</para>
+                            </entry>
+                            <entry>
+                                <para>"vpn:As an admin user, not able to delete VPN user which is present in a regular user's network.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-271</para>
+                            </entry>
+                            <entry>
+                                <para>updatePhysicalNetwork dies with an NPE when the vlan range is empt</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-274</para>
+                            </entry>
+                            <entry>
+                                <para>Two error codes mapped to same value in AP</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-275</para>
+                            </entry>
+                            <entry>
+                                <para>hostid not always a UUI</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-277</para>
+                            </entry>
+                            <entry>
+                                <para>Message during CloudStack management server Installation: cannot access /usr/share/cloud/bridge/lib: No such file or director</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-279</para>
+                            </entry>
+                            <entry>
+                                <para>deleteProject fails when executed by the regular user (works fine for root/domain admin</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-284</para>
+                            </entry>
+                            <entry>
+                                <para>listVirtualMachines does not return deleted machines when zone is specifie</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-290</para>
+                            </entry>
+                            <entry>
+                                <para>3.0.0 template also needed for 2.2.14 to 3.0.5 direct upgrade</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-293</para>
+                            </entry>
+                            <entry>
+                                <para>"We do awful, hacky things in our spec file for client</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-304</para>
+                            </entry>
+                            <entry>
+                                <para>Add synchronization for createSnapshot command per host basi</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-309</para>
+                            </entry>
+                            <entry>
+                                <para>iptables rules being deleted from wrong VM after a migratio</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-318</para>
+                            </entry>
+                            <entry>
+                                <para>Adding XenServer Host Fails - 6.0.2 fails with 4.0.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-320</para>
+                            </entry>
+                            <entry>
+                                <para>"sessionKey query parameter should be case-insensitive, now only sessionkey is accepted</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-322</para>
+                            </entry>
+                            <entry>
+                                <para>During upgrade displays error - a foreign key constraint fails (`cloud/#sql-f34_6e`..</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-332</para>
+                            </entry>
+                            <entry>
+                                <para>"""count"" property in list* API response should be equal to how many entries in database, not how many objects in API response</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-333</para>
+                            </entry>
+                            <entry>
+                                <para>When Datacenter name in VCenter has spaces Primary Storage (VMFS) discovery will fai</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-335</para>
+                            </entry>
+                            <entry>
+                                <para>KVM VPC load balancer not workin</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-336</para>
+                            </entry>
+                            <entry>
+                                <para>listZones doesn't honour pagin</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-343</para>
+                            </entry>
+                            <entry>
+                                <para>"Document what tools and packages are required to build, package and install CloudStack 4.0</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-346</para>
+                            </entry>
+                            <entry>
+                                <para>Cannot add Vmware cluster with class loader conflict exceptio</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-347</para>
+                            </entry>
+                            <entry>
+                                <para>listNetworks API: return vlan information only when the caller is ROOT admi</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-348</para>
+                            </entry>
+                            <entry>
+                                <para>deleteNetwork does not clean up network resource count correctl</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-354</para>
+                            </entry>
+                            <entry>
+                                <para>Display of storage statistics is wrong</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-355</para>
+                            </entry>
+                            <entry>
+                                <para>"Fix ""count"" in a bunch of API commands</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-357</para>
+                            </entry>
+                            <entry>
+                                <para>"ISOs can be deleted while still attached to a running VM, and they subsequently cannot be detached from a running VM</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-359</para>
+                            </entry>
+                            <entry>
+                                <para>PropagateResourceEventCommand failes in cluster configuratio</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-361</para>
+                            </entry>
+                            <entry>
+                                <para>Wrong creation of guest networks on a KVM host in Multiple Physical Networks with guest traffi</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-364</para>
+                            </entry>
+                            <entry>
+                                <para>Docs point to download.cloud.com for AWS API scrip</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-368</para>
+                            </entry>
+                            <entry>
+                                <para>OVM - cannot create guest V</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-369</para>
+                            </entry>
+                            <entry>
+                                <para>ASF 4.0 - unable to support XenServer 6.1 hos</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-373</para>
+                            </entry>
+                            <entry>
+                                <para>"static NAT and Firewall is not working on external firewall device SRX, it needs to be implemented</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-377</para>
+                            </entry>
+                            <entry>
+                                <para>provide deployment config access to marvin's testcas</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-378</para>
+                            </entry>
+                            <entry>
+                                <para>mavenize marvin on maste</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-390</para>
+                            </entry>
+                            <entry>
+                                <para>Install Guide: Section 4.5.7 (Prepare the System VM Template): Links go to cloud.co</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-397</para>
+                            </entry>
+                            <entry>
+                                <para>Install Guide: Section 11.1 (Guest Traffic): Diagram is the wrong diagra</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-398</para>
+                            </entry>
+                            <entry>
+                                <para>Install Guide: Section 11.17.3 (Using VPN with Mac OSX): Not complete</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-404</para>
+                            </entry>
+                            <entry>
+                                <para>Update docs on the usage of cloud-setup-database</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-412</para>
+                            </entry>
+                            <entry>
+                                <para>Data truncation: Out of range value for column 'ram' at row </para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-415</para>
+                            </entry>
+                            <entry>
+                                <para>restartNetwork call causes VM to be unreachable when Nicira based SDN is used</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-416</para>
+                            </entry>
+                            <entry>
+                                <para>XCP 1.6beta2 (61002c) - can't add a hos</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-417</para>
+                            </entry>
+                            <entry>
+                                <para>Handle password server securely to run on port 8080 on V</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-424</para>
+                            </entry>
+                            <entry>
+                                <para>Updated userdata not propagating to the VR</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-427</para>
+                            </entry>
+                            <entry>
+                                <para>Change hardcoded step number references to dynamic link</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-428</para>
+                            </entry>
+                            <entry>
+                                <para>Storage capacity shown in UI is incorrec</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-435</para>
+                            </entry>
+                            <entry>
+                                <para>Vmware network labels are ignored when creating a Zone using basic networkin</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-441</para>
+                            </entry>
+                            <entry>
+                                <para>Running mgmt server using jetty fails to start api serve</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-446</para>
+                            </entry>
+                            <entry>
+                                <para>"Host going to alert state, if you are adding already added host</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-448</para>
+                            </entry>
+                            <entry>
+                                <para>SSVM bootstrap failure on XenServer hosts with E3 CP</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-456</para>
+                            </entry>
+                            <entry>
+                                <para>License tag in SPEC isn't what RPM is expectin</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-459</para>
+                            </entry>
+                            <entry>
+                                <para>[Optional Public IP assignment for EIP with Basic Zone] Associate IP Checkbox in Create Network Offering Dialog is Displayed When Elastic LB is Selecte</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-462</para>
+                            </entry>
+                            <entry>
+                                <para>A few corrections to make to the 4.0.0 installation guid</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-464</para>
+                            </entry>
+                            <entry>
+                                <para>"Regression in AWSAPI docs, entire sections removed</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-465</para>
+                            </entry>
+                            <entry>
+                                <para>French language file quotes are dropping javascript syntax error</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-467</para>
+                            </entry>
+                            <entry>
+                                <para>Developer's Guide points to cloud.com for API referenc</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-479</para>
+                            </entry>
+                            <entry>
+                                <para>UpdateVirtualMachine api fails to propagate userdata to dom</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-481</para>
+                            </entry>
+                            <entry>
+                                <para>Installation Guide Doc Erro</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-493</para>
+                            </entry>
+                            <entry>
+                                <para>2.2.x-3.0 DB upgrade support for Advance SG enabled network</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-499</para>
+                            </entry>
+                            <entry>
+                                <para>cloudmonkey CLI can't accept complex parameter</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-500</para>
+                            </entry>
+                            <entry>
+                                <para>Passwd-server iptables rules are dropped on domr on fresh start or on reboot.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-501</para>
+                            </entry>
+                            <entry>
+                                <para>Apidocs and marvin does not know how to handle Autoscaling docs.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-504</para>
+                            </entry>
+                            <entry>
+                                <para>Duplicate guest password scripts in codebase.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-507</para>
+                            </entry>
+                            <entry>
+                                <para>fix api docs for listSSHKeyPair</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-508</para>
+                            </entry>
+                            <entry>
+                                <para>CLVM copies template to primary storage unnecessarily.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-510</para>
+                            </entry>
+                            <entry>
+                                <para>Add button not visible when adding public IPs to physical network.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-514</para>
+                            </entry>
+                            <entry>
+                                <para>Marvin and Cloudmonkey don't work when an API target uses https or an alternate path.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-518</para>
+                            </entry>
+                            <entry>
+                                <para>API refactoring -- change @Parameter annotation and remove the @IdentityMapper annotation.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-520</para>
+                            </entry>
+                            <entry>
+                                <para>Dependency jar names mismatch with install-non-oss.s</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-521</para>
+                            </entry>
+                            <entry>
+                                <para>Build will hung up when doing test for TestAgentShel</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-522</para>
+                            </entry>
+                            <entry>
+                                <para>Log requests in cloudmonkey's log file.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-527</para>
+                            </entry>
+                            <entry>
+                                <para>List API performance optimization by using DB views and removing UUID conversion</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-534</para>
+                            </entry>
+                            <entry>
+                                <para>Failed to add hos</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-536</para>
+                            </entry>
+                            <entry>
+                                <para>remove citrix cloudpatform from 4.0 build - CloudStack is ASF project.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-539</para>
+                            </entry>
+                            <entry>
+                                <para>Cropped Text in UI under Quick View.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-552</para>
+                            </entry>
+                            <entry>
+                                <para>]Quick view details for a volume displays scroll bar in place of name of the volume when the name of the volume has more no of characters.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-553</para>
+                            </entry>
+                            <entry>
+                                <para>"SRX - When adding SRX device make "Public Network" - default to "untrusted" and "Private Network" - default to "trusted" as un-editable fields.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-556</para>
+                            </entry>
+                            <entry>
+                                <para>Erratic window behavior in Quick View tooltip.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-559</para>
+                            </entry>
+                            <entry>
+                                <para>source code import problem</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-560</para>
+                            </entry>
+                            <entry>
+                                <para>Usage server doesn't work in 4.0.0 due to missing db changes</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-572</para>
+                            </entry>
+                            <entry>
+                                <para>SG Enabled Advanced Zone - Not able to deploy a VM in an account specific shared network</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-573</para>
+                            </entry>
+                            <entry>
+                                <para>"NPE at ""com.cloud.network.NetworkManagerImpl.networkOfferingIsConfiguredForExternalNetworking(NetworkManagerImpl.java:4345)"" when create network from the network offering having NULL provider for the service</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-578</para>
+                            </entry>
+                            <entry>
+                                <para>The already deleted same hostname is not deleted from /etc/hosts of vRouter</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-584</para>
+                            </entry>
+                            <entry>
+                                <para>"typos in ""Apache_CloudStack-4.0.0-incubating-CloudStack_Nicira_NVP_Guide-en-US""</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-590</para>
+                            </entry>
+                            <entry>
+                                <para>Incorrect Network Gateways Assigned to System VM</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-592</para>
+                            </entry>
+                            <entry>
+                                <para>"API bloat, unknown apis cmd classes</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-593</para>
+                            </entry>
+                            <entry>
+                                <para>"2 guest network, auto create vlan error</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-596</para>
+                            </entry>
+                            <entry>
+                                <para>DeployVM command takes a lot of time to return job id.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-599</para>
+                            </entry>
+                            <entry>
+                                <para>DhcpEntryCommand fails on Router VM on CS4.0 and vSphere5 with Advanced Network Zone.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-600</para>
+                            </entry>
+                            <entry>
+                                <para>When rebooting KVM local storage VM host, libvirt definitions deleted</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-605</para>
+                            </entry>
+                            <entry>
+                                <para>Host physical CPU is incorrectly calculated for Vmware host</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-606</para>
+                            </entry>
+                            <entry>
+                                <para>Starting VM fails with 'ConcurrentOperationException' in a clustered MS scenari</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-614</para>
+                            </entry>
+                            <entry>
+                                <para>"ListTemplates API is not returning ""Enable SSH Key"" attribute for any given template</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-617</para>
+                            </entry>
+                            <entry>
+                                <para>Unable to edit a Sub domai</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-639</para>
+                            </entry>
+                            <entry>
+                                <para>API Refactoring: Adapters for AC</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-648</para>
+                            </entry>
+                            <entry>
+                                <para>The normal users could change their own login password.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-660</para>
+                            </entry>
+                            <entry>
+                                <para>Network Traffic Labels are not functional in Marvin</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-683</para>
+                            </entry>
+                            <entry>
+                                <para>Image Is Missing in the Accessing VM Section</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-689</para>
+                            </entry>
+                            <entry>
+                                <para>RVR: Stop pending flag is not cleared when user start the disconnected router from another hos</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-691</para>
+                            </entry>
+                            <entry>
+                                <para>A warning dialog box shows after reloading the welcome page.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-693</para>
+                            </entry>
+                            <entry>
+                                <para>Adding a VPC virtual router to a NiciraNVP enabled network fails.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-694</para>
+                            </entry>
+                            <entry>
+                                <para>"Create a new VPC network offering with "connectivity" option needed for SDN networking) is not allowed / VPC support for SDN networks</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-717</para>
+                            </entry>
+                            <entry>
+                                <para>cloudmonkey fails to parse/print response.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-720</para>
+                            </entry>
+                            <entry>
+                                <para>Fail to load a png image when accessing the web console.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-721</para>
+                            </entry>
+                            <entry>
+                                <para>Bytes sent/received in user statistics is empty (CloudStack 4.0)</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-725</para>
+                            </entry>
+                            <entry>
+                                <para>UI: Error when the Egress rules tab is selected for a network.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-734</para>
+                            </entry>
+                            <entry>
+                                <para>api_refactoring: CreateAccountCmd fails to send response due to NPE in service layer</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-735</para>
+                            </entry>
+                            <entry>
+                                <para>Integration smoke tests: Fix expunge vm test on api_refactoring</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-736</para>
+                            </entry>
+                            <entry>
+                                <para>Integration smoke tests: Fix check for vm name for the deployvm smoke test.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-793</para>
+                            </entry>
+                            <entry>
+                                <para>"Create cloudmonkey-helper, a plugin that helps autodiscover and sync api info via an api over some endpoint</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-798</para>
+                            </entry>
+                            <entry>
+                                <para>Move usage related cmd classes from cloud-server to cloud-api</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-799</para>
+                            </entry>
+                            <entry>
+                                <para>[Load Test] Check router statistics falls behind in gathering stats by more than 2 times the set value</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-819</para>
+                            </entry>
+                            <entry>
+                                <para>Create Account/User API logging password in access log</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-863</para>
+                            </entry>
+                            <entry>
+                                <para>Non-printable characters (ASCII control character) such as %00 or %0025 are getting stored in raw/non encoded form in the database</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-870</para>
+                            </entry>
+                            <entry>
+                                <para>Client UI: Wrong character encoding for some language</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-928</para>
+                            </entry>
+                            <entry>
+                                <para>[Simulator] Latency for Agent Commands - change unit of wait from seconds to millisecond</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-938</para>
+                            </entry>
+                            <entry>
+                                <para>s2s VPN trouble</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-959</para>
+                            </entry>
+                            <entry>
+                                <para>Missing sub-sections in document section System Service Offering</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-968</para>
+                            </entry>
+                            <entry>
+                                <para>marvin: vlan should be an attribute of the physical_network and not the zon</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-977</para>
+                            </entry>
+                            <entry>
+                                <para>Document how to use openvswitch with KVM hypervisor</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-978</para>
+                            </entry>
+                            <entry>
+                                <para>TypeError: instance.displayname is undefined while adding VM's to the LB rule</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-985</para>
+                            </entry>
+                            <entry>
+                                <para>Different MAC address for RvR caused issue in short term network outrag</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-987</para>
+                            </entry>
+                            <entry>
+                                <para>Sections missing in Working With Snapshot</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-993</para>
+                            </entry>
+                            <entry>
+                                <para>"admin"" user is not getting created when management server is started.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-995</para>
+                            </entry>
+                            <entry>
+                                <para>Not able to add the KVM host</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1002</para>
+                            </entry>
+                            <entry>
+                                <para>Not able to start VM</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1006</para>
+                            </entry>
+                            <entry>
+                                <para>need to disable service libvirt-guests in CentOS packaging RPMs, or in installation docs</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1008</para>
+                            </entry>
+                            <entry>
+                                <para>"Egress"" tab should not be presented in the UI for Shared Networks</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1010</para>
+                            </entry>
+                            <entry>
+                                <para>Host count and Secondary storage count always shows 1 in UI</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1011</para>
+                            </entry>
+                            <entry>
+                                <para>KVM host getting disconnected in cluster environment</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1013</para>
+                            </entry>
+                            <entry>
+                                <para>running cloudstack overwrites default public/private ssh key</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1014</para>
+                            </entry>
+                            <entry>
+                                <para>Merge ManagementServer and ManagementServerEx</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1016</para>
+                            </entry>
+                            <entry>
+                                <para>Not able to deploy VM</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1021</para>
+                            </entry>
+                            <entry>
+                                <para>the vlan is not creat to right nic. when i creat multi guest network</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1024</para>
+                            </entry>
+                            <entry>
+                                <para>Regression: Unable to add Xenserver host with latest build.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1027</para>
+                            </entry>
+                            <entry>
+                                <para>"Update SSL certificate" button should properly reflect its functionality</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1029</para>
+                            </entry>
+                            <entry>
+                                <para>Enter the token to specified project is malfunctioned</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1037</para>
+                            </entry>
+                            <entry>
+                                <para>"Make cloudmonkey awesome-er: Online help docs and api discovery, better colored output, parameter value autocompletion</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1050</para>
+                            </entry>
+                            <entry>
+                                <para>No Documentation on Adding a Load Balancer Rule</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1051</para>
+                            </entry>
+                            <entry>
+                                <para>API dispatcher unable to find objectVO corresponding to DeleteTemplatecm</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1055</para>
+                            </entry>
+                            <entry>
+                                <para>"The overlay still exists when the ""Recurring Snapshots"" dialog is canceled by pressing esc key.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1056</para>
+                            </entry>
+                            <entry>
+                                <para>S3 secondary storage fails to upload systemvm template due to KVMHA director</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1057</para>
+                            </entry>
+                            <entry>
+                                <para>regression of changeServiceForVirtualMachine API - fails to find service offering by serviceOfferingId parameter</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1063</para>
+                            </entry>
+                            <entry>
+                                <para>"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""</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1064</para>
+                            </entry>
+                            <entry>
+                                <para>A type error occurs when trying to add account/register template...</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1068</para>
+                            </entry>
+                            <entry>
+                                <para>Names in VR list is useles</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1070</para>
+                            </entry>
+                            <entry>
+                                <para>javelin: NPE on executing registerIso AP</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1071</para>
+                            </entry>
+                            <entry>
+                                <para>Netscaler element is not getting loaded as part of LoadBalancing Service Providers</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1078</para>
+                            </entry>
+                            <entry>
+                                <para>Not able to start System Vms on Rhel 6.3 KVM hos</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1079</para>
+                            </entry>
+                            <entry>
+                                <para>Deploying AWSAPI with mvn -pl :cloud-awsapi jetty:run fail</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1082</para>
+                            </entry>
+                            <entry>
+                                <para>UI doesn't throw any error message when trying to delete ip range from a network that is in use.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1083</para>
+                            </entry>
+                            <entry>
+                                <para>listUsageRecords api: removed project results in NP</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1087</para>
+                            </entry>
+                            <entry>
+                                <para>Update the Developer Guide for ASFCS 4.1 Releas</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1088</para>
+                            </entry>
+                            <entry>
+                                <para>EnableStaticNat error will clear the data in databas</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1094</para>
+                            </entry>
+                            <entry>
+                                <para>Ipv6 - hostname/hostname --fqdn does not return the name of the VM. But i am able to reach the Vm using their names</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1095</para>
+                            </entry>
+                            <entry>
+                                <para>Ipv6 - dhclient command needs to be run manually on the Vms to get the Ipv6 address</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1100</para>
+                            </entry>
+                            <entry>
+                                <para>Expunge thread is not kicked off based on global configuration if the global setting is less than 60 second</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1103</para>
+                            </entry>
+                            <entry>
+                                <para>"IpV6 - listNetwork() command does not retrun gateway,netmask,cidr</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1104</para>
+                            </entry>
+                            <entry>
+                                <para>Ipv6 - listVlanIpRanges() returns error 530</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1105</para>
+                            </entry>
+                            <entry>
+                                <para>"IpV6 - listVirtualMachines() does not return netmask, gateway,ipaddress.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1107</para>
+                            </entry>
+                            <entry>
+                                <para>Ipv6 - Unable to extend Ip range for a Ipv6 network using craeteVlanIpRange() command - Error code 530 returned</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1108</para>
+                            </entry>
+                            <entry>
+                                <para>Ipv6 - Not able to restart Networks</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1109</para>
+                            </entry>
+                            <entry>
+                                <para>"Ipv6 - Unable to expunge User Vms that are ""Destroyed"".</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1111</para>
+                            </entry>
+                            <entry>
+                                <para>Ipv6 - listRouters() does not return guestipaddress</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1112</para>
+                            </entry>
+                            <entry>
+                                <para>"Errors in ""Prepare the System VM Template""</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1113</para>
+                            </entry>
+                            <entry>
+                                <para>"Ipv6 - Not able to deploy a new VM in this network because of ""Unable to allocate Unique Ipv6 address""</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1114</para>
+                            </entry>
+                            <entry>
+                                <para>unable to execute listegressfirewallrules API due invalid value i</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1115</para>
+                            </entry>
+                            <entry>
+                                <para>In multiple shared network unable to login with default nic - KV</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1123</para>
+                            </entry>
+                            <entry>
+                                <para>ListStoragePools API broken by refacto</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1138</para>
+                            </entry>
+                            <entry>
+                                <para>"Providing invalid values for gateway, netmask etc in the zoneWizard blocks the VLAN container to load, throwing an error</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1139</para>
+                            </entry>
+                            <entry>
+                                <para>"After the Vm is "Expunged" we see the entry still being present in the router in /etc/dhcphosts.txt</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1141</para>
+                            </entry>
+                            <entry>
+                                <para>"Ipv6 - After network restart (and reboot router), we do not see the existing vms dnsentries not being programmed in the router.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1152</para>
+                            </entry>
+                            <entry>
+                                <para>Missing tag in host-add.xm</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1153</para>
+                            </entry>
+                            <entry>
+                                <para>"Ipv6 - Vm deployment fails with "n must be positive" error.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1154</para>
+                            </entry>
+                            <entry>
+                                <para>Account/Users related API failed due to RegionService inject exception.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1157</para>
+                            </entry>
+                            <entry>
+                                <para>No API Documentation on Listing Custom User Templates Using CS4 API</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1160</para>
+                            </entry>
+                            <entry>
+                                <para>References to version=3.0.3|4|5|6 in API classes needs to be removed.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1161</para>
+                            </entry>
+                            <entry>
+                                <para>Differences between 4.1 and master in ongoing-config-of-external-firewalls-lb.xml</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1163</para>
+                            </entry>
+                            <entry>
+                                <para>Failed with NPE while creating firewall rule</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1168</para>
+                            </entry>
+                            <entry>
+                                <para>Create firewall rule broke</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1173</para>
+                            </entry>
+                            <entry>
+                                <para>ConsoleProxyResource instantiation exception.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1174</para>
+                            </entry>
+                            <entry>
+                                <para>Snapshots related SQL error.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1176</para>
+                            </entry>
+                            <entry>
+                                <para>Issue with snapshots(create/list</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1181</para>
+                            </entry>
+                            <entry>
+                                <para>mvn deploy db failing with NP</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1190</para>
+                            </entry>
+                            <entry>
+                                <para>Make APIChecker interface throw a single sensible exception.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1200</para>
+                            </entry>
+                            <entry>
+                                <para>"Unknown column 'vm_instance.disk_offering_id' in table vm_instance, db exception shown in MS log</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1201</para>
+                            </entry>
+                            <entry>
+                                <para>"Failed to create ssh key for user "cloud" /var/lib/cloud/management/.ssh/id_rsa and failed to start management server</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1202</para>
+                            </entry>
+                            <entry>
+                                <para>Fail to install KVM cloud-agent.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1203</para>
+                            </entry>
+                            <entry>
+                                <para>Fail to create advance zone with SG enabled when UI allows SG enabled option.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1204</para>
+                            </entry>
+                            <entry>
+                                <para>Fail to create advance zone due to fail to add host</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1205</para>
+                            </entry>
+                            <entry>
+                                <para>Ipv6 - Ubuntu 12.10 guest Vms loses default route (after it expiration time ~ 30 mts) when ipv6.autoconfig parameters are disabled except for net.ipv6.conf.lo.autoconf which is enabled.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1206</para>
+                            </entry>
+                            <entry>
+                                <para>Failure in Copy of System template</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1210</para>
+                            </entry>
+                            <entry>
+                                <para>Make all pluggable services return list of api cmd classes</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1216</para>
+                            </entry>
+                            <entry>
+                                <para>UUID is null for admin and failed to register user key with 4.0</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1218</para>
+                            </entry>
+                            <entry>
+                                <para>"IPv6: Shared Network - After network restart with clean option, router is assigned a different address. Name resolution for the existing guest Vms in the network fails.</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1219</para>
+                            </entry>
+                            <entry>
+                                <para>Ipv6 - Provide better error messages when deploying a Vm with Ip an address that is outside the network's ip range / if the ip address already is assigned to another Vm</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1220</para>
+                            </entry>
+                            <entry>
+                                <para>Ipv6 - Better error message when deploy Vm fails to get a free Ip address</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1222</para>
+                            </entry>
+                            <entry>
+                                <para>API rate limit configs: removed double quote in upgrade script</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1223</para>
+                            </entry>
+                            <entry>
+                                <para>Exception while starting jetty server: org.springframework.beans.factory.BeanCreationException Error creating bean with name 'apiServer'</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1224</para>
+                            </entry>
+                            <entry>
+                                <para>Volume snapshot creation failing</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1226</para>
+                            </entry>
+                            <entry>
+                                <para>Error while running Cloudstack-setup-database</para>
+                            </entry>
+                        </row>
+                        <row>
+                            <entry>
+                                <para>CLOUDSTACK-1228</para>
+                            </entry>
+                            <entry>
+                           

<TRUNCATED>

[04/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
nose won't discover the test if it is executable.

Changing test_public_ip_range.py to 644

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/45f852be
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/45f852be
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/45f852be

Branch: refs/heads/ui-vm-affinity
Commit: 45f852bec261c9a05e04c3424bf408859268fef3
Parents: 0b17b62
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Wed Apr 10 17:15:47 2013 +0530
Committer: Likitha Shetty <li...@citrix.com>
Committed: Fri Apr 12 23:27:43 2013 +0530

----------------------------------------------------------------------
 0 files changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/45f852be/test/integration/smoke/test_public_ip_range.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_public_ip_range.py b/test/integration/smoke/test_public_ip_range.py
old mode 100755
new mode 100644


[21/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
Fix a problem where usage server did not start because of a missing db.properties and log4j-cloud.xml


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ae16f332
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ae16f332
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ae16f332

Branch: refs/heads/ui-vm-affinity
Commit: ae16f332132a5eb1e3ff85a0c435dbe25a1d6299
Parents: e7090e6
Author: Hugo Trippaers <ht...@schubergphilis.com>
Authored: Mon Apr 15 15:00:47 2013 +0200
Committer: Hugo Trippaers <ht...@schubergphilis.com>
Committed: Mon Apr 15 15:02:47 2013 +0200

----------------------------------------------------------------------
 packaging/centos63/cloud.spec |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ae16f332/packaging/centos63/cloud.spec
----------------------------------------------------------------------
diff --git a/packaging/centos63/cloud.spec b/packaging/centos63/cloud.spec
index 9ce46c9..c2c6fe7 100644
--- a/packaging/centos63/cloud.spec
+++ b/packaging/centos63/cloud.spec
@@ -278,6 +278,8 @@ cp plugins/hypervisors/kvm/target/dependencies/*  ${RPM_BUILD_ROOT}%{_datadir}/%
 mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/usage
 mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}-usage/lib
 install -D usage/target/cloud-usage-%{_maventag}.jar ${RPM_BUILD_ROOT}%{_datadir}/%{name}-usage/cloud-usage-%{_maventag}.jar
+install -D usage/target/transformed/db.properties ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/usage/db.properties
+install -D usage/target/transformed/log4j-cloud_usage.xml ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/usage/log4j-cloud.xml
 cp usage/target/dependencies/* ${RPM_BUILD_ROOT}%{_datadir}/%{name}-usage/lib/
 install -D packaging/centos63/cloud-usage.rc ${RPM_BUILD_ROOT}/%{_sysconfdir}/init.d/%{name}-usage
 mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/log/%{name}/usage/
@@ -438,6 +440,20 @@ if [ -f "%{_sysconfdir}/cloud.rpmsave/agent/agent.properties" ]; then
     mv %{_sysconfdir}/cloud.rpmsave/agent/agent.properties %{_sysconfdir}/cloud.rpmsave/agent/agent.properties.rpmsave
 fi
 
+%post usage
+if [ -f "%{_sysconfdir}/%{name}/management/db.properties" ]; then
+    echo Replacing db.properties with management server db.properties
+    rm -f %{_sysconfdir}/%{name}/usage/db.properties
+    ln -s %{_sysconfdir}/%{name}/management/db.properties %{_sysconfdir}/%{name}/usage/db.properties
+fi
+
+if [ -f "%{_sysconfdir}/%{name}/management/log4j-cloud.xml" ]; then
+    echo Replacing log4j-cloud.xml with management server log4j-cloud.xml
+    rm -f %{_sysconfdir}/%{name}/usage/log4j-cloud.xml
+    ln -s %{_sysconfdir}/%{name}/management/log4j-cloud.xml %{_sysconfdir}/%{name}/usage/log4j-cloud.xml
+fi
+
+
 #%post awsapi
 #if [ -d "%{_datadir}/%{name}-management" ] ; then
 #   ln -s %{_datadir}/%{name}-bridge/webapps %{_datadir}/%{name}-management/webapps7080
@@ -533,7 +549,8 @@ fi
 %attr(0644,root,root) %{_datadir}/%{name}-usage/*.jar
 %attr(0644,root,root) %{_datadir}/%{name}-usage/lib/*.jar
 %dir /var/log/%{name}/usage
-%dir %{_sysconfdir}/%{name}/usage
+%attr(0644,root,root) %{_sysconfdir}/%{name}/usage/db.properties
+%attr(0644,root,root) %{_sysconfdir}/%{name}/usage/log4j-cloud.xml
 %{_defaultdocdir}/%{name}-usage-%{version}/LICENSE
 %{_defaultdocdir}/%{name}-usage-%{version}/NOTICE
 


[09/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
tools: Add option to specify publican configuration file for building the docs


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c5b10a71
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c5b10a71
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c5b10a71

Branch: refs/heads/ui-vm-affinity
Commit: c5b10a71df67cd03b02ae9eb69fc17f9c7161a0b
Parents: 15c2619
Author: Wido den Hollander <wi...@42on.com>
Authored: Sat Apr 13 11:13:01 2013 +0200
Committer: Wido den Hollander <wi...@42on.com>
Committed: Sat Apr 13 11:13:01 2013 +0200

----------------------------------------------------------------------
 tools/build/build_docs.sh |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c5b10a71/tools/build/build_docs.sh
----------------------------------------------------------------------
diff --git a/tools/build/build_docs.sh b/tools/build/build_docs.sh
index 62617a3..11b2414 100755
--- a/tools/build/build_docs.sh
+++ b/tools/build/build_docs.sh
@@ -20,6 +20,7 @@ sourcedir=~/incubator-cloudstack/
 common_content_dir=/usr/share/publican/Common_Content
 publican_path=/usr/bin/publican
 output_format="html,pdf"
+config="publican-adminguide.cfg"
 
 usage(){
     echo "usage: $0 [-s source dir] [-c publican common content] [-p path to publican]"
@@ -27,10 +28,11 @@ usage(){
     echo "  -c sets the public common content directory (defaults to $common_content_dir)"
     echo "  -p sets the path to the publican binary (defaults to $publican_path)"
     echo "  -f sets the output format (defaults to $output_format)"
-    echo "  -h"
+    echo "  -g sets the publican config file (defaults to $config)"
+    echo "  -h show this help"
 }
 
-while getopts v:s:c:p:f:h opt
+while getopts v:s:c:p:f:g:h opt
 do
     case "$opt" in
       v)  version="$OPTARG";;
@@ -38,6 +40,7 @@ do
       c)  common_content_dir="$OPTARG";;
       p)  publican_path="$OPTARG";;
       f)  output_format="$OPTARG";;
+      g)  config="$OPTARG";;
       h)  usage
           exit 0;;
       \?)
@@ -59,5 +62,5 @@ fi
 cd $sourcedir/docs
 cp -R /usr/share/publican/Common_Content .
 ln -s $sourcedir/docs/publican-cloudstack Common_Content/cloudstack
-publican build --config=publican-installation.cfg --formats $output_format --langs en-US --common_content=$sourcedir/docs/Common_Content
-rm -r Common_Content
\ No newline at end of file
+publican build --config=$config --formats $output_format --langs en-US --common_content=$sourcedir/docs/Common_Content
+rm -r Common_Content


[06/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
Fix CLOUDSTACK-1987: Deleted service offering still shows for domain users. Also extend this fix for Disk offering as well.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4b1a9f14
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4b1a9f14
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4b1a9f14

Branch: refs/heads/ui-vm-affinity
Commit: 4b1a9f146c7316ba885d0889bd10ae09074e1169
Parents: 7b4e195
Author: Min Chen <mi...@citrix.com>
Authored: Fri Apr 12 11:29:16 2013 -0700
Committer: Min Chen <mi...@citrix.com>
Committed: Fri Apr 12 13:47:45 2013 -0700

----------------------------------------------------------------------
 .../src/com/cloud/api/query/QueryManagerImpl.java  |   65 ++++----------
 1 files changed, 19 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4b1a9f14/server/src/com/cloud/api/query/QueryManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java
index ea58427..5ffc2db 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -1941,7 +1941,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
         Boolean isAscending = Boolean.parseBoolean(_configDao.getValue("sortkey.algorithm"));
         isAscending = (isAscending == null ? true : isAscending);
         Filter searchFilter = new Filter(DiskOfferingJoinVO.class, "sortKey", isAscending, cmd.getStartIndex(), cmd.getPageSizeVal());
-        SearchBuilder<DiskOfferingJoinVO> sb = _diskOfferingJoinDao.createSearchBuilder();
+        SearchCriteria<DiskOfferingJoinVO> sc = _diskOfferingJoinDao.createSearchCriteria();
 
 
         Account account = UserContext.current().getCaller();
@@ -1956,9 +1956,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
             if (account.getType() == Account.ACCOUNT_TYPE_ADMIN || isPermissible(account.getDomainId(), domainId) ) {
                 // check if the user's domain == do's domain || user's domain is
                 // a child of so's domain for non-root users
-                sb.and("domainId", sb.entity().getDomainId(), SearchCriteria.Op.EQ);
-                SearchCriteria<DiskOfferingJoinVO> sc = sb.create();
-                sc.setParameters("domainId", domainId);
+                sc.addAnd("domainId", SearchCriteria.Op.EQ, domainId);
                 return _diskOfferingJoinDao.searchAndCount(sc, searchFilter);
             } else {
                     throw new PermissionDeniedException("The account:" + account.getAccountName()
@@ -1966,11 +1964,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
             }
         }
 
-        sb.and("name", sb.entity().getName(), SearchCriteria.Op.LIKE);
-        sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
-
 
-        boolean includePublicOfferings = false;
         List<Long> domainIds = null;
         // For non-root users, only return all offerings for the user's domain, and everything above till root
         if ((account.getType() == Account.ACCOUNT_TYPE_NORMAL || account.getType() == Account.ACCOUNT_TYPE_DOMAIN_ADMIN)
@@ -1987,16 +1981,17 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
                 domainRecord = _domainDao.findById(domainRecord.getParent());
                 domainIds.add(domainRecord.getId());
             }
-            sb.and("domainIdIn", sb.entity().getDomainId(), SearchCriteria.Op.IN);
+            
+            SearchCriteria<DiskOfferingJoinVO> spc = _diskOfferingJoinDao.createSearchCriteria();
 
-            // include also public offering if no keyword, name and id specified
-            if ( keyword == null && name == null && id == null ){
-                includePublicOfferings = true;
-            }
+            spc.addOr("domainId", SearchCriteria.Op.IN, domainIds.toArray());
+            spc.addOr("domainId", SearchCriteria.Op.NULL); // include public offering as where
+            sc.addAnd("domainId", SearchCriteria.Op.SC, spc);
+            sc.addAnd("systemUse", SearchCriteria.Op.EQ, false); // non-root users should not see system offering at all
+            
         }
 
-        SearchCriteria<DiskOfferingJoinVO> sc = sb.create();
-        if (keyword != null) {
+         if (keyword != null) {
             SearchCriteria<DiskOfferingJoinVO> ssc = _diskOfferingJoinDao.createSearchCriteria();
             ssc.addOr("displayText", SearchCriteria.Op.LIKE, "%" + keyword + "%");
             ssc.addOr("name", SearchCriteria.Op.LIKE, "%" + keyword + "%");
@@ -2004,26 +1999,14 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
             sc.addAnd("name", SearchCriteria.Op.SC, ssc);
         }
 
-        if (name != null) {
-            sc.setParameters("name", "%" + name + "%");
-        }
-
         if (id != null) {
-            sc.setParameters("id", id);
-        }
-
-        if (domainIds != null ){
-            sc.setParameters("domainIdIn", domainIds.toArray());
+            sc.addAnd("id", SearchCriteria.Op.EQ, id);
         }
 
-        if (includePublicOfferings){
-            SearchCriteria<DiskOfferingJoinVO> spc = _diskOfferingJoinDao.createSearchCriteria();
-            spc.addAnd("domainId", SearchCriteria.Op.NULL);
-            spc.addAnd("systemUse", SearchCriteria.Op.EQ, false);
-
-            sc.addOr("systemUse", SearchCriteria.Op.SC, spc);
+        if (name != null) {
+            sc.addAnd("name", SearchCriteria.Op.EQ, name);
         }
-
+        
         // FIXME: disk offerings should search back up the hierarchy for
         // available disk offerings...
         /*
@@ -2100,10 +2083,10 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
             }
         }
 
-        boolean includePublicOfferings = false;
+       // boolean includePublicOfferings = false;
         if ((caller.getType() == Account.ACCOUNT_TYPE_NORMAL || caller.getType() == Account.ACCOUNT_TYPE_DOMAIN_ADMIN)
                 || caller.getType() == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN) {
-            // For non-root users
+            // For non-root users. 
             if (isSystem) {
                 throw new InvalidParameterValueException("Only root admins can access system's offering");
             }
@@ -2122,13 +2105,9 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
             SearchCriteria<ServiceOfferingJoinVO> spc = _srvOfferingJoinDao.createSearchCriteria();
 
             spc.addOr("domainId", SearchCriteria.Op.IN, domainIds.toArray());
-            spc.addOr("domainId", SearchCriteria.Op.NULL);
+            spc.addOr("domainId", SearchCriteria.Op.NULL); // include public offering as where
             sc.addAnd("domainId", SearchCriteria.Op.SC, spc);
 
-            // include also public offering if no keyword, name and id specified
-            if ( keyword == null && name == null && id == null ){
-                includePublicOfferings = true;
-            }
         }
         else {
             // for root users
@@ -2171,24 +2150,18 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
         }
 
         if (isSystem != null) {
+            // note that for non-root users, isSystem is always false when control comes to here
             sc.addAnd("systemUse", SearchCriteria.Op.EQ, isSystem);
         }
 
         if (name != null) {
-            sc.addAnd("name", SearchCriteria.Op.LIKE, "%" + name + "%");
+            sc.addAnd("name", SearchCriteria.Op.EQ, name);
         }
 
         if (vmTypeStr != null) {
             sc.addAnd("vm_type", SearchCriteria.Op.EQ, vmTypeStr);
         }
 
-        if (includePublicOfferings){
-            SearchCriteria<ServiceOfferingJoinVO> spc = _srvOfferingJoinDao.createSearchCriteria();
-            spc.addAnd("domainId", SearchCriteria.Op.NULL);
-            spc.addAnd("systemUse", SearchCriteria.Op.EQ, false);
-            sc.addOr("systemUse", SearchCriteria.Op.SC, spc);
-        }
-
         return _srvOfferingJoinDao.searchAndCount(sc, searchFilter);
 
     }


[31/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
CLOUDSTACK-1898: Incorrect time conversion on UI under Events and Alerts


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e22a86f5
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e22a86f5
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e22a86f5

Branch: refs/heads/ui-vm-affinity
Commit: e22a86f57ae0202134022627fe8156218d46fdd9
Parents: abbc7ef
Author: Pranav Saxena <pr...@citrix.com>
Authored: Mon Apr 15 20:53:04 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Mon Apr 15 20:53:04 2013 +0530

----------------------------------------------------------------------
 ui/scripts/sharedFunctions.js |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e22a86f5/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 19e1611..7467531 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -325,7 +325,8 @@ cloudStack.converters = {
 	    if(g_timezoneoffset != null) 
 	      localDate = disconnected.getTimePlusTimezoneOffset(g_timezoneoffset);
 	    else 
-	      localDate = disconnected.getTimePlusTimezoneOffset(0);	 
+	      localDate = disconnected.toUTCString();
+             // localDate = disconnected.getTimePlusTimezoneOffset(0);	 
     }
 		return localDate; 		
 	},


[16/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
Scale UP VM form functionality for choosing a service offering


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/48c1c008
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/48c1c008
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/48c1c008

Branch: refs/heads/ui-vm-affinity
Commit: 48c1c008913b0db7e4fde96dadd119a8ad263a6e
Parents: b0bbffb
Author: Pranav Saxena <pr...@citrix.com>
Authored: Mon Apr 15 11:01:59 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Mon Apr 15 11:01:59 2013 +0530

----------------------------------------------------------------------
 ui/scripts/instances.js |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/48c1c008/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index 1c4c38c..21b58ae 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -1082,9 +1082,36 @@
 
           scaleUp:{
             label:'scaleUp VM',
+            createForm:{
+              title:'Scale UP Virtual Machine',
+              label:'Scale UP Virtual Machine',
+              fields:{
+                  serviceOffering: {
+                  label: 'label.compute.offering',
+                  select: function(args) {
+                    $.ajax({
+                      url: createURL("listServiceOfferings&VirtualMachineId=" + args.context.instances[0].id),
+                      dataType: "json",
+                      async: true,
+                      success: function(json) {
+                        var serviceofferings = json.listserviceofferingsresponse.serviceoffering;
+                        var items = [];
+                        $(serviceofferings).each(function() {
+                          items.push({id: this.id, description: this.displaytext});
+                        });
+                        args.response.success({data: items});
+                      }
+                    });
+                  }
+                }
+
+
+               }
+            },
+
             action: function(args) {
               $.ajax({
-                url: createURL("scaleVirtualMachine&id=" + args.context.instances[0].id + "&serviceofferingid=" + args.context.instances[0].serviceofferingid),
+                url: createURL("scaleVirtualMachine&id=" + args.context.instances[0].id + "&serviceofferingid=" + args.data.serviceOffering),
                 dataType: "json",
                 async: true,
                 success: function(json) {


[03/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
moving the integration test to the smoke folder

The smoke folder is for the bvts and that's where maven+marvin will pick
up the tests tagged for the simulator run.

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/fd84c56b
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/fd84c56b
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/fd84c56b

Branch: refs/heads/ui-vm-affinity
Commit: fd84c56bf96aba134fa2656cf2de525ad4fc2f25
Parents: 8f865c5
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Wed Apr 10 16:22:29 2013 +0530
Committer: Likitha Shetty <li...@citrix.com>
Committed: Fri Apr 12 23:27:42 2013 +0530

----------------------------------------------------------------------
 test/integration/component/test_public_ip_range.py |  173 ---------------
 test/integration/smoke/test_public_ip_range.py     |  173 +++++++++++++++
 2 files changed, 173 insertions(+), 173 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fd84c56b/test/integration/component/test_public_ip_range.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_public_ip_range.py b/test/integration/component/test_public_ip_range.py
deleted file mode 100755
index f2c967f..0000000
--- a/test/integration/component/test_public_ip_range.py
+++ /dev/null
@@ -1,173 +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.
-""" P1 tests for Dedicating Public IP addresses
-"""
-#Import Local Modules
-import marvin
-from nose.plugins.attrib import attr
-from marvin.cloudstackTestCase import *
-from marvin.cloudstackAPI import *
-from marvin.integration.lib.utils import *
-from marvin.integration.lib.base import *
-from marvin.integration.lib.common import *
-import datetime
-
-class Services:
-    """Test Dedicating Public IP addresses
-    """
-
-    def __init__(self):
-        self.services = {
-                        "domain": {
-                                   "name": "Domain",
-                                   },
-                        "account": {
-                                    "email": "test@test.com",
-                                    "firstname": "Test",
-                                    "lastname": "User",
-                                    "username": "test",
-                                    "password": "password",
-                         },
-                        "gateway": "10.102.197.1",
-                        "netmask": "255.255.255.0",
-                        "forvirtualnetwork": "true",
-                        "startip": "10.102.197.70",
-                        "endip": "10.102.197.73",
-                        "zoneid": "1",
-                        "podid": "",
-                        "vlan": "101",
-                    }
-
-class TesDedicatePublicIPRange(cloudstackTestCase):
-
-    @classmethod
-    def setUpClass(cls):
-        cls.api_client = super(TesDedicatePublicIPRange, cls).getClsTestClient().getApiClient()
-        cls.services = Services().services
-        # Get Zone, Domain
-        cls.domain = get_domain(cls.api_client, cls.services)
-        cls.zone = get_zone(cls.api_client, cls.services)
-
-        # Create Account
-        cls.account = Account.create(
-                            cls.api_client,
-                            cls.services["account"],
-                            domainid=cls.domain.id
-                            )
-        cls._cleanup = [
-                        cls.account,
-                        ]
-        return
-
-    @classmethod
-    def tearDownClass(cls):
-        try:
-            # Cleanup resources used
-            cleanup_resources(cls.api_client, cls._cleanup)
-        except Exception as e:
-            raise Exception("Warning: Exception during cleanup : %s" % e)
-        return
-
-    def setUp(self):
-        self.apiclient = self.testClient.getApiClient()
-        self.dbclient = self.testClient.getDbConnection()
-        self.cleanup = []
-        return
-
-    def tearDown(self):
-        try:
-            # Clean up
-            cleanup_resources(self.apiclient, self.cleanup)
-        except Exception as e:
-            raise Exception("Warning: Exception during cleanup : %s" % e)
-        return
-
-    @attr(tags = ["publiciprange", "dedicate", "release"])
-    def test_dedicatePublicIpRange(self):
-        """Test public IP range dedication
-        """
-
-        # Validate the following:
-        # 1. Create a Public IP range
-        # 2. Created IP range should be present, verify with listVlanIpRanges
-        # 3. Dedicate the created IP range to user account
-        # 4. Verify IP range is dedicated, verify with listVlanIpRanges
-        # 5. Release the dedicated Public IP range back to the system
-        # 6. Verify IP range has been released, verify with listVlanIpRanges
-        # 7. Delete the Public IP range
-
-        self.debug("Creating Public IP range")
-        self.public_ip_range = PublicIpRange.create(
-                                    self.api_client,
-                                    self.services
-                               )
-        list_public_ip_range_response = PublicIpRange.list(
-                                            self.apiclient,
-                                            id=self.public_ip_range.vlan.id
-                                        )
-        self.debug(
-                "Verify listPublicIpRanges response for public ip ranges: %s" \
-                % self.public_ip_range.vlan.id
-            )
-        self.assertEqual(
-                         isinstance(list_public_ip_range_response, list),
-                         True,
-                         "Check for list Public IP range response"
-                         )
-        public_ip_response = list_public_ip_range_response[0]
-        self.assertEqual(
-                            public_ip_response.id,
-                            self.public_ip_range.vlan.id,
-                            "Check public ip range response id is in listVlanIpRanges"
-                        )
-
-        self.debug("Dedicating Public IP range");
-        dedicate_public_ip_range_response = PublicIpRange.dedicate(
-                                                self.apiclient,
-                                                self.public_ip_range.vlan.id,
-                                                account=self.account.account.name,
-                                                domainid=self.account.account.domainid
-                                            )
-        list_public_ip_range_response = PublicIpRange.list(
-                                            self.apiclient,
-                                            id=self.public_ip_range.vlan.id
-                                        )
-        public_ip_response = list_public_ip_range_response[0]
-        self.assertEqual(
-                            public_ip_response.account,
-                            self.account.account.name,
-                            "Check account name is in listVlanIpRanges as the account public ip range is dedicated to"
-                        )
-
-        self.debug("Releasing Public IP range");
-        self.public_ip_range.release(self.apiclient)
-        list_public_ip_range_response = PublicIpRange.list(
-                                            self.apiclient,
-                                            id=self.public_ip_range.vlan.id
-                                        )
-        public_ip_response = list_public_ip_range_response[0]
-        self.assertEqual(
-                            public_ip_response.account,
-                            "system",
-                            "Check account name is system account in listVlanIpRanges"
-                        )
-
-        self.debug("Deleting Public IP range");
-        self.public_ip_range.delete(self.apiclient)
-
-        return
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fd84c56b/test/integration/smoke/test_public_ip_range.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_public_ip_range.py b/test/integration/smoke/test_public_ip_range.py
new file mode 100755
index 0000000..a7aad6b
--- /dev/null
+++ b/test/integration/smoke/test_public_ip_range.py
@@ -0,0 +1,173 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+""" P1 tests for Dedicating Public IP addresses
+"""
+#Import Local Modules
+import marvin
+from nose.plugins.attrib import attr
+from marvin.cloudstackTestCase import *
+from marvin.cloudstackAPI import *
+from marvin.integration.lib.utils import *
+from marvin.integration.lib.base import *
+from marvin.integration.lib.common import *
+import datetime
+
+class Services:
+    """Test Dedicating Public IP addresses
+    """
+
+    def __init__(self):
+        self.services = {
+                        "domain": {
+                                   "name": "Domain",
+                                   },
+                        "account": {
+                                    "email": "test@test.com",
+                                    "firstname": "Test",
+                                    "lastname": "User",
+                                    "username": "test",
+                                    "password": "password",
+                         },
+                        "gateway": "10.102.197.1",
+                        "netmask": "255.255.255.0",
+                        "forvirtualnetwork": "true",
+                        "startip": "10.102.197.70",
+                        "endip": "10.102.197.73",
+                        "zoneid": "1",
+                        "podid": "",
+                        "vlan": "101",
+                    }
+
+class TesDedicatePublicIPRange(cloudstackTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        cls.api_client = super(TesDedicatePublicIPRange, cls).getClsTestClient().getApiClient()
+        cls.services = Services().services
+        # Get Zone, Domain
+        cls.domain = get_domain(cls.api_client, cls.services)
+        cls.zone = get_zone(cls.api_client, cls.services)
+
+        # Create Account
+        cls.account = Account.create(
+                            cls.api_client,
+                            cls.services["account"],
+                            domainid=cls.domain.id
+                            )
+        cls._cleanup = [
+                        cls.account,
+                        ]
+        return
+
+    @classmethod
+    def tearDownClass(cls):
+        try:
+            # Cleanup resources used
+            cleanup_resources(cls.api_client, cls._cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
+    def setUp(self):
+        self.apiclient = self.testClient.getApiClient()
+        self.dbclient = self.testClient.getDbConnection()
+        self.cleanup = []
+        return
+
+    def tearDown(self):
+        try:
+            # Clean up
+            cleanup_resources(self.apiclient, self.cleanup)
+        except Exception as e:
+            raise Exception("Warning: Exception during cleanup : %s" % e)
+        return
+
+    @attr(tags = ["simulator", "publiciprange", "dedicate", "release"])
+    def test_dedicatePublicIpRange(self):
+        """Test public IP range dedication
+        """
+
+        # Validate the following:
+        # 1. Create a Public IP range
+        # 2. Created IP range should be present, verify with listVlanIpRanges
+        # 3. Dedicate the created IP range to user account
+        # 4. Verify IP range is dedicated, verify with listVlanIpRanges
+        # 5. Release the dedicated Public IP range back to the system
+        # 6. Verify IP range has been released, verify with listVlanIpRanges
+        # 7. Delete the Public IP range
+
+        self.debug("Creating Public IP range")
+        self.public_ip_range = PublicIpRange.create(
+                                    self.api_client,
+                                    self.services
+                               )
+        list_public_ip_range_response = PublicIpRange.list(
+                                            self.apiclient,
+                                            id=self.public_ip_range.vlan.id
+                                        )
+        self.debug(
+                "Verify listPublicIpRanges response for public ip ranges: %s" \
+                % self.public_ip_range.vlan.id
+            )
+        self.assertEqual(
+                         isinstance(list_public_ip_range_response, list),
+                         True,
+                         "Check for list Public IP range response"
+                         )
+        public_ip_response = list_public_ip_range_response[0]
+        self.assertEqual(
+                            public_ip_response.id,
+                            self.public_ip_range.vlan.id,
+                            "Check public ip range response id is in listVlanIpRanges"
+                        )
+
+        self.debug("Dedicating Public IP range");
+        dedicate_public_ip_range_response = PublicIpRange.dedicate(
+                                                self.apiclient,
+                                                self.public_ip_range.vlan.id,
+                                                account=self.account.account.name,
+                                                domainid=self.account.account.domainid
+                                            )
+        list_public_ip_range_response = PublicIpRange.list(
+                                            self.apiclient,
+                                            id=self.public_ip_range.vlan.id
+                                        )
+        public_ip_response = list_public_ip_range_response[0]
+        self.assertEqual(
+                            public_ip_response.account,
+                            self.account.account.name,
+                            "Check account name is in listVlanIpRanges as the account public ip range is dedicated to"
+                        )
+
+        self.debug("Releasing Public IP range");
+        self.public_ip_range.release(self.apiclient)
+        list_public_ip_range_response = PublicIpRange.list(
+                                            self.apiclient,
+                                            id=self.public_ip_range.vlan.id
+                                        )
+        public_ip_response = list_public_ip_range_response[0]
+        self.assertEqual(
+                            public_ip_response.account,
+                            "system",
+                            "Check account name is system account in listVlanIpRanges"
+                        )
+
+        self.debug("Deleting Public IP range");
+        self.public_ip_range.delete(self.apiclient)
+
+        return
+


[13/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
CLOUDSTACK-312: enable L4-L7 network services in the shared network in
the advanced zone

Squashed commit of the following:

commit 3021cb917b2446f6a04f6cbb01bc56ebc5484bff
Merge: 77c6991 886fe01
Author: Murali Reddy <mu...@citrix.com>
Date:   Sun Apr 14 17:22:05 2013 +0530

    Merge branch 'master' into sharednetworkservices

commit 77c69918be5f15656a95fc325da9f0c99a08e782
Author: Murali Reddy <mu...@citrix.com>
Date:   Tue Apr 9 17:16:57 2013 +0530

    Trying to fit both isolated and shared network life cycle with single state
    machine may need addtional work. So set network state for shared network explicitly now.

commit 365ed73a0c10a5e445be34b6e6c5d99e1224a537
Author: Murali Reddy <mu...@citrix.com>
Date:   Tue Apr 2 17:14:11 2013 +0530

    - associateIpAddress API to associate a public IP with shared network
    - shared network with services to go through the implement and shutwdon
      phases


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/bc3e184b
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/bc3e184b
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/bc3e184b

Branch: refs/heads/ui-vm-affinity
Commit: bc3e184b7273da605177b0ac4ed7186f7fa36fbd
Parents: 886fe01
Author: Murali Reddy <mu...@citrix.com>
Authored: Sun Apr 14 17:50:15 2013 +0530
Committer: Murali Reddy <mu...@citrix.com>
Committed: Sun Apr 14 17:50:15 2013 +0530

----------------------------------------------------------------------
 api/src/com/cloud/network/NetworkService.java      |    2 +-
 .../command/user/address/AssociateIPAddrCmd.java   |   31 +--
 .../element/F5ExternalLoadBalancerElement.java     |   15 +-
 .../element/JuniperSRXExternalFirewallElement.java |   58 +---
 .../cloud/network/element/NetscalerElement.java    |    3 +-
 .../src/com/cloud/network/NetworkManagerImpl.java  |  272 +++++++--------
 .../src/com/cloud/network/NetworkServiceImpl.java  |  100 +++---
 .../com/cloud/network/MockNetworkManagerImpl.java  |   38 +--
 .../test/com/cloud/vpc/MockNetworkManagerImpl.java |   54 +--
 9 files changed, 242 insertions(+), 331 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bc3e184b/api/src/com/cloud/network/NetworkService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/NetworkService.java b/api/src/com/cloud/network/NetworkService.java
index ab6d7bf..066009b 100755
--- a/api/src/com/cloud/network/NetworkService.java
+++ b/api/src/com/cloud/network/NetworkService.java
@@ -46,7 +46,7 @@ public interface NetworkService {
 
     List<? extends Network> getIsolatedNetworksOwnedByAccountInZone(long zoneId, Account owner);
 
-    IpAddress allocateIP(Account ipOwner, boolean isSystem, long zoneId) throws ResourceAllocationException,
+    IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId) throws ResourceAllocationException,
         InsufficientAddressCapacityException, ConcurrentOperationException;
 
     boolean releaseIpAddress(long ipAddressId) throws InsufficientAddressCapacityException;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bc3e184b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
index 406f782..28fbae4 100644
--- a/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
@@ -16,38 +16,21 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.address;
 
-import java.util.List;
-
-import org.apache.cloudstack.api.APICommand;
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.ApiErrorCode;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.BaseAsyncCreateCmd;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import org.apache.cloudstack.api.response.DomainResponse;
-import org.apache.cloudstack.api.response.IPAddressResponse;
-import org.apache.cloudstack.api.response.NetworkResponse;
-import org.apache.cloudstack.api.response.ProjectResponse;
-import org.apache.cloudstack.api.response.VpcResponse;
-import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
-
 import com.cloud.async.AsyncJob;
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.DataCenter.NetworkType;
 import com.cloud.event.EventTypes;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientAddressCapacityException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.exception.*;
 import com.cloud.network.IpAddress;
 import com.cloud.network.Network;
 import com.cloud.network.vpc.Vpc;
 import com.cloud.user.Account;
 import com.cloud.user.UserContext;
+import org.apache.cloudstack.api.*;
+import org.apache.cloudstack.api.response.*;
+import org.apache.log4j.Logger;
+
+import java.util.List;
 
 @APICommand(name = "associateIpAddress", description="Acquires and associates a public IP to an account.", responseObject=IPAddressResponse.class)
 public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
@@ -213,7 +196,7 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
     @Override
     public void create() throws ResourceAllocationException{
         try {
-            IpAddress ip =  _networkService.allocateIP(_accountService.getAccount(getEntityOwnerId()), false, getZoneId());
+            IpAddress ip =  _networkService.allocateIP(_accountService.getAccount(getEntityOwnerId()),  getZoneId(), getNetworkId());
 
             if (ip != null) {
                 this.setEntityId(ip.getId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bc3e184b/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java b/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java
index 77f6b60..e384e3c 100644
--- a/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java
+++ b/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java
@@ -16,19 +16,6 @@
 // under the License.
 package com.cloud.network.element;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-
-import org.apache.cloudstack.api.response.ExternalLoadBalancerResponse;
-import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice;
-import org.apache.log4j.Logger;
-
 import com.cloud.agent.api.to.LoadBalancerTO;
 import com.cloud.api.ApiDBUtils;
 import com.cloud.api.commands.*;
@@ -101,7 +88,7 @@ public class F5ExternalLoadBalancerElement extends ExternalLoadBalancerDeviceMan
     ConfigurationDao _configDao;
 
     private boolean canHandle(Network config) {
-        if (config.getGuestType() != Network.GuestType.Isolated || config.getTrafficType() != TrafficType.Guest) {
+        if ((config.getGuestType() != Network.GuestType.Isolated && config.getGuestType() != Network.GuestType.Shared) || config.getTrafficType() != TrafficType.Guest) {
             s_logger.trace("Not handling network with Type  " + config.getGuestType() + " and traffic type " + config.getTrafficType());
             return false;
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bc3e184b/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java b/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java
index 64b0f5a..a429306 100644
--- a/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java
+++ b/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java
@@ -16,28 +16,8 @@
 // under the License.
 package com.cloud.network.element;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-
-import org.apache.cloudstack.api.response.ExternalFirewallResponse;
-import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice;
-import org.apache.log4j.Logger;
-
 import com.cloud.api.ApiDBUtils;
-import com.cloud.api.commands.AddExternalFirewallCmd;
-import com.cloud.api.commands.AddSrxFirewallCmd;
-import com.cloud.api.commands.ConfigureSrxFirewallCmd;
-import com.cloud.api.commands.DeleteExternalFirewallCmd;
-import com.cloud.api.commands.DeleteSrxFirewallCmd;
-import com.cloud.api.commands.ListExternalFirewallsCmd;
-import com.cloud.api.commands.ListSrxFirewallNetworksCmd;
-import com.cloud.api.commands.ListSrxFirewallsCmd;
+import com.cloud.api.commands.*;
 import com.cloud.api.response.SrxFirewallResponse;
 import com.cloud.configuration.Config;
 import com.cloud.configuration.ConfigurationManager;
@@ -47,35 +27,16 @@ import com.cloud.dc.DataCenter.NetworkType;
 import com.cloud.dc.DataCenterVO;
 import com.cloud.dc.dao.DataCenterDao;
 import com.cloud.deploy.DeployDestination;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.InsufficientNetworkCapacityException;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.exception.*;
 import com.cloud.host.Host;
 import com.cloud.host.HostVO;
 import com.cloud.host.dao.HostDao;
 import com.cloud.host.dao.HostDetailsDao;
-import com.cloud.network.ExternalFirewallDeviceManagerImpl;
-import com.cloud.network.Network;
+import com.cloud.network.*;
 import com.cloud.network.Network.Capability;
 import com.cloud.network.Network.Provider;
 import com.cloud.network.Network.Service;
-import com.cloud.network.NetworkModel;
-import com.cloud.network.PhysicalNetwork;
-import com.cloud.network.PhysicalNetworkServiceProvider;
-import com.cloud.network.PublicIpAddress;
-import com.cloud.network.RemoteAccessVpn;
-import com.cloud.network.VpnUser;
-import com.cloud.network.dao.ExternalFirewallDeviceDao;
-import com.cloud.network.dao.ExternalFirewallDeviceVO;
-import com.cloud.network.dao.NetworkDao;
-import com.cloud.network.dao.NetworkExternalFirewallDao;
-import com.cloud.network.dao.NetworkExternalFirewallVO;
-import com.cloud.network.dao.NetworkServiceMapDao;
-import com.cloud.network.dao.NetworkVO;
-import com.cloud.network.dao.PhysicalNetworkDao;
-import com.cloud.network.dao.PhysicalNetworkVO;
+import com.cloud.network.dao.*;
 import com.cloud.network.dao.ExternalFirewallDeviceVO.FirewallDeviceState;
 import com.cloud.network.resource.JuniperSrxResource;
 import com.cloud.network.rules.FirewallRule;
@@ -89,6 +50,13 @@ import com.cloud.vm.NicProfile;
 import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
+import org.apache.cloudstack.api.response.ExternalFirewallResponse;
+import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice;
+import org.apache.log4j.Logger;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import java.util.*;
 
 @Local(value = {NetworkElement.class, FirewallServiceProvider.class, 
         PortForwardingServiceProvider.class, IpDeployer.class, 
@@ -129,7 +97,9 @@ PortForwardingServiceProvider, RemoteAccessVPNServiceProvider, IpDeployer, Junip
 
     private boolean canHandle(Network network, Service service) {
         DataCenter zone = _configMgr.getZone(network.getDataCenterId());
-        if ((zone.getNetworkType() == NetworkType.Advanced && network.getGuestType() != Network.GuestType.Isolated) || (zone.getNetworkType() == NetworkType.Basic && network.getGuestType() != Network.GuestType.Shared)) {
+        if ((zone.getNetworkType() == NetworkType.Advanced && !(network.getGuestType() == Network.GuestType.Isolated ||
+                network.getGuestType() == Network.GuestType.Shared )) ||
+                (zone.getNetworkType() == NetworkType.Basic && network.getGuestType() != Network.GuestType.Shared)) {
             s_logger.trace("Element " + getProvider().getName() + "is not handling network type = " + network.getGuestType());
             return false;
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bc3e184b/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java b/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java
index 17bb7cc..2bbdb04 100644
--- a/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java
+++ b/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java
@@ -124,7 +124,8 @@ public class NetscalerElement extends ExternalLoadBalancerDeviceManagerImpl impl
 
     private boolean canHandle(Network config, Service service) {
         DataCenter zone = _dcDao.findById(config.getDataCenterId());
-        boolean handleInAdvanceZone = (zone.getNetworkType() == NetworkType.Advanced && config.getGuestType() == Network.GuestType.Isolated && config.getTrafficType() == TrafficType.Guest);
+        boolean handleInAdvanceZone = (zone.getNetworkType() == NetworkType.Advanced &&
+                (config.getGuestType() == Network.GuestType.Isolated || config.getGuestType() == Network.GuestType.Shared) && config.getTrafficType() == TrafficType.Guest);
         boolean handleInBasicZone = (zone.getNetworkType() == NetworkType.Basic && config.getGuestType() == Network.GuestType.Shared && config.getTrafficType() == TrafficType.Guest);
 
         if (!(handleInAdvanceZone || handleInBasicZone)) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bc3e184b/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index 5b60466..7332ef3 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -16,42 +16,9 @@
 // under the License.
 package com.cloud.network;
 
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.Set;
-import java.util.UUID;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import org.apache.cloudstack.acl.ControlledEntity.ACLType;
-import org.apache.cloudstack.acl.SecurityChecker.AccessType;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.Listener;
-import com.cloud.agent.api.AgentControlAnswer;
-import com.cloud.agent.api.AgentControlCommand;
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.CheckNetworkAnswer;
-import com.cloud.agent.api.CheckNetworkCommand;
-import com.cloud.agent.api.Command;
-import com.cloud.agent.api.StartupCommand;
-import com.cloud.agent.api.StartupRoutingCommand;
+import com.cloud.agent.api.*;
 import com.cloud.agent.api.to.NicTO;
 import com.cloud.alert.AlertManager;
 import com.cloud.api.ApiDBUtils;
@@ -59,15 +26,9 @@ import com.cloud.configuration.Config;
 import com.cloud.configuration.ConfigurationManager;
 import com.cloud.configuration.Resource.ResourceType;
 import com.cloud.configuration.dao.ConfigurationDao;
-import com.cloud.dc.AccountVlanMapVO;
-import com.cloud.dc.DataCenter;
+import com.cloud.dc.*;
 import com.cloud.dc.DataCenter.NetworkType;
-import com.cloud.dc.DataCenterVO;
-import com.cloud.dc.Pod;
-import com.cloud.dc.PodVlanMapVO;
-import com.cloud.dc.Vlan;
 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.PodVlanMapDao;
@@ -80,66 +41,25 @@ import com.cloud.domain.dao.DomainDao;
 import com.cloud.event.EventTypes;
 import com.cloud.event.UsageEventUtils;
 import com.cloud.event.dao.UsageEventDao;
-import com.cloud.exception.AccountLimitException;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.ConnectionException;
-import com.cloud.exception.InsufficientAddressCapacityException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.InsufficientVirtualNetworkCapcityException;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.PermissionDeniedException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.exception.UnsupportedServiceException;
+import com.cloud.exception.*;
 import com.cloud.host.Host;
 import com.cloud.host.HostVO;
 import com.cloud.host.Status;
 import com.cloud.host.dao.HostDao;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.network.IpAddress.State;
-import com.cloud.network.Network.Capability;
-import com.cloud.network.Network.Event;
-import com.cloud.network.Network.GuestType;
-import com.cloud.network.Network.Provider;
-import com.cloud.network.Network.Service;
+import com.cloud.network.Network.*;
 import com.cloud.network.Networks.AddressFormat;
 import com.cloud.network.Networks.BroadcastDomainType;
 import com.cloud.network.Networks.IsolationType;
 import com.cloud.network.Networks.TrafficType;
 import com.cloud.network.addr.PublicIp;
-import com.cloud.network.dao.FirewallRulesDao;
-import com.cloud.network.dao.IPAddressDao;
-import com.cloud.network.dao.IPAddressVO;
-import com.cloud.network.dao.LoadBalancerDao;
-import com.cloud.network.dao.NetworkDao;
-import com.cloud.network.dao.NetworkDomainDao;
-import com.cloud.network.dao.NetworkServiceMapDao;
-import com.cloud.network.dao.NetworkServiceMapVO;
-import com.cloud.network.dao.NetworkVO;
-import com.cloud.network.dao.PhysicalNetworkDao;
-import com.cloud.network.dao.PhysicalNetworkServiceProviderDao;
-import com.cloud.network.dao.PhysicalNetworkTrafficTypeDao;
-import com.cloud.network.dao.PhysicalNetworkTrafficTypeVO;
-import com.cloud.network.dao.PhysicalNetworkVO;
-import com.cloud.network.dao.UserIpv6AddressDao;
-import com.cloud.network.element.DhcpServiceProvider;
-import com.cloud.network.element.IpDeployer;
-import com.cloud.network.element.IpDeployingRequester;
-import com.cloud.network.element.LoadBalancingServiceProvider;
-import com.cloud.network.element.NetworkElement;
-import com.cloud.network.element.StaticNatServiceProvider;
-import com.cloud.network.element.UserDataServiceProvider;
+import com.cloud.network.dao.*;
+import com.cloud.network.element.*;
 import com.cloud.network.guru.NetworkGuru;
 import com.cloud.network.lb.LoadBalancingRulesManager;
-import com.cloud.network.rules.FirewallManager;
-import com.cloud.network.rules.FirewallRule;
+import com.cloud.network.rules.*;
 import com.cloud.network.rules.FirewallRule.Purpose;
-import com.cloud.network.rules.FirewallRuleVO;
-import com.cloud.network.rules.PortForwardingRuleVO;
-import com.cloud.network.rules.RulesManager;
-import com.cloud.network.rules.StaticNat;
-import com.cloud.network.rules.StaticNatRule;
-import com.cloud.network.rules.StaticNatRuleImpl;
 import com.cloud.network.rules.dao.PortForwardingRulesDao;
 import com.cloud.network.vpc.NetworkACLManager;
 import com.cloud.network.vpc.VpcManager;
@@ -152,49 +72,40 @@ import com.cloud.offerings.NetworkOfferingVO;
 import com.cloud.offerings.dao.NetworkOfferingDao;
 import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
 import com.cloud.org.Grouping;
-import com.cloud.user.Account;
-import com.cloud.user.AccountManager;
-import com.cloud.user.ResourceLimitService;
-import com.cloud.user.User;
-import com.cloud.user.UserContext;
-import com.cloud.user.UserVO;
+import com.cloud.user.*;
 import com.cloud.user.dao.AccountDao;
 import com.cloud.user.dao.UserDao;
 import com.cloud.utils.Journal;
 import com.cloud.utils.NumbersUtil;
 import com.cloud.utils.Pair;
 import com.cloud.utils.component.AdapterBase;
-import com.cloud.utils.component.ComponentContext;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.concurrency.NamedThreadFactory;
-import com.cloud.utils.db.DB;
-import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.*;
 import com.cloud.utils.db.JoinBuilder.JoinType;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
 import com.cloud.utils.db.SearchCriteria.Op;
-import com.cloud.utils.db.Transaction;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.fsm.NoTransitionException;
 import com.cloud.utils.fsm.StateMachine2;
 import com.cloud.utils.net.Ip;
 import com.cloud.utils.net.NetUtils;
-import com.cloud.vm.Nic;
+import com.cloud.vm.*;
 import com.cloud.vm.Nic.ReservationStrategy;
-import com.cloud.vm.NicProfile;
-import com.cloud.vm.NicVO;
-import com.cloud.vm.ReservationContext;
-import com.cloud.vm.ReservationContextImpl;
-import com.cloud.vm.UserVmVO;
-import com.cloud.vm.VMInstanceVO;
-import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachine.Type;
-import com.cloud.vm.VirtualMachineProfile;
-import com.cloud.vm.dao.NicDao;
-import com.cloud.vm.dao.NicSecondaryIpDao;
-import com.cloud.vm.dao.NicSecondaryIpVO;
-import com.cloud.vm.dao.UserVmDao;
-import com.cloud.vm.dao.VMInstanceDao;
+import com.cloud.vm.dao.*;
+import org.apache.cloudstack.acl.ControlledEntity.ACLType;
+import org.apache.cloudstack.acl.SecurityChecker.AccessType;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+import java.net.URI;
+import java.util.*;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
 
 /**
  * NetworkManagerImpl implements NetworkManager.
@@ -663,7 +574,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
 
     @DB
     @Override
-    public IpAddress allocateIp(Account ipOwner, boolean isSystem, Account caller, long callerUserId, DataCenter zone) 
+    public IpAddress allocateIp(Account ipOwner, boolean isSystem, Account caller, long callerUserId, DataCenter zone)
             throws ConcurrentOperationException, ResourceAllocationException,
             InsufficientAddressCapacityException {
 
@@ -788,7 +699,22 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
 
         IPAddressVO ipToAssoc = _ipAddressDao.findById(ipId);
         if (ipToAssoc != null) {
-            _accountMgr.checkAccess(caller, null, true, ipToAssoc);
+            Network network = _networksDao.findById(networkId);
+            if (network == null) {
+                throw new InvalidParameterValueException("Invalid network id is given");
+            }
+
+            DataCenter zone = _configMgr.getZone(network.getDataCenterId());
+            if (network.getGuestType() == Network.GuestType.Shared && zone.getNetworkType() == NetworkType.Advanced) {
+                if (isSharedNetworkOfferingWithServices(network.getNetworkOfferingId())) {
+                    _accountMgr.checkAccess(UserContext.current().getCaller(), AccessType.UseNetwork, false, network);
+                } else {
+                    throw new InvalidParameterValueException("IP can be associated with guest network of 'shared' type only if " +
+                        "network services Source Nat, Static Nat, Port Forwarding, Load balancing, firewall are enabled in the network");
+                }
+            } else {
+                _accountMgr.checkAccess(caller, null, true, ipToAssoc);
+            }
             owner = _accountMgr.getAccount(ipToAssoc.getAllocatedToAccountId());
         } else {
             s_logger.debug("Unable to find ip address by id: " + ipId);
@@ -815,16 +741,21 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
             throw new InvalidParameterValueException("Ip address can be associated to the network with trafficType " + TrafficType.Guest);
         }
 
-        // Check that network belongs to IP owner - skip this check for Basic zone as there is just one guest network,
-        // and it belongs to the system
-        if (zone.getNetworkType() != NetworkType.Basic && network.getAccountId() != owner.getId()) {
-            throw new InvalidParameterValueException("The owner of the network is not the same as owner of the IP");
+        // Check that network belongs to IP owner - skip this check
+        //     - if zone is basic zone as there is just one guest network,
+        //     - if shared network in Advanced zone
+        //     - and it belongs to the system
+        if (network.getAccountId() != owner.getId()) {
+            if (zone.getNetworkType() != NetworkType.Basic && !(zone.getNetworkType() == NetworkType.Advanced && network.getGuestType() == Network.GuestType.Shared)) {
+                throw new InvalidParameterValueException("The owner of the network is not the same as owner of the IP");
+            }
         }
 
-        // In Advance zone only allow to do IP assoc for Isolated networks with source nat service enabled
+        // In Advance zone only allow to do IP assoc
+        //      - for Isolated networks with source nat service enabled
+        //      - for shared networks with source nat service enabled
         if (zone.getNetworkType() == NetworkType.Advanced &&
-            !(network.getGuestType() == GuestType.Isolated && _networkModel.areServicesSupportedInNetwork(network.getId(),
-                Service.SourceNat))) {
+            !(_networkModel.areServicesSupportedInNetwork(network.getId(), Service.SourceNat))) {
             throw new InvalidParameterValueException("In zone of type " + NetworkType.Advanced +
                     " ip address can be associated only to the network of guest type " + GuestType.Isolated + " with the "
                     + Service.SourceNat.getName() + " enabled");
@@ -1496,12 +1427,21 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
         try {
             NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus, network.getGuruName());
             Network.State state = network.getState();
-            if (state == Network.State.Implemented || state == Network.State.Setup || state == Network.State.Implementing) {
+            if (state == Network.State.Implemented || state == Network.State.Implementing) {
                 s_logger.debug("Network id=" + networkId + " is already implemented");
                 implemented.set(guru, network);
                 return implemented;
             }
 
+            if (state == Network.State.Setup) {
+                DataCenterVO zone = _dcDao.findById(network.getDataCenterId());
+                if (!isSharedNetworkOfferingWithServices(network.getNetworkOfferingId()) || (zone.getNetworkType() == NetworkType.Basic)) {
+                    s_logger.debug("Network id=" + networkId + " is already implemented");
+                    implemented.set(guru, network);
+                    return implemented;
+                }
+            }
+
             if (s_logger.isDebugEnabled()) {
                 s_logger.debug("Asking " + guru.getName() + " to implement " + network);
             }
@@ -1509,7 +1449,11 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
             NetworkOfferingVO offering = _networkOfferingDao.findById(network.getNetworkOfferingId());
 
             network.setReservationId(context.getReservationId());
-            stateTransitTo(network, Event.ImplementNetwork);
+            if (isSharedNetworkWithServices(network)) {
+                network.setState(Network.State.Implementing);
+            } else {
+                stateTransitTo(network, Event.ImplementNetwork);
+            }
 
             Network result = guru.implement(network, offering, dest, context);
             network.setCidr(result.getCidr());
@@ -1522,7 +1466,11 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
             // implement network elements and re-apply all the network rules
             implementNetworkElementsAndResources(dest, context, network, offering);
 
-            stateTransitTo(network,Event.OperationSucceeded);
+            if (isSharedNetworkWithServices(network)) {
+                network.setState(Network.State.Implemented);
+            } else {
+                stateTransitTo(network,Event.OperationSucceeded);
+            }
 
             network.setRestartRequired(false);
             _networksDao.update(network.getId(), network);
@@ -1535,7 +1483,12 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
             if (implemented.first() == null) {
                 s_logger.debug("Cleaning up because we're unable to implement the network " + network);
                 try {
-                    stateTransitTo(network,Event.OperationFailed);
+                    if (isSharedNetworkWithServices(network)) {
+                        network.setState(Network.State.Shutdown);
+                        _networksDao.update(networkId, network);
+                    } else {
+                        stateTransitTo(network,Event.OperationFailed);
+                    }
                 } catch (NoTransitionException e) {
                     s_logger.error(e.getMessage());
                 }
@@ -1560,14 +1513,17 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
                                                       NetworkVO network, NetworkOfferingVO offering)
             throws ConcurrentOperationException, InsufficientAddressCapacityException, ResourceUnavailableException, InsufficientCapacityException {
 
-        // If this is a 1) guest virtual network 2) network has sourceNat service 3) network offering does not support a
-        // Shared source NAT rule,
-        // associate a source NAT IP (if one isn't already associated with the network)
+        // Associate a source NAT IP (if one isn't already associated with the network) if this is a
+        //     1) 'Isolated' or 'Shared' guest virtual network in the advance zone
+        //     2) network has sourceNat service
+        //     3) network offering does not support a shared source NAT rule
 
         boolean sharedSourceNat = offering.getSharedSourceNat();
-        if (network.getGuestType() == Network.GuestType.Isolated
-               && _networkModel.areServicesSupportedInNetwork(network.getId(), Service.SourceNat)
-               && !sharedSourceNat) {
+        DataCenter zone = _dcDao.findById(network.getDataCenterId());
+
+        if (!sharedSourceNat && _networkModel.areServicesSupportedInNetwork(network.getId(), Service.SourceNat)
+                && (network.getGuestType() == Network.GuestType.Isolated ||
+                (network.getGuestType() == Network.GuestType.Shared && zone.getNetworkType() == NetworkType.Advanced))) {
 
             List<IPAddressVO> ips = null;
             if (network.getVpcId() != null) {
@@ -2031,10 +1987,12 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
                 throw new InvalidParameterValueException("Network with vlan " + vlanId + " already exists in zone " + zoneId);
             }
             } else {
-                //don't allow to create Shared network with Vlan that already exists in the zone for Isolated networks
-                if (_networksDao.countByZoneUriAndGuestType(zoneId, uri, GuestType.Isolated) > 0) {
-                    throw new InvalidParameterValueException("Isolated network with vlan " + vlanId + " already exists " +
-                            "in zone " + zoneId);
+                // don't allow to creating shared network with given Vlan ID, if there already exists a isolated network or
+                // shared network with same Vlan ID in the zone
+                if (_networksDao.countByZoneUriAndGuestType(zoneId, uri, GuestType.Isolated) > 0 ||
+                        _networksDao.countByZoneUriAndGuestType(zoneId, uri, GuestType.Shared) > 0) {
+                    throw new InvalidParameterValueException("There is a isolated/shared network with vlan id: " +
+                            vlanId + " already exists " + "in zone " + zoneId);
                 }
         }
         }
@@ -2166,6 +2124,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
     @DB
     public boolean shutdownNetwork(long networkId, ReservationContext context, boolean cleanupElements) {
         boolean result = false;
+        Transaction txn = Transaction.currentTxn();
 
         NetworkVO network = _networksDao.lockRow(networkId, true);
         if (network == null) {
@@ -2176,16 +2135,23 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
             s_logger.debug("Network is not implemented: " + network);
             return false;
         }
-        try {
-            stateTransitTo(network, Event.DestroyNetwork);
-        } catch (NoTransitionException e) {
+
+        txn.start();
+        if (isSharedNetworkWithServices(network)) {
             network.setState(Network.State.Shutdown);
             _networksDao.update(network.getId(), network);
+        } else {
+            try {
+                stateTransitTo(network, Event.DestroyNetwork);
+            } catch (NoTransitionException e) {
+                network.setState(Network.State.Shutdown);
+                _networksDao.update(network.getId(), network);
+            }
         }
+        txn.commit();
 
         boolean success = shutdownNetworkElementsAndResources(context, cleanupElements, network);
 
-        Transaction txn = Transaction.currentTxn();
         txn.start();
         if (success) {
             if (s_logger.isDebugEnabled()) {
@@ -2196,11 +2162,16 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
             guru.shutdown(profile, _networkOfferingDao.findById(network.getNetworkOfferingId()));
 
             applyProfileToNetwork(network, profile);
-            try {
-                stateTransitTo(network, Event.OperationSucceeded);
-            } catch (NoTransitionException e) {
-                network.setState(Network.State.Allocated);
-                network.setRestartRequired(false);
+            DataCenterVO zone = _dcDao.findById(network.getDataCenterId());
+            if (isSharedNetworkOfferingWithServices(network.getNetworkOfferingId()) && (zone.getNetworkType() == NetworkType.Advanced)) {
+                network.setState(Network.State.Setup);
+            } else {
+                try {
+                    stateTransitTo(network, Event.OperationSucceeded);
+                } catch (NoTransitionException e) {
+                    network.setState(Network.State.Allocated);
+                    network.setRestartRequired(false);
+                }
             }
             _networksDao.update(network.getId(), network);
             _networksDao.clearCheckForGc(networkId);
@@ -2816,6 +2787,17 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
         return (UserDataServiceProvider)_networkModel.getElementImplementingProvider(SSHKeyProvider);
     }
 
+    protected boolean isSharedNetworkWithServices(Network network) {
+        assert(network != null);
+        DataCenter zone = _configMgr.getZone(network.getDataCenterId());
+        if (network.getGuestType() == Network.GuestType.Shared &&
+                zone.getNetworkType() == NetworkType.Advanced &&
+                isSharedNetworkOfferingWithServices(network.getNetworkOfferingId())) {
+            return true;
+        }
+        return false;
+    }
+
     protected boolean isSharedNetworkOfferingWithServices(long networkOfferingId) {
         NetworkOfferingVO networkOffering = _networkOfferingDao.findById(networkOfferingId);
         if ( (networkOffering.getGuestType()  == Network.GuestType.Shared) && (

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bc3e184b/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index a8cbaa7..70d1d0d 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -16,44 +16,13 @@
 // under the License.
 package com.cloud.network;
 
-import java.net.InetAddress;
-import java.net.Inet6Address;
-import java.net.UnknownHostException;
-import java.security.InvalidParameterException;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import org.apache.cloudstack.acl.ControlledEntity.ACLType;
-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;
-import org.apache.cloudstack.api.command.user.network.ListNetworksCmd;
-import org.apache.cloudstack.api.command.user.network.RestartNetworkCmd;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-import org.apache.cloudstack.api.command.user.vm.ListNicsCmd;
-import org.bouncycastle.util.IPAddress;
-
 import com.cloud.configuration.Config;
 import com.cloud.configuration.ConfigurationManager;
 import com.cloud.configuration.dao.ConfigurationDao;
 import com.cloud.dc.DataCenter;
-import com.cloud.dc.Pod;
 import com.cloud.dc.DataCenter.NetworkType;
 import com.cloud.dc.DataCenterVO;
+import com.cloud.dc.Pod;
 import com.cloud.dc.Vlan.VlanType;
 import com.cloud.dc.VlanVO;
 import com.cloud.dc.dao.AccountVlanMapDao;
@@ -70,10 +39,8 @@ import com.cloud.event.UsageEventUtils;
 import com.cloud.event.dao.EventDao;
 import com.cloud.event.dao.UsageEventDao;
 import com.cloud.exception.*;
-import com.cloud.host.Host;
 import com.cloud.host.dao.HostDao;
 import com.cloud.network.IpAddress.State;
-import com.cloud.vm.Nic;
 import com.cloud.network.Network.Capability;
 import com.cloud.network.Network.GuestType;
 import com.cloud.network.Network.Provider;
@@ -89,10 +56,10 @@ import com.cloud.network.element.VirtualRouterElement;
 import com.cloud.network.element.VpcVirtualRouterElement;
 import com.cloud.network.guru.NetworkGuru;
 import com.cloud.network.rules.FirewallRule.Purpose;
-import com.cloud.network.rules.dao.PortForwardingRulesDao;
 import com.cloud.network.rules.FirewallRuleVO;
 import com.cloud.network.rules.PortForwardingRuleVO;
 import com.cloud.network.rules.RulesManager;
+import com.cloud.network.rules.dao.PortForwardingRulesDao;
 import com.cloud.network.vpc.PrivateIpVO;
 import com.cloud.network.vpc.Vpc;
 import com.cloud.network.vpc.VpcManager;
@@ -114,19 +81,33 @@ import com.cloud.utils.AnnotationHelper;
 import com.cloud.utils.Journal;
 import com.cloud.utils.NumbersUtil;
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.ComponentContext;
-import com.cloud.utils.component.Manager;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.*;
 import com.cloud.utils.db.SearchCriteria.Op;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.net.NetUtils;
 import com.cloud.vm.*;
-import com.cloud.vm.dao.NicDao;
-import com.cloud.vm.dao.NicSecondaryIpDao;
-import com.cloud.vm.dao.NicSecondaryIpVO;
-import com.cloud.vm.dao.UserVmDao;
-import com.cloud.vm.dao.VMInstanceDao;
+import com.cloud.vm.dao.*;
+import org.apache.cloudstack.acl.ControlledEntity.ACLType;
+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;
+import org.apache.cloudstack.api.command.user.network.ListNetworksCmd;
+import org.apache.cloudstack.api.command.user.network.RestartNetworkCmd;
+import org.apache.cloudstack.api.command.user.vm.ListNicsCmd;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.security.InvalidParameterException;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
 import java.util.*;
 
 /**
@@ -433,7 +414,40 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService {
 
     @Override
     @ActionEvent(eventType = EventTypes.EVENT_NET_IP_ASSIGN, eventDescription = "allocating Ip", create = true)
-    public IpAddress allocateIP(Account ipOwner, boolean isSystem, long zoneId) 
+    public IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId)
+             throws ResourceAllocationException, InsufficientAddressCapacityException, ConcurrentOperationException {
+
+        if (networkId != null) {
+            Network network = _networksDao.findById(networkId);
+            if (network == null) {
+                throw new InvalidParameterValueException("Invalid network id is given");
+            }
+            if (network.getGuestType() == Network.GuestType.Shared) {
+                DataCenter zone = _configMgr.getZone(zoneId);
+                if (zone == null) {
+                    throw new InvalidParameterValueException("Invalid zone Id is given");
+                }
+
+                // if shared network in the advanced zone, then check the caller against the network for 'AccessType.UseNetwork'
+                if (isSharedNetworkOfferingWithServices(network.getNetworkOfferingId()) && zone.getNetworkType() == NetworkType.Advanced) {
+                    Account caller = UserContext.current().getCaller();
+                    long callerUserId = UserContext.current().getCallerUserId();
+                    _accountMgr.checkAccess(caller, AccessType.UseNetwork, false, network);
+                    if (s_logger.isDebugEnabled()) {
+                        s_logger.debug("Associate IP address called by the user " + callerUserId + " account " + ipOwner.getId());
+                    }
+                    return _networkMgr.allocateIp(ipOwner, false, caller, callerUserId, zone);
+                } else {
+                    throw new InvalidParameterValueException("Associate IP address can only be called on the shared networks in the advanced zone" +
+                        " with Firewall/Source Nat/Static Nat/Port Forwarding/Load balancing services enabled");
+                }
+            }
+        }
+
+        return allocateIP(ipOwner, false,  zoneId);
+    }
+
+    public IpAddress allocateIP(Account ipOwner, boolean isSystem, long zoneId)
             throws ResourceAllocationException, InsufficientAddressCapacityException, ConcurrentOperationException {
         Account caller = UserContext.current().getCaller();
         // check permissions

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bc3e184b/server/test/com/cloud/network/MockNetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/MockNetworkManagerImpl.java b/server/test/com/cloud/network/MockNetworkManagerImpl.java
index 18eae08..9042f03 100755
--- a/server/test/com/cloud/network/MockNetworkManagerImpl.java
+++ b/server/test/com/cloud/network/MockNetworkManagerImpl.java
@@ -16,33 +16,13 @@
 // under the License.
 package com.cloud.network;
 
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.ejb.Local;
-import javax.naming.ConfigurationException;
-
-import org.apache.cloudstack.acl.ControlledEntity.ACLType;
-import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementorsCmd;
-import org.apache.cloudstack.api.command.user.network.CreateNetworkCmd;
-import org.apache.cloudstack.api.command.user.network.ListNetworksCmd;
-import org.apache.cloudstack.api.command.user.network.RestartNetworkCmd;
-import org.springframework.stereotype.Component;
-import org.apache.cloudstack.api.command.user.vm.ListNicsCmd;
-
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.Pod;
 import com.cloud.dc.Vlan.VlanType;
 import com.cloud.deploy.DataCenterDeployment;
 import com.cloud.deploy.DeployDestination;
 import com.cloud.deploy.DeploymentPlan;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientAddressCapacityException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.InsufficientVirtualNetworkCapcityException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.exception.*;
 import com.cloud.network.Network.Provider;
 import com.cloud.network.Network.Service;
 import com.cloud.network.Networks.TrafficType;
@@ -62,7 +42,6 @@ import com.cloud.offerings.NetworkOfferingVO;
 import com.cloud.user.Account;
 import com.cloud.user.User;
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.Manager;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.vm.Nic;
 import com.cloud.vm.NicProfile;
@@ -74,6 +53,19 @@ import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachine.Type;
 import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.VirtualMachineProfileImpl;
+import org.apache.cloudstack.acl.ControlledEntity.ACLType;
+import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementorsCmd;
+import org.apache.cloudstack.api.command.user.network.CreateNetworkCmd;
+import org.apache.cloudstack.api.command.user.network.ListNetworksCmd;
+import org.apache.cloudstack.api.command.user.network.RestartNetworkCmd;
+import org.apache.cloudstack.api.command.user.vm.ListNicsCmd;
+import org.springframework.stereotype.Component;
+
+import javax.ejb.Local;
+import javax.naming.ConfigurationException;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 @Component
 @Local(value = { NetworkManager.class, NetworkService.class })
@@ -824,7 +816,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage
      * @see com.cloud.network.NetworkService#allocateIP(com.cloud.user.Account, boolean, long)
      */
     @Override
-    public IpAddress allocateIP(Account ipOwner, boolean isSystem, long zoneId) throws ResourceAllocationException,
+    public IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId) throws ResourceAllocationException,
     InsufficientAddressCapacityException, ConcurrentOperationException {
         // TODO Auto-generated method stub
         return null;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bc3e184b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
index bd4fd67..3a585ce 100644
--- a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
@@ -16,49 +16,17 @@
 // under the License.
 package com.cloud.vpc;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import org.apache.cloudstack.acl.ControlledEntity.ACLType;
-import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementorsCmd;
-import org.apache.cloudstack.api.command.user.network.CreateNetworkCmd;
-import org.apache.cloudstack.api.command.user.network.ListNetworksCmd;
-import org.apache.cloudstack.api.command.user.network.RestartNetworkCmd;
-import org.apache.cloudstack.api.command.user.vm.ListNicsCmd;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.Pod;
 import com.cloud.dc.Vlan.VlanType;
 import com.cloud.deploy.DataCenterDeployment;
 import com.cloud.deploy.DeployDestination;
 import com.cloud.deploy.DeploymentPlan;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientAddressCapacityException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.InsufficientVirtualNetworkCapcityException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.network.IpAddress;
-import com.cloud.network.Network;
+import com.cloud.exception.*;
+import com.cloud.network.*;
 import com.cloud.network.Network.Provider;
 import com.cloud.network.Network.Service;
-import com.cloud.network.NetworkManager;
-import com.cloud.network.NetworkProfile;
-import com.cloud.network.NetworkRuleApplier;
-import com.cloud.network.NetworkService;
 import com.cloud.network.Networks.TrafficType;
-import com.cloud.network.PhysicalNetwork;
-import com.cloud.network.PhysicalNetworkServiceProvider;
-import com.cloud.network.PhysicalNetworkTrafficType;
-import com.cloud.network.PublicIpAddress;
-import com.cloud.network.UserIpv6Address;
 import com.cloud.network.addr.PublicIp;
 import com.cloud.network.dao.IPAddressVO;
 import com.cloud.network.dao.NetworkServiceMapDao;
@@ -78,7 +46,6 @@ import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
 import com.cloud.user.Account;
 import com.cloud.user.User;
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.Manager;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.vm.Nic;
 import com.cloud.vm.NicProfile;
@@ -90,6 +57,21 @@ import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachine.Type;
 import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.VirtualMachineProfileImpl;
+import org.apache.cloudstack.acl.ControlledEntity.ACLType;
+import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementorsCmd;
+import org.apache.cloudstack.api.command.user.network.CreateNetworkCmd;
+import org.apache.cloudstack.api.command.user.network.ListNetworksCmd;
+import org.apache.cloudstack.api.command.user.network.RestartNetworkCmd;
+import org.apache.cloudstack.api.command.user.vm.ListNicsCmd;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @Component
 @Local(value = { NetworkManager.class, NetworkService.class })
@@ -188,7 +170,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage
      * @see com.cloud.network.NetworkService#allocateIP(com.cloud.user.Account, long, java.lang.Long)
      */
     @Override
-    public IpAddress allocateIP(Account ipOwner, boolean isSystem, long networkId) throws ResourceAllocationException,
+    public IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId) throws ResourceAllocationException,
             InsufficientAddressCapacityException, ConcurrentOperationException {
         // TODO Auto-generated method stub
         return null;


[25/33] Squashed commit of the following:

Posted by bf...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcConnectionImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcConnectionImpl.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcConnectionImpl.java
new file mode 100644
index 0000000..527fb04
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcConnectionImpl.java
@@ -0,0 +1,1415 @@
+// 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.cisco;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocketFactory;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.log4j.Logger;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+
+import com.cloud.utils.exception.ExecutionException;
+import com.cloud.utils.script.Script;
+
+public class CiscoVnmcConnectionImpl implements CiscoVnmcConnection {
+
+    private String _ip;
+    private String _username;
+    private String _password;
+    private String _cookie;
+
+    private final Logger s_logger = Logger.getLogger(CiscoVnmcConnectionImpl.class);
+
+    private enum VnmcXml {
+        LOGIN("login.xml", "mgmt-controller"),
+
+        CREATE_TENANT("create-tenant.xml", "service-reg"),
+        DELETE_TENANT("delete-tenant.xml", "service-reg"),
+        CREATE_VDC("create-vdc.xml", "service-reg"),
+        DELETE_VDC("delete-vdc.xml", "service-reg"),
+
+        CREATE_EDGE_DEVICE_PROFILE("create-edge-device-profile.xml", "policy-mgr"),
+        CREATE_EDGE_ROUTE_POLICY("create-edge-device-route-policy.xml", "policy-mgr"),
+        CREATE_EDGE_ROUTE("create-edge-device-route.xml", "policy-mgr"),
+        RESOLVE_EDGE_ROUTE_POLICY("associate-route-policy.xml", "policy-mgr"),
+
+        CREATE_DHCP_POLICY("create-dhcp-policy.xml", "policy-mgr"),
+        RESOLVE_EDGE_DHCP_POLICY("associate-dhcp-policy.xml", "policy-mgr"),
+        RESOLVE_EDGE_DHCP_SERVER_POLICY("associate-dhcp-server.xml", "policy-mgr"),
+
+        CREATE_EDGE_SECURITY_PROFILE("create-edge-security-profile.xml", "policy-mgr"),
+        DELETE_EDGE_SECURITY_PROFILE("delete-edge-security-profile.xml", "policy-mgr"),
+
+        CREATE_NAT_POLICY_SET("create-nat-policy-set.xml", "policy-mgr"),
+        DELETE_NAT_POLICY_SET("delete-nat-policy-set.xml", "policy-mgr"),
+        RESOLVE_NAT_POLICY_SET("associate-nat-policy-set.xml", "policy-mgr"),
+        CREATE_NAT_POLICY("create-nat-policy.xml", "policy-mgr"),
+        DELETE_NAT_POLICY("delete-nat-policy.xml", "policy-mgr"),
+        LIST_NAT_POLICIES("list-nat-policies.xml", "policy-mgr"),
+        CREATE_NAT_POLICY_REF("create-nat-policy-ref.xml", "policy-mgr"),
+        CREATE_PORT_POOL("create-port-pool.xml", "policy-mgr"),
+        CREATE_IP_POOL("create-ip-pool.xml", "policy-mgr"),
+
+        CREATE_PF_RULE("create-pf-rule.xml", "policy-mgr"),
+        CREATE_ACL_RULE_FOR_PF("create-acl-rule-for-pf.xml", "policy-mgr"),
+        CREATE_DNAT_RULE("create-dnat-rule.xml", "policy-mgr"),
+        CREATE_ACL_RULE_FOR_DNAT("create-acl-rule-for-dnat.xml", "policy-mgr"),
+        CREATE_SOURCE_NAT_RULE("create-source-nat-rule.xml", "policy-mgr"),
+
+        CREATE_ACL_POLICY_SET("create-acl-policy-set.xml", "policy-mgr"),
+        DELETE_ACL_POLICY_SET("delete-acl-policy-set.xml", "policy-mgr"),
+        RESOLVE_ACL_POLICY_SET("associate-acl-policy-set.xml", "policy-mgr"),
+        CREATE_ACL_POLICY("create-acl-policy.xml", "policy-mgr"),
+        DELETE_ACL_POLICY("delete-acl-policy.xml", "policy-mgr"),
+        LIST_ACL_POLICIES("list-acl-policies.xml", "policy-mgr"),
+        CREATE_ACL_POLICY_REF("create-acl-policy-ref.xml", "policy-mgr"),
+        CREATE_INGRESS_ACL_RULE("create-ingress-acl-rule.xml", "policy-mgr"),
+        CREATE_EGRESS_ACL_RULE("create-egress-acl-rule.xml", "policy-mgr"),
+        CREATE_GENERIC_INGRESS_ACL_RULE("create-generic-ingress-acl-rule.xml", "policy-mgr"),
+        CREATE_GENERIC_EGRESS_ACL_RULE("create-generic-egress-acl-rule.xml", "policy-mgr"),
+
+        DELETE_RULE("delete-rule.xml", "policy-mgr"),
+
+        LIST_CHILDREN("list-children.xml", "policy-mgr"),
+
+        CREATE_EDGE_FIREWALL("create-edge-firewall.xml", "resource-mgr"),
+        DELETE_EDGE_FIREWALL("delete-edge-firewall.xml", "resource-mgr"),
+
+        LIST_UNASSOC_ASA1000V("list-unassigned-asa1000v.xml", "resource-mgr"),
+        ASSIGN_ASA1000V("assoc-asa1000v.xml", "resource-mgr"),
+        UNASSIGN_ASA1000V("disassoc-asa1000v.xml", "resource-mgr");
+
+        private String scriptsDir = "scripts/network/cisco";
+        private String xml;
+        private String service;
+        private final Logger s_logger = Logger.getLogger(CiscoVnmcConnectionImpl.class);
+
+
+        private VnmcXml(String filename, String service) {
+            this.xml = getXml(filename);
+            this.service = service;
+        }
+
+        public String getXml() {
+            return xml;
+        }
+
+        private String getXml(String filename) {
+            try {
+                String xmlFilePath = Script.findScript(scriptsDir, filename);
+
+                if (xmlFilePath == null) {
+                    throw new Exception("Failed to find Cisco VNMC XML file: " + filename);
+                }
+
+                FileReader fr = new FileReader(xmlFilePath);
+                BufferedReader br = new BufferedReader(fr);
+
+                String xml = "";
+                String line;
+                while ((line = br.readLine()) != null) {
+                    //xml += line.replaceAll("\n"," ");
+                    xml += line;
+                }
+
+                return xml;
+            } catch (Exception e) {
+                s_logger.debug(e);
+                return null;
+            }
+        }
+
+        public String getService() {
+            return service;
+        }
+    }
+
+    public CiscoVnmcConnectionImpl(String hostIp, String userName, String password) {
+        this._ip = hostIp;
+        this._username = userName;
+        this._password = password;
+        
+    }
+
+    public boolean login() throws ExecutionException {
+        String xml = VnmcXml.LOGIN.getXml();
+        String service = VnmcXml.LOGIN.getService();
+        xml = replaceXmlValue(xml, "username", _username);
+        xml = replaceXmlValue(xml, "password", _password);
+        String response =  sendRequest(service, xml);
+        Map<String, String> checked = checkResponse(response, "outCookie", "errorCode", "response");
+
+        if (checked.get("errorCode") != null)
+            return false;
+        _cookie = checked.get("outCookie");
+        if (_cookie == null) {
+            return false;
+        }
+        return true;
+    }
+
+    private String getDnForTenant(String tenantName) {
+        return "org-root/org-" + tenantName;
+    }
+
+    private String getDnForTenantVDC(String tenantName) {
+        return getDnForTenant(tenantName) + "/org-VDC-" + tenantName;
+    }
+
+    private String getDnForTenantVDCEdgeDeviceProfile(String tenantName) {
+        return getDnForTenantVDC(tenantName) + "/edsp-" + getNameForEdgeDeviceServiceProfile(tenantName);
+    }
+
+    private String getDnForTenantVDCEdgeSecurityProfile(String tenantName) {
+        return getDnForTenantVDC(tenantName) + "/vnep-" + getNameForEdgeDeviceSecurityProfile(tenantName);
+    }
+
+    private String getDnForEdgeDeviceRoutingPolicy(String tenantName) {
+        return getDnForTenantVDC(tenantName) + "/routing-policy-" + getNameForEdgeDeviceRoutePolicy(tenantName);
+        //FIXME: any other construct is unreliable. why?
+    }
+
+    private String getDnForDhcpPolicy(String tenantName, String intfName) {
+        return getDnForTenantVDCEdgeDeviceProfile(tenantName) + "/dhcp-" + intfName;
+    }
+
+    private String getNameForDhcpPolicy(String tenantName) {
+        return tenantName + "-Dhcp-Policy";
+    }
+
+    private String getNameForDhcpServer(String tenantName) {
+        return tenantName + "-Dhcp-Server";
+    }
+
+    private String getDnForDhcpServerPolicy(String tenantName) {
+        return getDnForTenantVDC(tenantName) + "/dhcp-server-" + getNameForDhcpPolicy(tenantName);
+    }
+
+    private String getNameForIpRange() {
+        return "iprange";
+    }
+
+    private String getDnForDhcpIpRange(String tenantName) {
+        return getDnForDhcpServerPolicy(tenantName) + "/ip-range-" + getNameForIpRange();
+    }
+
+    private String getNameForDNSService(String tenantName) {
+        return tenantName + "-DNS";
+    }
+
+    private String getDnForDnsService(String tenantName) {
+        return getDnForDhcpServerPolicy(tenantName) + "/dns-svc-" + getNameForDNSService(tenantName); 
+    }
+
+    private String getDnForDnsServer(String tenantName, String dnsip) {
+        return getDnForDnsService(tenantName) + "/dns-" + dnsip; 
+    }
+
+    private String getNameForTenantVDC(String tenantName) {
+        return "VDC-" + tenantName;
+    }
+
+    private String getNameForEdgeDeviceServiceProfile(String tenantName) {
+        return "EDSP-" + tenantName;
+    }
+
+    private String getNameForEdgeDeviceSecurityProfile(String tenantName) {
+        return "ESP-" + tenantName;
+    }
+
+    private String getNameForEdgeDeviceRoutePolicy(String tenantName) {
+        return "EDSP-" + tenantName + "-Routes";
+    }
+
+    @Override
+    public boolean createTenant(String tenantName) throws ExecutionException {
+        String xml = VnmcXml.CREATE_TENANT.getXml();
+        String service = VnmcXml.CREATE_TENANT.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "descr", "Tenant for account " + tenantName);
+        xml = replaceXmlValue(xml, "name", tenantName);
+        xml = replaceXmlValue(xml, "dn", getDnForTenant(tenantName));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean deleteTenant(String tenantName) throws ExecutionException {
+        String xml = VnmcXml.DELETE_TENANT.getXml();
+        String service = VnmcXml.DELETE_TENANT.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "name", tenantName);
+        xml = replaceXmlValue(xml, "dn", getDnForTenant(tenantName));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean createTenantVDC(String tenantName) throws ExecutionException {
+        String xml = VnmcXml.CREATE_VDC.getXml();
+        String service = VnmcXml.CREATE_VDC.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "descr", "VDC for Tenant" + tenantName);
+        xml = replaceXmlValue(xml, "name", getNameForTenantVDC(tenantName));
+        xml = replaceXmlValue(xml, "dn", getDnForTenantVDC(tenantName));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean deleteTenantVDC(String tenantName) throws ExecutionException {
+        String xml = VnmcXml.DELETE_VDC.getXml();
+        String service = VnmcXml.DELETE_VDC.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "name", getNameForTenantVDC(tenantName));
+        xml = replaceXmlValue(xml, "dn", getDnForTenantVDC(tenantName));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean createTenantVDCEdgeDeviceProfile(String tenantName) throws ExecutionException {
+        String xml = VnmcXml.CREATE_EDGE_DEVICE_PROFILE.getXml();
+        String service = VnmcXml.CREATE_EDGE_DEVICE_PROFILE.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "descr", "Edge Device Profile for Tenant VDC" + tenantName);
+        xml = replaceXmlValue(xml, "name", getNameForEdgeDeviceServiceProfile(tenantName));
+        xml = replaceXmlValue(xml, "dn", getDnForTenantVDCEdgeDeviceProfile(tenantName));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean createTenantVDCEdgeStaticRoutePolicy(String tenantName) throws ExecutionException {
+        String xml = VnmcXml.CREATE_EDGE_ROUTE_POLICY.getXml();
+        String service = VnmcXml.CREATE_EDGE_ROUTE_POLICY.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "name", getNameForEdgeDeviceRoutePolicy(tenantName));
+        xml = replaceXmlValue(xml, "routepolicydn", getDnForEdgeDeviceRoutingPolicy(tenantName));
+        xml = replaceXmlValue(xml, "descr", "Routing Policy for Edge Device for Tenant " + tenantName);
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+   }
+
+    @Override
+    public boolean createTenantVDCEdgeStaticRoute(String tenantName,
+            String nextHopIp, String destination, String netmask) throws ExecutionException {
+        String xml = VnmcXml.CREATE_EDGE_ROUTE.getXml();
+        String service = VnmcXml.CREATE_EDGE_ROUTE.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "routepolicydn", getDnForEdgeDeviceRoutingPolicy(tenantName));
+        xml = replaceXmlValue(xml, "nexthop", nextHopIp);
+        xml = replaceXmlValue(xml, "nexthopintf", getNameForEdgeOutsideIntf(tenantName));
+        xml = replaceXmlValue(xml, "destination", destination);
+        xml = replaceXmlValue(xml, "netmask", netmask);
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean associateTenantVDCEdgeStaticRoutePolicy(String tenantName) throws ExecutionException {
+        String xml = VnmcXml.RESOLVE_EDGE_ROUTE_POLICY.getXml();
+        String service = VnmcXml.RESOLVE_EDGE_ROUTE_POLICY.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "name", getNameForEdgeDeviceServiceProfile(tenantName));
+        xml = replaceXmlValue(xml, "dn", getDnForTenantVDCEdgeDeviceProfile(tenantName));
+        xml = replaceXmlValue(xml, "routepolicyname", getNameForEdgeDeviceRoutePolicy(tenantName));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean associateTenantVDCEdgeDhcpPolicy(String tenantName, String intfName) throws ExecutionException {
+        String xml = VnmcXml.RESOLVE_EDGE_DHCP_POLICY.getXml();
+        String service = VnmcXml.RESOLVE_EDGE_DHCP_POLICY.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "dhcpdn", getDnForDhcpPolicy(tenantName, intfName));
+        xml = replaceXmlValue(xml, "insideintf", intfName);
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean createTenantVDCEdgeDhcpPolicy(String tenantName, 
+            String startIp, String endIp, String subnet, String nameServerIp, String domain) throws ExecutionException {
+        String xml = VnmcXml.CREATE_DHCP_POLICY.getXml();
+        String service = VnmcXml.CREATE_DHCP_POLICY.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "dhcpserverdn", getDnForDhcpServerPolicy(tenantName));
+        xml = replaceXmlValue(xml, "dhcpserverdescr", "DHCP server for " + tenantName);
+        xml = replaceXmlValue(xml, "dhcpservername", getNameForDhcpPolicy(tenantName));
+        xml = replaceXmlValue(xml, "iprangedn", getDnForDhcpIpRange(tenantName));
+        xml = replaceXmlValue(xml, "startip", startIp);
+        xml = replaceXmlValue(xml, "endip", endIp);
+        xml = replaceXmlValue(xml, "subnet", subnet);
+        xml = replaceXmlValue(xml, "domain", domain);
+        xml = replaceXmlValue(xml, "dnsservicedn", getDnForDnsService(tenantName));
+        xml = replaceXmlValue(xml, "dnsservicename", getNameForDNSService(tenantName));
+        xml = replaceXmlValue(xml, "nameserverip", nameServerIp);
+        xml = replaceXmlValue(xml, "nameserverdn", getDnForDnsServer(tenantName, nameServerIp));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean associateTenantVDCEdgeDhcpServerPolicy(String tenantName, String intfName) throws ExecutionException {
+        String xml = VnmcXml.RESOLVE_EDGE_DHCP_SERVER_POLICY.getXml();
+        String service = VnmcXml.RESOLVE_EDGE_DHCP_SERVER_POLICY.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "dhcpdn", getDnForDhcpPolicy(tenantName, intfName));
+        xml = replaceXmlValue(xml, "insideintf", intfName);
+        xml = replaceXmlValue(xml, "dhcpserverpolicyname", getNameForDhcpServer(tenantName));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean createTenantVDCEdgeSecurityProfile(String tenantName) throws ExecutionException {
+        String xml = VnmcXml.CREATE_EDGE_SECURITY_PROFILE.getXml();
+        String service = VnmcXml.CREATE_EDGE_SECURITY_PROFILE.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "descr", "Edge Security Profile for Tenant VDC" + tenantName);
+        xml = replaceXmlValue(xml, "name", getNameForEdgeDeviceSecurityProfile(tenantName));
+        xml = replaceXmlValue(xml, "espdn", getDnForTenantVDCEdgeSecurityProfile(tenantName));
+        xml = replaceXmlValue(xml, "egressref", "default-egress");
+        xml = replaceXmlValue(xml, "ingressref", "default-ingress"); //FIXME: allows everything
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean deleteTenantVDCEdgeSecurityProfile(String tenantName) throws ExecutionException {
+        String xml = VnmcXml.DELETE_EDGE_SECURITY_PROFILE.getXml();
+        String service = VnmcXml.DELETE_EDGE_SECURITY_PROFILE.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "name", getNameForEdgeDeviceSecurityProfile(tenantName));
+        xml = replaceXmlValue(xml, "espdn", getDnForTenantVDCEdgeSecurityProfile(tenantName));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    private String getNameForSourceNatIpPool(String tenantName) {
+        return "SNATIp-" + tenantName;
+    }
+
+    private String getDnForSourceNatPool(String tenantName) {
+        return getDnForTenantVDC(tenantName) + "/objgrp-" + getNameForSourceNatIpPool(tenantName);
+    }
+
+    @Override
+    public boolean createTenantVDCSourceNatIpPool(String tenantName, String identifier,
+            String publicIp) throws ExecutionException {
+        return createTenantVDCIpPool(
+                getDnForSourceNatPool(tenantName),
+                getNameForSourceNatIpPool(tenantName),
+                "Source NAT ip pool for Tenant VDC " + tenantName,
+                publicIp);
+    }
+
+    private String getNameForSourceNatPolicy(String tenantName) {
+       return "SNAT-Policy-" + tenantName;
+    }
+
+    private String getDnForSourceNatPolicy(String tenantName) {
+        return getDnForTenantVDC(tenantName) + "/natpol-" + getNameForSourceNatPolicy(tenantName);
+    }
+
+    private String getNameForSourceNatRule(String tenantName) {
+        return "SNAT-Rule-" + tenantName;
+    }
+
+    private String getDnForSourceNatRule(String tenantName) {
+        return getDnForSourceNatPolicy(tenantName) + "/rule-" + getNameForSourceNatRule(tenantName);
+    }
+
+    private String getNameForNatPolicySet(String tenantName) {
+        return "NAT-PolicySet-" + tenantName;
+    }
+
+    private String getDnForNatPolicySet(String tenantName) {
+        return getDnForTenantVDC(tenantName) + "/natpset-" + getNameForNatPolicySet(tenantName) ;
+    }
+
+    private String getDnForSourceNatPolicyRef(String tenantName) {
+        return getDnForNatPolicySet(tenantName) + "/polref-" + getNameForSourceNatPolicy(tenantName) ;
+    }
+
+    @Override
+    public boolean createTenantVDCSourceNatRule(String tenantName, String identifier,
+            String startSourceIp, String endSourceIp) throws ExecutionException {
+
+        String xml = VnmcXml.CREATE_SOURCE_NAT_RULE.getXml();
+        String service = VnmcXml.CREATE_SOURCE_NAT_RULE.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "natruledn", getDnForSourceNatRule(tenantName));
+        xml = replaceXmlValue(xml, "natrulename", getNameForSourceNatRule(tenantName));
+        xml = replaceXmlValue(xml, "descr", "Source NAT rule for Tenant VDC " + tenantName);
+        xml = replaceXmlValue(xml, "srcstartip", startSourceIp);
+        xml = replaceXmlValue(xml, "srcendip", endSourceIp);
+        xml = replaceXmlValue(xml, "ippoolname", getNameForSourceNatIpPool(tenantName));
+
+        List<String> rules = listChildren(getDnForSourceNatPolicy(tenantName));
+        int order = 100;
+        if (rules != null) {
+            order += rules.size();
+        }
+        xml = replaceXmlValue(xml, "order", Integer.toString(order));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean createTenantVDCSourceNatPolicyRef(String tenantName, String identifier) throws ExecutionException {
+        return createTenantVDCNatPolicyRef(
+                getDnForSourceNatPolicyRef(tenantName),
+                getNameForSourceNatPolicy(tenantName),
+                tenantName);
+    }
+
+    @Override
+    public boolean createTenantVDCSourceNatPolicy(String tenantName, String identifier) throws ExecutionException {
+        return createTenantVDCNatPolicy(
+                getDnForSourceNatPolicy(tenantName),
+                getNameForSourceNatPolicy(tenantName));
+    }
+
+    @Override
+    public boolean createTenantVDCNatPolicySet(String tenantName) throws ExecutionException {
+        String xml = VnmcXml.CREATE_NAT_POLICY_SET.getXml();
+        String service = VnmcXml.CREATE_NAT_POLICY_SET.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "descr", "NAT policy set for Tenant VDC " + tenantName);
+        xml = replaceXmlValue(xml, "natpolicysetname", getNameForNatPolicySet(tenantName));
+        xml = replaceXmlValue(xml, "natpolicysetdn", getDnForNatPolicySet(tenantName));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean deleteTenantVDCNatPolicySet(String tenantName) throws ExecutionException {
+        String xml = VnmcXml.DELETE_NAT_POLICY_SET.getXml();
+        String service = VnmcXml.DELETE_NAT_POLICY_SET.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "natpolicysetname", getNameForNatPolicySet(tenantName));
+        xml = replaceXmlValue(xml, "natpolicysetdn", getDnForNatPolicySet(tenantName));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean associateNatPolicySet(String tenantName) throws ExecutionException {
+        String xml = VnmcXml.RESOLVE_NAT_POLICY_SET.getXml();
+        String service = VnmcXml.RESOLVE_NAT_POLICY_SET.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "descr", "Edge Security Profile for Tenant VDC" + tenantName);
+        xml = replaceXmlValue(xml, "name", getNameForEdgeDeviceSecurityProfile(tenantName));
+        xml = replaceXmlValue(xml, "espdn", getDnForTenantVDCEdgeSecurityProfile(tenantName));
+        xml = replaceXmlValue(xml, "natpolicysetname", getNameForNatPolicySet(tenantName));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    private String getNameForAclPolicySet(String tenantName, boolean ingress) {
+        return (ingress ? "Ingress-" : "Egress-") + "ACL-PolicySet-" + tenantName;
+    }
+
+    private String getDnForAclPolicySet(String tenantName, boolean ingress) {
+        return getDnForTenantVDC(tenantName) + "/pset-" + getNameForAclPolicySet(tenantName, ingress) ;
+    }
+
+    private String getNameForAclPolicy(String tenantName, String identifier) {
+        return "ACL-" + tenantName + "-" + identifier;
+    }
+
+    private String getDnForAclPolicy(String tenantName, String identifier) {
+        return getDnForTenantVDC(tenantName) + "/pol-" + getNameForAclPolicy(tenantName, identifier);
+    }
+
+    private String getDnForAclPolicyRef(String tenantName, String identifier, boolean ingress) {
+        return getDnForAclPolicySet(tenantName, ingress) + "/polref-" + getNameForAclPolicy(tenantName, identifier);
+    }
+
+    private String getNameForAclRule(String tenantName, String identifier) {
+        return "Rule-" + tenantName + "-" + identifier;
+    }
+
+    private String getDnForAclRule(String tenantName, String identifier, String policyIdentifier) {
+        return getDnForAclPolicy(tenantName, policyIdentifier) + "/rule-" + getNameForAclRule(tenantName, identifier);
+    }
+
+    @Override
+    public boolean createTenantVDCAclPolicy(String tenantName, String identifier) throws ExecutionException {
+        String xml = VnmcXml.CREATE_ACL_POLICY.getXml();
+        String service = VnmcXml.CREATE_ACL_POLICY.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "aclpolicyname", getNameForAclPolicy(tenantName, identifier));
+        xml = replaceXmlValue(xml, "aclpolicydn", getDnForAclPolicy(tenantName, identifier));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean deleteTenantVDCAclPolicy(String tenantName, String identifier) throws ExecutionException {
+        String xml = VnmcXml.DELETE_ACL_POLICY.getXml();
+        String service = VnmcXml.DELETE_ACL_POLICY.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "aclpolicyname", getNameForAclPolicy(tenantName, identifier));
+        xml = replaceXmlValue(xml, "aclpolicydn", getDnForAclPolicy(tenantName, identifier));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean createTenantVDCAclPolicyRef(String tenantName, String identifier, boolean ingress) throws ExecutionException {
+        String xml = VnmcXml.CREATE_ACL_POLICY_REF.getXml();
+        String service = VnmcXml.CREATE_ACL_POLICY_REF.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "aclpolicyname", getNameForAclPolicy(tenantName, identifier));
+        xml = replaceXmlValue(xml, "aclpolicydn", getDnForAclPolicy(tenantName, identifier));
+        xml = replaceXmlValue(xml, "aclpolicyrefdn", getDnForAclPolicyRef(tenantName, identifier, ingress));
+
+        List<String> policies = listAclPolicies(tenantName);
+        int order = 100;
+        if (policies != null) {
+            order += policies.size();
+        }
+        xml = replaceXmlValue(xml, "order", Integer.toString(order));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean createTenantVDCAclPolicySet(String tenantName, boolean ingress) throws ExecutionException {
+        String xml = VnmcXml.CREATE_ACL_POLICY_SET.getXml();
+        String service = VnmcXml.CREATE_ACL_POLICY_SET.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "descr", "ACL policy set for Tenant VDC " + tenantName);
+        xml = replaceXmlValue(xml, "aclpolicysetname", getNameForAclPolicySet(tenantName, ingress));
+        xml = replaceXmlValue(xml, "aclpolicysetdn", getDnForAclPolicySet(tenantName, ingress));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean deleteTenantVDCAclPolicySet(String tenantName, boolean ingress) throws ExecutionException {
+        String xml = VnmcXml.DELETE_ACL_POLICY_SET.getXml();
+        String service = VnmcXml.DELETE_ACL_POLICY_SET.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "aclpolicysetname", getNameForAclPolicySet(tenantName, ingress));
+        xml = replaceXmlValue(xml, "aclpolicysetdn", getDnForAclPolicySet(tenantName, ingress));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean associateAclPolicySet(String tenantName) throws ExecutionException {
+        String xml = VnmcXml.RESOLVE_ACL_POLICY_SET.getXml();
+        String service = VnmcXml.RESOLVE_ACL_POLICY_SET.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "descr", "Edge Security Profile for Tenant VDC" + tenantName);
+        xml = replaceXmlValue(xml, "name", getNameForEdgeDeviceSecurityProfile(tenantName));
+        xml = replaceXmlValue(xml, "espdn", getDnForTenantVDCEdgeSecurityProfile(tenantName));
+        //xml = replaceXmlValue(xml, "egresspolicysetname", getNameForAclPolicySet(tenantName, false));
+        xml = replaceXmlValue(xml, "egresspolicysetname", "default-egress");
+        xml = replaceXmlValue(xml, "ingresspolicysetname", getNameForAclPolicySet(tenantName, true));
+        xml = replaceXmlValue(xml, "natpolicysetname", getNameForNatPolicySet(tenantName));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean createTenantVDCIngressAclRule(String tenantName,
+            String identifier, String policyIdentifier,
+            String protocol, String sourceStartIp, String sourceEndIp,
+            String destStartPort, String destEndPort, String destIp) throws ExecutionException {
+        String xml = VnmcXml.CREATE_INGRESS_ACL_RULE.getXml();
+        String service = VnmcXml.CREATE_INGRESS_ACL_RULE.getService();
+
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "aclruledn", getDnForAclRule(tenantName, identifier, policyIdentifier));
+        xml = replaceXmlValue(xml, "aclrulename", getNameForAclRule(tenantName, identifier));
+        xml = replaceXmlValue(xml, "descr", "Ingress ACL rule for Tenant VDC " + tenantName);
+        xml = replaceXmlValue(xml, "actiontype", "permit");
+        xml = replaceXmlValue(xml, "protocolvalue", protocol);
+        xml = replaceXmlValue(xml, "sourcestartip", sourceStartIp);
+        xml = replaceXmlValue(xml, "sourceendip", sourceEndIp);
+        xml = replaceXmlValue(xml, "deststartport", destStartPort);
+        xml = replaceXmlValue(xml, "destendport", destEndPort);
+        xml = replaceXmlValue(xml, "destip", destIp);
+
+        List<String> rules = listChildren(getDnForAclPolicy(tenantName, policyIdentifier));
+        int order = 100;
+        if (rules != null) {
+            order += rules.size();
+        }
+        xml = replaceXmlValue(xml, "order", Integer.toString(order));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean createTenantVDCIngressAclRule(String tenantName,
+            String identifier, String policyIdentifier,
+            String protocol, String sourceStartIp, String sourceEndIp,
+            String destIp) throws ExecutionException {
+        String xml = VnmcXml.CREATE_GENERIC_INGRESS_ACL_RULE.getXml();
+        String service = VnmcXml.CREATE_GENERIC_INGRESS_ACL_RULE.getService();
+
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "aclruledn", getDnForAclRule(tenantName, identifier, policyIdentifier));
+        xml = replaceXmlValue(xml, "aclrulename", getNameForAclRule(tenantName, identifier));
+        xml = replaceXmlValue(xml, "descr", "Ingress ACL rule for Tenant VDC " + tenantName);
+        xml = replaceXmlValue(xml, "actiontype", "permit");
+        xml = replaceXmlValue(xml, "protocolvalue", protocol);
+        xml = replaceXmlValue(xml, "sourcestartip", sourceStartIp);
+        xml = replaceXmlValue(xml, "sourceendip", sourceEndIp);
+
+        List<String> rules = listChildren(getDnForAclPolicy(tenantName, policyIdentifier));
+        int order = 100;
+        if (rules != null) {
+            order += rules.size();
+        }
+        xml = replaceXmlValue(xml, "order", Integer.toString(order));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean createTenantVDCEgressAclRule(String tenantName,
+            String identifier, String policyIdentifier,
+            String protocol, String sourceStartPort, String sourceEndPort, String sourceIp,
+            String destStartIp, String destEndIp) throws ExecutionException {
+        String xml = VnmcXml.CREATE_EGRESS_ACL_RULE.getXml();
+        String service = VnmcXml.CREATE_EGRESS_ACL_RULE.getService();
+
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "aclruledn", getDnForAclRule(tenantName, identifier, policyIdentifier));
+        xml = replaceXmlValue(xml, "aclrulename", getNameForAclRule(tenantName, identifier));
+        xml = replaceXmlValue(xml, "descr", "Egress ACL rule for Tenant VDC " + tenantName);
+        xml = replaceXmlValue(xml, "actiontype", "permit");
+        xml = replaceXmlValue(xml, "protocolvalue", protocol);
+        xml = replaceXmlValue(xml, "deststartip", destStartIp);
+        xml = replaceXmlValue(xml, "destendip", destEndIp);
+        xml = replaceXmlValue(xml, "sourcestartport", sourceStartPort);
+        xml = replaceXmlValue(xml, "sourceendport", sourceEndPort);
+        xml = replaceXmlValue(xml, "sourceip", sourceIp);
+
+        List<String> rules = listChildren(getDnForAclPolicy(tenantName, policyIdentifier));
+        int order = 100;
+        if (rules != null) {
+            order += rules.size();
+        }
+        xml = replaceXmlValue(xml, "order", Integer.toString(order));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean createTenantVDCEgressAclRule(String tenantName,
+            String identifier, String policyIdentifier,
+            String protocol, String sourceIp,
+            String destStartIp, String destEndIp) throws ExecutionException {
+        String xml = VnmcXml.CREATE_GENERIC_EGRESS_ACL_RULE.getXml();
+        String service = VnmcXml.CREATE_GENERIC_EGRESS_ACL_RULE.getService();
+
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "aclruledn", getDnForAclRule(tenantName, identifier, policyIdentifier));
+        xml = replaceXmlValue(xml, "aclrulename", getNameForAclRule(tenantName, identifier));
+        xml = replaceXmlValue(xml, "descr", "Egress ACL rule for Tenant VDC " + tenantName);
+        xml = replaceXmlValue(xml, "actiontype", "permit");
+        xml = replaceXmlValue(xml, "protocolvalue", protocol);
+        xml = replaceXmlValue(xml, "deststartip", destStartIp);
+        xml = replaceXmlValue(xml, "destendip", destEndIp);
+
+        List<String> rules = listChildren(getDnForAclPolicy(tenantName, policyIdentifier));
+        int order = 100;
+        if (rules != null) {
+            order += rules.size();
+        }
+        xml = replaceXmlValue(xml, "order", Integer.toString(order));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean deleteTenantVDCAclRule(String tenantName, String identifier, String policyIdentifier) throws ExecutionException {
+        return deleteTenantVDCRule(
+                getDnForAclRule(tenantName, identifier, policyIdentifier),
+                getNameForAclRule(tenantName, identifier));
+    }
+
+    private String getNameForPFPortPool(String tenantName, String identifier) {
+        return "PFPort-" + tenantName + "-" + identifier;
+    }
+
+    private String getDnForPFPortPool(String tenantName, String identifier) {
+        return getDnForTenantVDC(tenantName) + "/objgrp-" + getNameForPFPortPool(tenantName, identifier);
+    }
+
+    private String getNameForPFIpPool(String tenantName, String identifier) {
+        return "PFIp-" + tenantName + "-" + identifier;
+    }
+
+    private String getDnForPFIpPool(String tenantName, String identifier) {
+        return getDnForTenantVDC(tenantName) + "/objgrp-" + getNameForPFIpPool(tenantName, identifier);
+    }
+
+    private boolean createTenantVDCPortPool(String poolDn, String name,
+            String description, String startPort, String endPort) throws ExecutionException {
+        String xml = VnmcXml.CREATE_PORT_POOL.getXml();
+        String service = VnmcXml.CREATE_PORT_POOL.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "portpooldn", poolDn);
+        xml = replaceXmlValue(xml, "portpoolname", name);
+        xml = replaceXmlValue(xml, "descr", description);
+        xml = replaceXmlValue(xml, "startport", startPort);
+        xml = replaceXmlValue(xml, "endport", endPort);
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    private boolean createTenantVDCIpPool(String poolDn, String name,
+            String description, String ipAddress) throws ExecutionException {
+        String xml = VnmcXml.CREATE_IP_POOL.getXml();
+        String service = VnmcXml.CREATE_IP_POOL.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "ippooldn", poolDn);
+        xml = replaceXmlValue(xml, "ippoolname", name);
+        xml = replaceXmlValue(xml, "descr", description);
+        xml = replaceXmlValue(xml, "ipvalue", ipAddress);
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    private boolean createTenantVDCNatPolicyRef(String policyRefDn, String name, String tenantName) throws ExecutionException {
+        String xml = VnmcXml.CREATE_NAT_POLICY_REF.getXml();
+        String service = VnmcXml.CREATE_NAT_POLICY_REF.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "natpolicyrefdn", policyRefDn);
+        xml = replaceXmlValue(xml, "natpolicyname", name);
+
+        List<String> policies = listNatPolicies(tenantName);
+        int order = 100;
+        if (policies != null) {
+            order += policies.size();
+        }
+        xml = replaceXmlValue(xml, "order", Integer.toString(order));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    private boolean createTenantVDCNatPolicy(String policyDn, String name) throws ExecutionException {
+        String xml = VnmcXml.CREATE_NAT_POLICY.getXml();
+        String service = VnmcXml.CREATE_NAT_POLICY.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "natpolicydn", policyDn);
+        xml = replaceXmlValue(xml, "natpolicyname", name);
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    private boolean deleteTenantVDCNatPolicy(String policyDn, String name) throws ExecutionException {
+        String xml = VnmcXml.DELETE_NAT_POLICY.getXml();
+        String service = VnmcXml.DELETE_NAT_POLICY.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "natpolicydn", policyDn);
+        xml = replaceXmlValue(xml, "natpolicyname", name);
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    private boolean deleteTenantVDCRule(String ruledn, String ruleName) throws ExecutionException {
+        String xml = VnmcXml.DELETE_RULE.getXml();
+        String service = VnmcXml.DELETE_RULE.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "ruledn", ruledn);
+        xml = replaceXmlValue(xml, "rulename", ruleName);
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    private List<String> listNatPolicies(String tenantName) throws ExecutionException {
+
+        String xml = VnmcXml.LIST_NAT_POLICIES.getXml();
+        String service = VnmcXml.LIST_NAT_POLICIES.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "vdcdn", getDnForTenantVDC(tenantName));
+
+        String response = sendRequest(service, xml);
+
+        List<String> result = new ArrayList<String>();
+        Document xmlDoc = getDocument(response);
+        xmlDoc.normalize();
+        NodeList policyList = xmlDoc.getElementsByTagName("pair");
+        for (int i=0; i < policyList.getLength(); i++) {
+            Node policyNode = policyList.item(i);
+            result.add(policyNode.getAttributes().getNamedItem("key").getNodeValue());
+        }
+
+        return result;
+    }
+
+    private List<String> listAclPolicies(String tenantName) throws ExecutionException {
+
+        String xml = VnmcXml.LIST_ACL_POLICIES.getXml();
+        String service = VnmcXml.LIST_ACL_POLICIES.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "vdcdn", getDnForTenantVDC(tenantName));
+
+        String response = sendRequest(service, xml);
+
+        List<String> result = new ArrayList<String>();
+        Document xmlDoc = getDocument(response);
+        xmlDoc.normalize();
+        NodeList policyList = xmlDoc.getElementsByTagName("pair");
+        for (int i=0; i < policyList.getLength(); i++) {
+            Node policyNode = policyList.item(i);
+            result.add(policyNode.getAttributes().getNamedItem("key").getNodeValue());
+        }
+
+        return result;
+    }
+
+    private List<String> listChildren(String dn) throws ExecutionException {
+
+        String xml = VnmcXml.LIST_CHILDREN.getXml();
+        String service = VnmcXml.LIST_CHILDREN.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "dn", dn);
+
+        String response = sendRequest(service, xml);
+
+        List<String> result = new ArrayList<String>();
+        Document xmlDoc = getDocument(response);
+        xmlDoc.normalize();
+        NodeList policyList = xmlDoc.getElementsByTagName("policyRule");
+        for (int i=0; i < policyList.getLength(); i++) {
+            Node policyNode = policyList.item(i);
+            result.add(policyNode.getAttributes().getNamedItem("name").getNodeValue());
+        }
+
+        return result;
+    }
+
+    @Override
+    public boolean createTenantVDCPFPortPool(String tenantName, String identifier,
+            String startPort, String endPort) throws ExecutionException {
+        return createTenantVDCPortPool(
+                getDnForPFPortPool(tenantName, identifier),
+                getNameForPFPortPool(tenantName, identifier),
+                "PF port pool for " + getNameForPFPortPool(tenantName, identifier),
+                startPort, endPort);
+    }
+
+    @Override
+    public boolean createTenantVDCPFIpPool(String tenantName, String identifier,
+            String ipAddress) throws ExecutionException {
+        return createTenantVDCIpPool(
+                getDnForPFIpPool(tenantName, identifier),
+                getNameForPFIpPool(tenantName, identifier),
+                "PF ip pool for " + getNameForPFIpPool(tenantName, identifier),
+                ipAddress);
+    }
+
+    private String getNameForPFPolicy(String tenantName, String identifier) {
+        return "PF-" + tenantName + "-" + identifier;
+    }
+
+    private String getDnForPFPolicy(String tenantName, String identifier) {
+        return getDnForTenantVDC(tenantName) + "/natpol-" + getNameForPFPolicy(tenantName, identifier);
+    }
+
+    private String getDnForPFPolicyRef(String tenantName, String identifier) {
+        return getDnForNatPolicySet(tenantName) + "/polref-" + getNameForPFPolicy(tenantName, identifier);
+    }
+
+    private String getNameForPFRule(String tenantName, String identifier) {
+        return "Rule-" + tenantName + "-" + identifier;
+    }
+
+    private String getDnForPFRule(String tenantName, String identifier, String policyIdentifier) {
+        return getDnForPFPolicy(tenantName, policyIdentifier) + "/rule-" + getNameForPFRule(tenantName, identifier);
+    }
+
+    @Override
+    public boolean createTenantVDCPFRule(String tenantName,
+            String identifier, String policyIdentifier,
+            String protocol, String publicIp,
+            String startPort, String endPort) throws ExecutionException {
+        String xml = VnmcXml.CREATE_PF_RULE.getXml();
+        String service = VnmcXml.CREATE_PF_RULE.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "natruledn", getDnForPFRule(tenantName, identifier, policyIdentifier));
+        xml = replaceXmlValue(xml, "natrulename", getNameForPFRule(tenantName, identifier));
+        xml = replaceXmlValue(xml, "descr", "PF rule for Tenant VDC " + tenantName);
+        xml = replaceXmlValue(xml, "ippoolname", getNameForPFIpPool(tenantName, policyIdentifier + "-" + identifier));
+        xml = replaceXmlValue(xml, "portpoolname", getNameForPFPortPool(tenantName, policyIdentifier + "-" + identifier));
+        xml = replaceXmlValue(xml, "ip", publicIp);
+        xml = replaceXmlValue(xml, "startport", startPort);
+        xml = replaceXmlValue(xml, "endport", endPort);
+        xml = replaceXmlValue(xml, "protocolvalue", protocol);
+
+        List<String> rules = listChildren(getDnForPFPolicy(tenantName, policyIdentifier));
+        int order = 100;
+        if (rules != null) {
+            order += rules.size();
+        }
+        xml = replaceXmlValue(xml, "order", Integer.toString(order));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean deleteTenantVDCPFRule(String tenantName, String identifier,
+            String policyIdentifier) throws ExecutionException {
+        return deleteTenantVDCRule(
+                getDnForPFRule(tenantName, identifier, policyIdentifier),
+                getNameForPFRule(tenantName, identifier));
+    }
+
+    @Override
+    public boolean createTenantVDCAclRuleForPF(String tenantName,
+            String identifier, String policyIdentifier, String protocol,
+            String ipAddress, String startPort, String endPort)
+            throws ExecutionException {
+        String xml = VnmcXml.CREATE_ACL_RULE_FOR_PF.getXml();
+        String service = VnmcXml.CREATE_ACL_RULE_FOR_PF.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "aclruledn", getDnForAclRule(tenantName, identifier, policyIdentifier));
+        xml = replaceXmlValue(xml, "aclrulename", getNameForAclRule(tenantName, identifier));
+        xml = replaceXmlValue(xml, "descr", "ACL rule for Tenant VDC " + tenantName);
+        xml = replaceXmlValue(xml, "actiontype", "permit");
+        xml = replaceXmlValue(xml, "protocolvalue", protocol);
+        xml = replaceXmlValue(xml, "ip", ipAddress);
+        xml = replaceXmlValue(xml, "startport", startPort);
+        xml = replaceXmlValue(xml, "endport", endPort);
+
+        List<String> rules = listChildren(getDnForAclPolicy(tenantName, policyIdentifier));
+        int order = 100;
+        if (rules != null) {
+            order += rules.size();
+        }
+        xml = replaceXmlValue(xml, "order", Integer.toString(order));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean createTenantVDCPFPolicyRef(String tenantName, String identifier) throws ExecutionException {
+        return createTenantVDCNatPolicyRef(
+                getDnForPFPolicyRef(tenantName, identifier),
+                getNameForPFPolicy(tenantName, identifier),
+                tenantName);
+    }
+
+    @Override
+    public boolean createTenantVDCPFPolicy(String tenantName, String identifier) throws ExecutionException {
+        return createTenantVDCNatPolicy(
+                getDnForPFPolicy(tenantName, identifier),
+                getNameForPFPolicy(tenantName, identifier));
+    }
+
+    @Override
+    public boolean deleteTenantVDCPFPolicy(String tenantName, String identifier) throws ExecutionException {
+        return deleteTenantVDCNatPolicy(
+                getDnForPFPolicy(tenantName, identifier),
+                getNameForPFPolicy(tenantName, identifier));
+    }
+
+    private String getNameForDNatIpPool(String tenantName, String identifier) {
+        return "DNATIp-" + tenantName + "-" + identifier;
+    }
+
+    private String getDnForDNatIpPool(String tenantName, String identifier) {
+        return getDnForTenantVDC(tenantName) + "/objgrp-" + getNameForDNatIpPool(tenantName, identifier);
+    }
+
+    @Override
+    public boolean createTenantVDCDNatIpPool(String tenantName,
+            String identifier, String ipAddress) throws ExecutionException {
+        return createTenantVDCIpPool(
+                getDnForDNatIpPool(tenantName, identifier),
+                getNameForDNatIpPool(tenantName, identifier),
+                "DNAT ip pool for " + getNameForDNatIpPool(tenantName, identifier),
+                ipAddress);
+    }
+
+    private String getNameForDNatRule(String tenantName, String identifier) {
+        return "Rule-" + tenantName + "-" + identifier;
+    }
+
+    private String getDnForDNatRule(String tenantName, String identifier, String policyIdentifier) {
+        return getDnForDNatPolicy(tenantName, policyIdentifier) + "/rule-" + getNameForDNatRule(tenantName, identifier);
+    }
+
+    private String getNameForDNatPolicy(String tenantName, String identifier) {
+        return "DNAT-" + tenantName + "-" + identifier;
+    }
+
+    private String getDnForDNatPolicy(String tenantName, String identifier) {
+        return getDnForTenantVDC(tenantName) + "/natpol-" + getNameForDNatPolicy(tenantName, identifier);
+    }
+
+    private String getDnForDNatPolicyRef(String tenantName, String identifier) {
+        return getDnForNatPolicySet(tenantName) + "/polref-" + getNameForDNatPolicy(tenantName, identifier);
+    }
+
+    @Override
+    public boolean createTenantVDCDNatRule(String tenantName,
+            String identifier, String policyIdentifier, String publicIp)
+            throws ExecutionException {
+        String xml = VnmcXml.CREATE_DNAT_RULE.getXml();
+        String service = VnmcXml.CREATE_DNAT_RULE.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "natruledn", getDnForDNatRule(tenantName, identifier, policyIdentifier));
+        xml = replaceXmlValue(xml, "natrulename", getNameForDNatRule(tenantName, identifier));
+        xml = replaceXmlValue(xml, "descr", "DNAT rule for Tenant VDC " + tenantName);
+        xml = replaceXmlValue(xml, "ippoolname", getNameForDNatIpPool(tenantName, policyIdentifier + "-" + identifier));
+        xml = replaceXmlValue(xml, "ip", publicIp);
+
+        List<String> rules = listChildren(getDnForDNatPolicy(tenantName, policyIdentifier));
+        int order = 100;
+        if (rules != null) {
+            order += rules.size();
+        }
+        xml = replaceXmlValue(xml, "order", Integer.toString(order));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean deleteTenantVDCDNatRule(String tenantName,
+            String identifier, String policyIdentifier)
+            throws ExecutionException {
+        return deleteTenantVDCRule(
+                getDnForDNatRule(tenantName, identifier, policyIdentifier),
+                getNameForDNatRule(tenantName, identifier));
+    }
+
+    @Override
+    public boolean createTenantVDCAclRuleForDNat(String tenantName,
+            String identifier, String policyIdentifier, String ipAddress)
+            throws ExecutionException {
+        String xml = VnmcXml.CREATE_ACL_RULE_FOR_DNAT.getXml();
+        String service = VnmcXml.CREATE_ACL_RULE_FOR_DNAT.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "aclruledn", getDnForAclRule(tenantName, identifier, policyIdentifier));
+        xml = replaceXmlValue(xml, "aclrulename", getNameForAclRule(tenantName, identifier));
+        xml = replaceXmlValue(xml, "descr", "ACL rule for Tenant VDC " + tenantName);
+        xml = replaceXmlValue(xml, "actiontype", "permit");
+        xml = replaceXmlValue(xml, "ip", ipAddress);
+
+        List<String> rules = listChildren(getDnForAclPolicy(tenantName, policyIdentifier));
+        int order = 100;
+        if (rules != null) {
+            order += rules.size();
+        }
+        xml = replaceXmlValue(xml, "order", Integer.toString(order));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean createTenantVDCDNatPolicyRef(String tenantName,
+            String identifier) throws ExecutionException {
+        return createTenantVDCNatPolicyRef(
+                getDnForDNatPolicyRef(tenantName, identifier),
+                getNameForDNatPolicy(tenantName, identifier),
+                tenantName);
+    }
+
+    @Override
+    public boolean createTenantVDCDNatPolicy(String tenantName,
+            String identifier) throws ExecutionException {
+        return createTenantVDCNatPolicy(
+                getDnForDNatPolicy(tenantName, identifier),
+                getNameForDNatPolicy(tenantName, identifier));
+    }
+
+    @Override
+    public boolean deleteTenantVDCDNatPolicy(String tenantName,
+            String identifier) throws ExecutionException {
+        return deleteTenantVDCNatPolicy(
+                getDnForDNatPolicy(tenantName, identifier),
+                getNameForDNatPolicy(tenantName, identifier));
+    }
+
+    private String getNameForEdgeFirewall(String tenantName) {
+        return "ASA-1000v-" + tenantName;
+    }
+
+    private String getDnForEdgeFirewall(String tenantName) {
+        return getDnForTenantVDC(tenantName) + "/efw-" + getNameForEdgeFirewall(tenantName);
+    }
+
+    private String getNameForEdgeInsideIntf(String tenantName) {
+        return "Edge_Inside"; //TODO: make this configurable
+    }
+
+    private String getNameForEdgeOutsideIntf(String tenantName) {
+        return "Edge_Outside"; //TODO: make this configurable
+    }
+
+    private String getDnForOutsideIntf(String tenantName) {
+        return getDnForEdgeFirewall(tenantName) + "/interface-" + getNameForEdgeOutsideIntf(tenantName);
+    }
+
+    private String getDnForInsideIntf(String tenantName) {
+        return getDnForEdgeFirewall(tenantName) + "/interface-" + getNameForEdgeInsideIntf(tenantName);
+    }
+
+    @Override
+    public boolean createEdgeFirewall(String tenantName, String publicIp, String insideIp, 
+            String publicSubnet, String insideSubnet) throws ExecutionException {
+        String xml = VnmcXml.CREATE_EDGE_FIREWALL.getXml();
+        String service = VnmcXml.CREATE_EDGE_FIREWALL.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "edgefwdescr", "Edge Firewall for Tenant VDC " + tenantName);
+        xml = replaceXmlValue(xml, "edgefwname", getNameForEdgeFirewall(tenantName));
+        xml = replaceXmlValue(xml, "edgefwdn", getDnForEdgeFirewall(tenantName));
+        xml = replaceXmlValue(xml, "insideintfname", getNameForEdgeInsideIntf(tenantName));
+        xml = replaceXmlValue(xml, "outsideintfname", getNameForEdgeOutsideIntf(tenantName));
+
+        xml = replaceXmlValue(xml, "insideintfdn", getDnForInsideIntf(tenantName));
+        xml = replaceXmlValue(xml, "outsideintfdn", getDnForOutsideIntf(tenantName));
+
+        xml = replaceXmlValue(xml, "deviceserviceprofiledn", getDnForEdgeFirewall(tenantName) + "/device-service-profile");
+        xml = replaceXmlValue(xml, "outsideintfsp", getDnForOutsideIntf(tenantName)  + "/interface-service-profile");
+
+        xml = replaceXmlValue(xml, "secprofileref", getNameForEdgeDeviceSecurityProfile(tenantName));
+        xml = replaceXmlValue(xml, "deviceserviceprofile", getNameForEdgeDeviceServiceProfile(tenantName));
+
+        xml = replaceXmlValue(xml, "insideip", insideIp);
+        xml = replaceXmlValue(xml, "publicip", publicIp);
+        xml = replaceXmlValue(xml, "insidesubnet", insideSubnet);
+        xml = replaceXmlValue(xml, "outsidesubnet", publicSubnet);
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean deleteEdgeFirewall(String tenantName) throws ExecutionException {
+        String xml = VnmcXml.DELETE_EDGE_FIREWALL.getXml();
+        String service = VnmcXml.DELETE_EDGE_FIREWALL.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "edgefwname", getNameForEdgeFirewall(tenantName));
+        xml = replaceXmlValue(xml, "edgefwdn", getDnForEdgeFirewall(tenantName));
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public Map<String, String> listUnAssocAsa1000v() throws ExecutionException {
+        String xml = VnmcXml.LIST_UNASSOC_ASA1000V.getXml();
+        String service = VnmcXml.LIST_UNASSOC_ASA1000V.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+
+        String response =  sendRequest(service, xml);
+
+        Map<String, String> result = new HashMap<String, String>();
+        Document xmlDoc = getDocument(response);
+        xmlDoc.normalize();
+        NodeList fwList = xmlDoc.getElementsByTagName("fwInstance");
+        for (int j=0; j < fwList.getLength(); j++) {
+            Node fwNode = fwList.item(j);
+            result.put(fwNode.getAttributes().getNamedItem("mgmtIp").getNodeValue(),
+                    fwNode.getAttributes().getNamedItem("dn").getNodeValue());
+        }
+
+        return result;
+    }
+
+    @Override
+    public boolean assignAsa1000v(String tenantName, String firewallDn) throws ExecutionException {
+        String xml = VnmcXml.ASSIGN_ASA1000V.getXml();
+        String service = VnmcXml.ASSIGN_ASA1000V.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "binddn", getDnForEdgeFirewall(tenantName) + "/binding");
+        xml = replaceXmlValue(xml, "fwdn", firewallDn);
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    @Override
+    public boolean unassignAsa1000v(String tenantName, String firewallDn) throws ExecutionException {
+        String xml = VnmcXml.UNASSIGN_ASA1000V.getXml();
+        String service = VnmcXml.UNASSIGN_ASA1000V.getService();
+        xml = replaceXmlValue(xml, "cookie", _cookie);
+        xml = replaceXmlValue(xml, "binddn", getDnForEdgeFirewall(tenantName) + "/binding");
+        xml = replaceXmlValue(xml, "fwdn", firewallDn);
+
+        String response =  sendRequest(service, xml);
+        return verifySuccess(response);
+    }
+
+    private String sendRequest(String service, String xmlRequest) throws ExecutionException {
+        org.apache.commons.httpclient.protocol.Protocol myhttps = 
+                new org.apache.commons.httpclient.protocol.Protocol("https", new EasySSLProtocolSocketFactory(), 443);
+        HttpClient client = new HttpClient();
+        client.getHostConfiguration().setHost(_ip, 443, myhttps);
+        byte[] response = null;
+        PostMethod method = new PostMethod("/xmlIM/" + service);
+        
+        method.setRequestBody(xmlRequest);
+        
+        try{
+            int statusCode = client.executeMethod(method);
+                     
+            if (statusCode != HttpStatus.SC_OK) {
+                throw new Exception("Error code : " + statusCode);
+            }
+            response = method.getResponseBody();
+        }catch(Exception e){
+            System.out.println(e.getMessage());
+            throw new ExecutionException(e.getMessage());
+        }
+        System.out.println(new String(response));
+        return new String(response);
+    }
+
+    private Map<String, String> checkResponse(String xmlResponse, String... keys) throws ExecutionException {
+        Document xmlDoc = getDocument(xmlResponse);
+        Map<String, String> result = new HashMap<String, String>();
+        Node topElement = xmlDoc.getChildNodes().item(0);
+        if (topElement != null) {
+            for (String key: keys){
+                Node valueNode = topElement.getAttributes().getNamedItem(key);
+                result.put(key, valueNode==null?null:valueNode.getNodeValue());
+            }
+        }
+        return result;
+    }
+
+    private boolean verifySuccess(String xmlResponse) throws ExecutionException {
+        Map<String, String> checked = checkResponse(xmlResponse, "errorCode", "errorDescr");
+
+        if (checked.get("errorCode") != null) {
+            String errorCode = checked.get("errorCode");
+            if (errorCode.equals("103")) {
+                //tenant already exists
+                return true;
+            }
+            String errorDescr = checked.get("errorDescr");
+            throw new ExecutionException(errorDescr);
+        }
+        return true;
+    }
+
+    /*
+     * XML utils
+     */
+    
+    private Document getDocument(String xml) throws ExecutionException {
+        StringReader xmlReader = new StringReader("<?xml version=\"1.0\"?> \n" + xml.trim());
+        InputSource xmlSource = new InputSource(xmlReader);
+        Document doc = null; 
+
+        try {
+            doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(xmlSource);
+            
+        } catch (Exception e) {
+            s_logger.error(e);
+            throw new ExecutionException(e.getMessage());
+        }
+
+        if (doc == null) {
+            throw new ExecutionException("Failed to parse xml " + xml);
+        } else {
+            return doc;
+        }
+    }    
+
+    private String replaceXmlTag(String xml, String oldTag, String newTag) {
+        return xml.replaceAll(oldTag, newTag);
+    }
+
+    private String replaceXmlValue(String xml, String marker, String value) {
+        marker = "\\s*%" + marker + "%\\s*";
+
+        if (value == null) {
+            value = "";
+        }
+
+        return xml.replaceAll(marker, value);
+    }
+
+    private String extractXml(String xml, String marker) {
+        String startMarker = "<" + marker + ">";
+        String endMarker = "</" + marker + ">";
+        if (xml.contains(startMarker) && xml.contains(endMarker)) {
+            return xml.substring(xml.indexOf(startMarker) + startMarker.length(), xml.indexOf(endMarker));
+        } else {
+            return null;
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcController.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcController.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcController.java
new file mode 100644
index 0000000..e756165
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcController.java
@@ -0,0 +1,40 @@
+// 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.cisco;
+
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
+import com.cloud.org.Grouping;
+
+public interface CiscoVnmcController extends Grouping, InternalIdentity, Identity {
+
+    long getId();
+
+    String getUuid();
+
+    void setUuid(String uuid);
+
+    long getPhysicalNetworkId();
+
+    long getHostId();
+
+    String getProviderName();
+
+    String getDeviceName();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcControllerVO.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcControllerVO.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcControllerVO.java
new file mode 100644
index 0000000..4207f1d
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcControllerVO.java
@@ -0,0 +1,102 @@
+// 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.cisco;
+
+import java.util.UUID;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Entity
+@Table(name="external_cisco_vnmc_devices")
+public class CiscoVnmcControllerVO implements CiscoVnmcController {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name="id")
+    private long id;
+
+    @Column(name="uuid")
+    private String uuid;
+
+    @Column(name="host_id")
+    private long hostId;
+
+    @Column(name="physical_network_id")
+    private long physicalNetworkId;
+
+    @Column(name="provider_name")
+    private String providerName;
+
+    @Column(name="device_name")
+    private String deviceName;
+
+
+    public CiscoVnmcControllerVO() {
+        this.uuid = UUID.randomUUID().toString();
+    }
+
+    public CiscoVnmcControllerVO(long hostId, long physicalNetworkId,
+            String providerName, String deviceName) {
+        super();
+        this.hostId = hostId;
+        this.physicalNetworkId = physicalNetworkId;
+        this.providerName = providerName;
+        this.deviceName = deviceName;
+        this.uuid = UUID.randomUUID().toString();
+    }
+
+    @Override
+    public long getId() {
+        return id;
+    }
+
+    @Override
+    public String getUuid() {
+        return uuid;
+    }
+
+    @Override
+    public void setUuid(String uuid) {
+        this.uuid = uuid;
+    }
+
+    @Override
+    public long getPhysicalNetworkId() {
+        return physicalNetworkId;
+    }
+
+    @Override
+    public long getHostId() {
+        return hostId;
+    }
+
+    @Override
+    public String getProviderName() {
+        return providerName;
+    }
+
+    @Override
+    public String getDeviceName() {
+        return deviceName;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/NetworkAsa1000vMap.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/NetworkAsa1000vMap.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/NetworkAsa1000vMap.java
new file mode 100755
index 0000000..2e004dc
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/NetworkAsa1000vMap.java
@@ -0,0 +1,31 @@
+// 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.cisco;
+
+import org.apache.cloudstack.api.InternalIdentity;
+
+import com.cloud.org.Grouping;
+
+public interface NetworkAsa1000vMap extends Grouping, InternalIdentity {
+
+    long getId();
+
+    long getNetworkId();
+
+    long getAsa1000vId();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/NetworkAsa1000vMapVO.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/NetworkAsa1000vMapVO.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/NetworkAsa1000vMapVO.java
new file mode 100755
index 0000000..9638b6f
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/NetworkAsa1000vMapVO.java
@@ -0,0 +1,73 @@
+// 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.cisco;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Entity
+@Table(name="network_asa1000v_map")
+public class NetworkAsa1000vMapVO implements NetworkAsa1000vMap {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name="id")
+    private long id;
+
+    @Column(name="network_id")
+    private long networkId;
+
+    @Column(name="asa1000v_id")
+    private long asa1000vId;
+    
+    public NetworkAsa1000vMapVO() {
+    }
+
+    public NetworkAsa1000vMapVO(long networkId, long asa1000vId) {
+        super();
+        this.networkId = networkId;
+        this.asa1000vId = asa1000vId;
+    }
+
+	@Override
+	public long getId() {
+		return id;
+	}
+
+	@Override
+	public long getAsa1000vId() {
+		return asa1000vId;
+	}
+
+	public void setAsa1000vId(long asa1000vId) {
+		this.asa1000vId = asa1000vId;
+	}
+
+	@Override
+	public long getNetworkId() {
+		return networkId;
+	}
+
+	public void setNetworkId(long networkId) {
+		this.networkId = networkId;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoAsa1000vDao.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoAsa1000vDao.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoAsa1000vDao.java
new file mode 100755
index 0000000..1a380b1
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoAsa1000vDao.java
@@ -0,0 +1,33 @@
+// 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.dao;
+
+import java.util.List;
+
+import com.cloud.network.cisco.CiscoAsa1000vDeviceVO;
+import com.cloud.utils.db.GenericDao;
+
+public interface CiscoAsa1000vDao extends GenericDao<CiscoAsa1000vDeviceVO, Long>{
+    /**
+     * list all the Cisco Asa 1000v devices added in to this physical network
+     * @param physicalNetworkId physical Network Id
+     * @return list of CiscoAsa1000vDeviceVO for this physical network.
+     */
+    List<CiscoAsa1000vDeviceVO> listByPhysicalNetwork(long physicalNetworkId);
+
+    CiscoAsa1000vDeviceVO findByManagementIp(String managementIp);
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoAsa1000vDaoImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoAsa1000vDaoImpl.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoAsa1000vDaoImpl.java
new file mode 100755
index 0000000..a5820de
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoAsa1000vDaoImpl.java
@@ -0,0 +1,63 @@
+// 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.dao;
+
+import java.util.List;
+
+import javax.ejb.Local;
+
+import org.springframework.stereotype.Component;
+
+import com.cloud.network.cisco.CiscoAsa1000vDeviceVO;
+import com.cloud.utils.db.GenericDaoBase;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+import com.cloud.utils.db.SearchCriteria.Op;
+
+@Component
+@Local(value=CiscoAsa1000vDao.class)
+public class CiscoAsa1000vDaoImpl extends GenericDaoBase<CiscoAsa1000vDeviceVO, Long>
+        implements CiscoAsa1000vDao {
+
+    protected final SearchBuilder<CiscoAsa1000vDeviceVO> physicalNetworkIdSearch;
+    protected final SearchBuilder<CiscoAsa1000vDeviceVO> managementIpSearch;
+
+    public CiscoAsa1000vDaoImpl() {
+        physicalNetworkIdSearch = createSearchBuilder();
+        physicalNetworkIdSearch.and("physicalNetworkId", physicalNetworkIdSearch.entity().getPhysicalNetworkId(), Op.EQ);
+        physicalNetworkIdSearch.done();
+
+        managementIpSearch = createSearchBuilder();
+        managementIpSearch.and("managementIp", managementIpSearch.entity().getManagementIp(), Op.EQ);
+        managementIpSearch.done();
+    }
+
+    @Override
+    public List<CiscoAsa1000vDeviceVO> listByPhysicalNetwork(long physicalNetworkId) {
+        SearchCriteria<CiscoAsa1000vDeviceVO> sc = physicalNetworkIdSearch.create();
+        sc.setParameters("physicalNetworkId", physicalNetworkId);
+        return search(sc, null);
+    }
+
+    @Override
+    public CiscoAsa1000vDeviceVO findByManagementIp(String managementIp) {
+        SearchCriteria<CiscoAsa1000vDeviceVO> sc = managementIpSearch.create();
+        sc.setParameters("managementIp", managementIp);
+        return findOneBy(sc);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoVnmcDao.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoVnmcDao.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoVnmcDao.java
new file mode 100644
index 0000000..f0b3948
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoVnmcDao.java
@@ -0,0 +1,32 @@
+// 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.dao;
+
+import java.util.List;
+
+import com.cloud.network.cisco.CiscoVnmcControllerVO;
+import com.cloud.utils.db.GenericDao;
+
+public interface CiscoVnmcDao extends GenericDao<CiscoVnmcControllerVO, Long>{
+    /**
+     * list all the Cisco VNMC devices added in to this physical network
+     * @param physicalNetworkId physical Network Id
+     * @return list of CiscoVnmcDeviceVO for this physical network.
+     */
+    List<CiscoVnmcControllerVO> listByPhysicalNetwork(long physicalNetworkId);
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoVnmcDaoImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoVnmcDaoImpl.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoVnmcDaoImpl.java
new file mode 100644
index 0000000..8951810
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/CiscoVnmcDaoImpl.java
@@ -0,0 +1,51 @@
+// 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.dao;
+
+import java.util.List;
+
+import javax.ejb.Local;
+
+import org.springframework.stereotype.Component;
+
+import com.cloud.network.cisco.CiscoVnmcControllerVO;
+import com.cloud.utils.db.GenericDaoBase;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+import com.cloud.utils.db.SearchCriteria.Op;
+
+@Component
+@Local(value=CiscoVnmcDao.class)
+public class CiscoVnmcDaoImpl extends GenericDaoBase<CiscoVnmcControllerVO, Long>
+        implements CiscoVnmcDao {
+    
+    protected final SearchBuilder<CiscoVnmcControllerVO> physicalNetworkIdSearch;
+
+    public CiscoVnmcDaoImpl() {
+        physicalNetworkIdSearch = createSearchBuilder();
+        physicalNetworkIdSearch.and("physicalNetworkId", physicalNetworkIdSearch.entity().getPhysicalNetworkId(), Op.EQ);
+        physicalNetworkIdSearch.done();
+    }
+
+    @Override
+    public List<CiscoVnmcControllerVO> listByPhysicalNetwork(long physicalNetworkId) {
+        SearchCriteria<CiscoVnmcControllerVO> sc = physicalNetworkIdSearch.create();
+        sc.setParameters("physicalNetworkId", physicalNetworkId);
+        return search(sc, null);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/NetworkAsa1000vMapDao.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/NetworkAsa1000vMapDao.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/NetworkAsa1000vMapDao.java
new file mode 100755
index 0000000..053f4af
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/NetworkAsa1000vMapDao.java
@@ -0,0 +1,28 @@
+// 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.dao;
+
+import com.cloud.network.cisco.NetworkAsa1000vMapVO;
+import com.cloud.utils.db.GenericDao;
+
+public interface NetworkAsa1000vMapDao extends GenericDao<NetworkAsa1000vMapVO, Long>{
+
+    NetworkAsa1000vMapVO findByNetworkId(long networkId);
+
+    NetworkAsa1000vMapVO findByAsa1000vId(long asa1000vId);
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/NetworkAsa1000vMapDaoImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/NetworkAsa1000vMapDaoImpl.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/NetworkAsa1000vMapDaoImpl.java
new file mode 100755
index 0000000..692b3d6
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/dao/NetworkAsa1000vMapDaoImpl.java
@@ -0,0 +1,61 @@
+// 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.dao;
+
+import javax.ejb.Local;
+
+import org.springframework.stereotype.Component;
+
+import com.cloud.network.cisco.NetworkAsa1000vMapVO;
+import com.cloud.utils.db.GenericDaoBase;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+import com.cloud.utils.db.SearchCriteria.Op;
+
+@Component
+@Local(value=NetworkAsa1000vMapDao.class)
+public class NetworkAsa1000vMapDaoImpl extends GenericDaoBase<NetworkAsa1000vMapVO, Long>
+        implements NetworkAsa1000vMapDao {
+
+    protected final SearchBuilder<NetworkAsa1000vMapVO> networkSearch;
+    protected final SearchBuilder<NetworkAsa1000vMapVO> asa1000vSearch;
+
+    public NetworkAsa1000vMapDaoImpl() {
+        networkSearch = createSearchBuilder();
+        networkSearch.and("networkId", networkSearch.entity().getNetworkId(), Op.EQ);
+        networkSearch.done();
+
+        asa1000vSearch = createSearchBuilder();
+        asa1000vSearch.and("asa1000vId", asa1000vSearch.entity().getAsa1000vId(), Op.EQ);
+        asa1000vSearch.done();
+    }
+
+    @Override
+    public NetworkAsa1000vMapVO findByNetworkId(long networkId) {
+        SearchCriteria<NetworkAsa1000vMapVO> sc = networkSearch.create();
+        sc.setParameters("networkId", networkId);
+        return findOneBy(sc);
+    }
+
+    @Override
+    public NetworkAsa1000vMapVO findByAsa1000vId(long asa1000vId) {
+        SearchCriteria<NetworkAsa1000vMapVO> sc = asa1000vSearch.create();
+        sc.setParameters("asa1000vId", asa1000vId);
+        return findOneBy(sc);
+    }
+
+}


[02/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
Fixing the apidoc for the new api dedicatePublicIpRange

Signed-off-by: Prasanna Santhanam <ts...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0b17b624
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0b17b624
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0b17b624

Branch: refs/heads/ui-vm-affinity
Commit: 0b17b624dbfa517e48cbcb09fb695370d4a8ac03
Parents: fd84c56
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Wed Apr 10 16:32:19 2013 +0530
Committer: Likitha Shetty <li...@citrix.com>
Committed: Fri Apr 12 23:27:42 2013 +0530

----------------------------------------------------------------------
 tools/apidoc/gen_toc.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0b17b624/tools/apidoc/gen_toc.py
----------------------------------------------------------------------
diff --git a/tools/apidoc/gen_toc.py b/tools/apidoc/gen_toc.py
index 2d5292b..5403adb 100644
--- a/tools/apidoc/gen_toc.py
+++ b/tools/apidoc/gen_toc.py
@@ -83,6 +83,7 @@ known_categories = {
     'Configuration': 'Configuration',
     'Capabilities': 'Configuration',
     'Pod': 'Pod',
+    'PublicIpRange': 'Network',
     'Zone': 'Zone',
     'NetworkOffering': 'Network Offering',
     'NetworkACL': 'Network ACL',


[08/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
debian: Package the AWSAPI bridge


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/15c26195
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/15c26195
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/15c26195

Branch: refs/heads/ui-vm-affinity
Commit: 15c26195c52e3cd0f276bbdf5c0a990b8a917af7
Parents: e354807
Author: Wido den Hollander <wi...@42on.com>
Authored: Thu Apr 11 10:25:46 2013 +0200
Committer: Wido den Hollander <wi...@42on.com>
Committed: Sat Apr 13 11:12:39 2013 +0200

----------------------------------------------------------------------
 debian/cloudstack-awsapi.install |   10 +++++++++-
 debian/rules                     |   20 +++++++++++++++++++-
 2 files changed, 28 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/15c26195/debian/cloudstack-awsapi.install
----------------------------------------------------------------------
diff --git a/debian/cloudstack-awsapi.install b/debian/cloudstack-awsapi.install
index 02ba668..675b84d 100644
--- a/debian/cloudstack-awsapi.install
+++ b/debian/cloudstack-awsapi.install
@@ -15,4 +15,12 @@
 # specific language governing permissions and limitations
 # under the License.
 
-/var/log/cloudstack/awsapi
\ No newline at end of file
+/etc/cloudstack/management/cloud-bridge.properties
+/etc/cloudstack/management/commons-logging.properties
+/etc/cloudstack/management/crypto.properties
+/etc/cloudstack/management/xes.keystore
+/etc/cloudstack/management/ec2-service.properties
+/var/log/cloudstack/awsapi
+/usr/bin/cloudstack-setup-bridge
+/usr/bin/cloudstack-aws-api-register
+/usr/share/cloudstack-bridge
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/15c26195/debian/rules
----------------------------------------------------------------------
diff --git a/debian/rules b/debian/rules
index 4e55c71..f5f68ab 100755
--- a/debian/rules
+++ b/debian/rules
@@ -34,7 +34,7 @@ build: build-indep
 build-indep: build-indep-stamp
 
 build-indep-stamp: configure
-	mvn package -DskipTests -Dsystemvm \
+	mvn -Pawsapi package -DskipTests -Dsystemvm \
         -Dcs.replace.properties=replace.properties.tmp
 	touch $@
 
@@ -147,7 +147,25 @@ install:
 	install -D packaging/debian/init/cloud-usage $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-usage
 
 	# cloudstack-awsapi
+	mkdir $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/awsapi
 	mkdir $(DESTDIR)/var/log/$(PACKAGE)/awsapi
+	mkdir $(DESTDIR)/usr/share/$(PACKAGE)-bridge
+	mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-bridge/webapps/awsapi
+	mkdir $(DESTDIR)/usr/share/$(PACKAGE)-bridge/setup
+	cp -r awsapi/target/cloud-awsapi-$(VERSION)-SNAPSHOT/* $(DESTDIR)/usr/share/$(PACKAGE)-bridge/webapps/awsapi
+	install -D awsapi-setup/setup/cloud-setup-bridge $(DESTDIR)/usr/bin/cloudstack-setup-bridge
+	install -D awsapi-setup/setup/cloudstack-aws-api-register $(DESTDIR)/usr/bin/cloudstack-aws-api-register
+	cp -r awsapi-setup/db/mysql/* $(DESTDIR)/usr/share/$(PACKAGE)-bridge/setup
+	for i in applicationContext.xml cloud-bridge.properties commons-logging.properties crypto.properties xes.keystore ec2-service.properties; do \
+		mv $(DESTDIR)/usr/share/$(PACKAGE)-bridge/webapps/awsapi/WEB-INF/classes/$$i $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/; \
+	done
+	rm $(DESTDIR)/usr/share/$(PACKAGE)-bridge/webapps/awsapi/WEB-INF/classes/log4j-vmops.xml
+	rm $(DESTDIR)/usr/share/$(PACKAGE)-bridge/webapps/awsapi/WEB-INF/classes/log4j.properties
+	rm $(DESTDIR)/usr/share/$(PACKAGE)-bridge/webapps/awsapi/WEB-INF/classes/db.properties
+	rm $(DESTDIR)/usr/share/$(PACKAGE)-bridge/webapps/awsapi/WEB-INF/classes/LICENSE.txt
+	rm $(DESTDIR)/usr/share/$(PACKAGE)-bridge/webapps/awsapi/WEB-INF/classes/NOTICE.txt
+	rm $(DESTDIR)/usr/share/$(PACKAGE)-bridge/webapps/awsapi/WEB-INF/classes/services.xml
+	rm -rf $(DESTDIR)/usr/share/$(PACKAGE)-bridge/webapps/awsapi/WEB-INF/classes/META-INF
 
 	dh_installdirs
 	dh_install


[28/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
Squashed commit of the following:

commit 7ce45ea1087407b87ff14d0f9ae5a7647c3f3ccc
Author: Koushik Das <ko...@citrix.com>
Date:   Mon Apr 15 18:36:33 2013 +0530

    Fixed indentation and line ending

commit 0232048f904b850700899d65ded089d8d7e7ab83
Merge: 735c4c8 97911e9
Author: Koushik Das <ko...@citrix.com>
Date:   Mon Apr 15 17:05:59 2013 +0530

    Merge branch 'master' into cisco-vnmc-api-integration

    Conflicts:
    	api/src/org/apache/cloudstack/api/ApiConstants.java
    	client/tomcatconf/commands.properties.in
    	setup/db/db/schema-410to420.sql
    	tools/marvin/marvin/integration/lib/base.py

commit 735c4c895515a7d3acd59c97d98de95cc5935353
Author: Koushik Das <ko...@citrix.com>
Date:   Mon Apr 15 15:20:37 2013 +0530

    Fixed unit tests based on recent changes in the Vnmc resource code

commit f166f2d0bf9e341316c74ef8de4b52b3d5e14f4d
Author: Koushik Das <ko...@citrix.com>
Date:   Mon Apr 15 14:50:25 2013 +0530

    added tests to register vnmc and asa appliance in cloudstack

commit f38be4810e2e1349260ee262b85db81f60252d9e
Author: Koushik Das <ko...@citrix.com>
Date:   Mon Apr 8 18:42:06 2013 +0530

    Removed unwanted files

commit 902ce426c1ebba2d826744123edd971819f73763
Author: Koushik Das <ko...@citrix.com>
Date:   Mon Apr 8 17:59:30 2013 +0530

    Fixed auto-wiring of components for Cisco Vnmc

commit 08467ee30709268b536e649b24ad029db792934c
Author: Koushik Das <ko...@citrix.com>
Date:   Mon Apr 8 16:04:54 2013 +0530

    Fixed compilation issues, incorrect merges from last commit

commit 67f11d46ad8c13f371fe94c57fb287cb9d6005d1
Merge: 3422cee c9c68e1
Author: Koushik Das <ko...@citrix.com>
Date:   Mon Apr 8 15:11:10 2013 +0530

    Merge branch 'master' into cisco-vnmc-api-integration

commit 3422ceefb6d1f5a92ec0868c1261a22e2cfbc54e
Author: Koushik Das <ko...@citrix.com>
Date:   Mon Apr 8 14:42:32 2013 +0530

    Correctly associating nat, acl policy sets to edge security profile in VNMC

commit 9c1e193fca6f5e7687634fe27a98616362267fbf
Author: Koushik Das <ko...@citrix.com>
Date:   Sun Apr 7 21:22:22 2013 +0530

    Passing correct subnet mask while creating edge firewall in VNMC

commit 05e3d04b55549ef098a769509171b24ca4a62957
Author: Koushik Das <ko...@citrix.com>
Date:   Tue Apr 2 17:50:57 2013 +0530

    Added changes related to icmp

commit bcecb589de84caa570754c246565dfaa1cb1c2bf
Author: Koushik Das <ko...@citrix.com>
Date:   Mon Apr 1 13:57:21 2013 +0530

    Some xml file renames

commit 9c1ee93f2e74ea785ca06cb25f62fad4ad10c69e
Author: Koushik Das <ko...@citrix.com>
Date:   Sat Mar 30 15:54:25 2013 +0530

    Fixed PF and static NAT rule creation in VNMC

commit 7e6159fa054ec13c8f70fb58af2fdae2f55a0c70
Author: Koushik Das <ko...@citrix.com>
Date:   Wed Mar 27 18:53:49 2013 +0530

    Added more unit tests for Cisco Vnmc element

commit fc0ed9adb6eaecbe5abbce1088eb80b98953f5cf
Author: Koushik Das <ko...@citrix.com>
Date:   Wed Mar 27 16:48:28 2013 +0530

    Cleaning up VNMC config as part of network shutdown

commit 5a427d48e20f50260b80c57f6e4c3bc6d9057c3f
Author: Koushik Das <ko...@citrix.com>
Date:   Wed Mar 27 02:22:54 2013 +0530

    Added unit test for Vnmc network element implement() method

commit 48cbf34d3bf44a5601842fa8bbc41be6beea3b07
Author: Koushik Das <ko...@citrix.com>
Date:   Wed Mar 27 02:20:45 2013 +0530

    Passing correct gateway ip while creating vservice node and guest port profile in Nexus

commit 2c386c61ef48a7cf9b282952152ecb7cedd21977
Author: Koushik Das <ko...@citrix.com>
Date:   Fri Mar 22 13:50:52 2013 +0530

    Nexus 1000v fix

commit 4d2168bfa980f1fa4b8a0d10aaf4bdd2395de7cf
Author: Koushik Das <ko...@citrix.com>
Date:   Fri Mar 22 00:30:01 2013 +0530

    Egress firewall rule

commit e81ab3a2f443cf0c032a1fae6ed8e0697865b69e
Author: Koushik Das <ko...@citrix.com>
Date:   Thu Mar 21 10:50:29 2013 +0530

    More tests for VnmcResource class

commit 9e9c179212e8c0896972c1f19a3327f97832697e
Author: Koushik Das <ko...@citrix.com>
Date:   Thu Mar 21 00:25:10 2013 +0530

    Fixed build issue from master merge

commit f0c1af2b5c037bf49bfc2775108600e2fbdc720f
Merge: 4f305c2 873ec27
Author: Koushik Das <ko...@citrix.com>
Date:   Wed Mar 20 16:20:10 2013 +0530

    Merge branch 'master' into cisco-vnmc-api-integration

    Conflicts:
    	api/src/com/cloud/network/Network.java
    	api/src/org/apache/cloudstack/api/ApiConstants.java
    	client/tomcatconf/components-nonoss.xml.in
    	client/tomcatconf/nonossComponentContext.xml.in
    	plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
    	plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
    	setup/db/db/schema-410to420.sql
    	vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java

commit 4f305c2beb02f836b5ece4e897bf812cd1e03751
Author: Koushik Das <ko...@citrix.com>
Date:   Wed Mar 20 15:09:34 2013 +0530

    Initial set of tests, will add more in subsequent commits

commit 50bfcc1f752e9ca9b8330d2c4e3b8c5c9dd33155
Author: Koushik Das <ko...@citrix.com>
Date:   Wed Mar 20 15:02:14 2013 +0530

    Updated pom to copy xmls to target location during build

commit 45bc92b8262e715fdead9411666cbe3274d3ee02
Author: Koushik Das <ko...@citrix.com>
Date:   Wed Mar 20 14:58:59 2013 +0530

    Fixed cpmpilation issue as missed out adding this file

commit 2ce7cdc756bd43adec006b877cb41da6f3e9dd57
Author: Koushik Das <ko...@citrix.com>
Date:   Sun Mar 17 17:02:25 2013 +0530

    Creating vservice node and associating it with port profile in nexus for guest VMs

commit 387545caff60541bda5eb67e7fd91e61df5fde3e
Author: Koushik Das <ko...@citrix.com>
Date:   Sat Mar 16 11:14:43 2013 +0530

    Added license headers to XML files

commit 43e29974215a73788b249f246d7e62825cf8b4e6
Author: Koushik Das <ko...@citrix.com>
Date:   Wed Mar 13 11:51:59 2013 +0530

    Changes related to instantiating the dao components

commit 99e88ecbf9980abe86fce89807b089a8c1a1a549
Author: Koushik Das <ko...@citrix.com>
Date:   Tue Mar 12 23:40:35 2013 +0530

    Fix build errors after merge from master

commit 7c20b120c294fec4456a7052b630207eb0383458
Author: Koushik Das <ko...@citrix.com>
Date:   Tue Mar 12 23:31:46 2013 +0530

    Fixing poms and other xmls

commit ee868759a8817ec66364ddd9f87b37b3fb8efd08
Merge: 9c94b6d a1b33ca
Author: Koushik Das <ko...@citrix.com>
Date:   Tue Mar 12 14:44:59 2013 +0530

    Merge branch 'master' into cisco-vnmc-api-integration

    Conflicts:
    	api/src/com/cloud/network/Network.java
    	api/src/org/apache/cloudstack/api/ApiConstants.java
    	plugins/pom.xml
    	setup/db/create-schema.sql

commit 9c94b6d231d851c24e6605b6645931f39caff548
Author: Koushik Das <ko...@citrix.com>
Date:   Fri Mar 8 22:20:23 2013 +0530

    Fixed XML to create static route in VNMC correctly

commit ef069b33235c9d9864749fcfec878c2c255b8c10
Author: Koushik Das <ko...@citrix.com>
Date:   Fri Mar 8 15:26:26 2013 +0530

    Added logic for revoking ACL, PF and Static NAT rules

commit 4c65b70668bf994adc8c55096dfefde98eb18180
Author: Koushik Das <ko...@citrix.com>
Date:   Fri Mar 8 13:51:37 2013 +0530

    Renamed delete-acl-rule -> delete-rule

commit aa94eca516836949da40f1c0672c0aad9699c759
Author: Koushik Das <ko...@citrix.com>
Date:   Fri Mar 8 00:38:52 2013 +0530

    - Creating static routes in VNMC as part of edge firewall configuration
    - Passing order parameter while creating rules so that they are evaluated in a specific order
    - Added methods in VnmcResource for listing acl policies and rules belonging to variouos policies. This is used to compute order while creation of various rules in VNMC

commit cc824e8585dc011843125f070f9bbf8dbf985384
Author: Koushik Das <ko...@citrix.com>
Date:   Thu Mar 7 12:16:29 2013 +0530

    Adding appropriate ACL rules for PF and static NAT

commit fb23c503655b29d33c6206dbf4df1ed7f64ff5e2
Author: Koushik Das <ko...@citrix.com>
Date:   Fri Mar 1 17:21:45 2013 +0530

    Added logic for deleting various VNMC artifacts. Added/updated relevant xmls as well.

commit 970c21a9a335a86c495553db3e1f86c3379bdb8e
Author: Koushik Das <ko...@citrix.com>
Date:   Fri Mar 1 01:54:10 2013 +0530

    Added implementation for delete of asa and vnmc apis

commit 22e1455142690acd7d5c5faed443cfb263d09dd9
Author: Koushik Das <ko...@citrix.com>
Date:   Fri Mar 1 01:19:43 2013 +0530

    List asa api to return guest network if associated. From this it can be inferred if asa is available or not

commit 32223736c9a52a73a3e401c301cf7dc3534639d2
Author: Koushik Das <ko...@citrix.com>
Date:   Fri Mar 1 00:50:55 2013 +0530

    Added Vmware cluster info along with asa1kv appliance.
    This is used to select the correct n1kv vsm for configuring the guest network

commit deed3cc9510fee58a02d4f485e3625335f038a57
Author: Koushik Das <ko...@citrix.com>
Date:   Mon Feb 25 18:03:59 2013 +0530

    Added support for static NAT rules.
    - Xmls for creating static nat rules in VNMC
    - applyStaticNats implementation in VNMC network element
    - handler for static nat in resource class

commit 681f0b7b509446d32fb326cd425cd6a8618fc45d
Author: Koushik Das <ko...@citrix.com>
Date:   Mon Feb 25 10:44:13 2013 +0530

    Added implementation for firewall and port forwarding rules in Cisco VNMC element class

commit 66b01a6589e0577ff6ba2a14f8df4f32f8c400fb
Author: Koushik Das <ko...@citrix.com>
Date:   Fri Feb 22 19:19:44 2013 +0530

    VNMC xml for deleting NAT policy

commit 5d9868676868c9f9555aa0e706a6f2f2430cd5cf
Author: Koushik Das <ko...@citrix.com>
Date:   Fri Feb 22 19:16:41 2013 +0530

    Added support for PF/DNAT rules.
    Created methods in VNMCConnection class to create PF rules. Also moved out common code for PF and source NAT in methods.
    Updated the corresponding VNMC resource class.

commit 8db2fbeb8f04b81399f0932a1f8fd782264fb181
Author: Koushik Das <ko...@citrix.com>
Date:   Fri Feb 22 18:21:45 2013 +0530

    Added xml for creating NAT policy set in VNMC

commit f2da0d50caf49efeb903b9abde9a4f996cf6cc1b
Author: Koushik Das <ko...@citrix.com>
Date:   Fri Feb 22 18:17:53 2013 +0530

    Added VNMC XMLs for supporting PF/DNAT rules.
    Also moved out some XMLs related to source NAT to common files so that these can be used for both source NAT and DNAT

commit 124a48819d34547d5355396c151279a23899ff65
Author: Koushik Das <ko...@citrix.com>
Date:   Thu Feb 21 17:53:12 2013 +0530

    Separated out creation of ACL policy set and policy in VNMC

commit 1e38515f35f6e567e0118fbea1cdc0dc5ebf9965
Author: Koushik Das <ko...@citrix.com>
Date:   Thu Feb 21 11:54:44 2013 +0530

    Added changes to create ingress fw rules in VNMC

commit cb2fba9e7c331634893b4597841ea13784844a84
Author: Koushik Das <ko...@citrix.com>
Date:   Thu Feb 14 16:23:05 2013 +0530

    Source NAT in VNMC

commit 720fe2f908895f2102c1cb00698568f4ddd4b8cd
Author: Koushik Das <ko...@citrix.com>
Date:   Wed Feb 13 14:16:47 2013 +0530

    Fix Vnmc test file

commit d6dbe790c6a569dceff1a598bec2522760695bdc
Author: Koushik Das <ko...@citrix.com>
Date:   Wed Feb 13 12:07:03 2013 +0530

    Added db. tables for asa1kv devices and their mapping with guest network

commit 3fd7e30f6e84adb607c3d61be32ecb889cfa73b3
Author: Koushik Das <ko...@citrix.com>
Date:   Wed Feb 13 11:52:12 2013 +0530

    Changes:
    - Added implementation for add/list asa1kv APIs
    - Added agent command for associating asa1kv appliance with logical edge firewall in VNMC
    - Added handler for the above agent command in VNMC resource class
    - Updated VNMC element class to support the above

commit d08e2a1fafdc68ea1c7d6327829aee5aa4c2c38d
Author: Koushik Das <ko...@citrix.com>
Date:   Wed Feb 13 11:40:58 2013 +0530

    Added lifecycle APIs for Cisco Asa 1000v appliance.
    Added corresponding Dao and VO classes.
    Also added mapping Dao and VO for guest netwok and asa appliance

commit 6b999ec867bee2cd31aff5d495470b25af6d45f8
Author: Koushik Das <ko...@citrix.com>
Date:   Tue Feb 12 00:05:39 2013 +0530

    Changes:
    a. Added handlers for CreateLogicalEdgeFirewall and ConfigureNexusVSMForASA commands
    b. Logic for add/list vnmc device API
    c. Partial implementation for network element implement()

commit 0656250308f3dd8a6991ee124a0fa3781214b327
Author: Koushik Das <ko...@citrix.com>
Date:   Mon Feb 11 23:48:19 2013 +0530

    Moved VNMC provider creation to Network.java. The plugin code would have been the ideal place to keep it but current state of the code doesn't allow it.

commit dc402eaa7a67c1b457ccf2243a0e53371a0bcfa9
Author: Koushik Das <ko...@citrix.com>
Date:   Mon Feb 11 23:35:19 2013 +0530

    Added new commands for the following:
    a. Logical edge firewall creation in VNMC
    b. Asa1kv vservice node creation and updating asa1kv inside port profile with guest network vlan id in n1kv VSM

commit d6cdfe35f8bdb5a22759678da1cf6f1835debecc
Author: Koushik Das <ko...@citrix.com>
Date:   Mon Feb 11 23:06:36 2013 +0530

    Added helper method to create port profile in n1kv VSM with additional parameters VDC tenant and edge security profile
    Added helper method to create a vservice node in n1kv VSM

commit db42da17e9d3cf7466e0f755d5046d710a5f5356
Author: Koushik Das <ko...@citrix.com>
Date:   Mon Feb 11 22:44:01 2013 +0530

    Added database table for storing VNMC devices

commit f991436335254eae4dc11a9f089a5c6e94403cd3
Author: Koushik Das <ko...@citrix.com>
Date:   Fri Feb 8 16:00:15 2013 +0530

    Added support for network offering creation with VNMC as provider for firewall, port forwarding, source nat

commit 74de210359396b1ac880aa0ffa3a38df6574e07d
Author: Koushik Das <ko...@citrix.com>
Date:   Fri Feb 8 15:06:11 2013 +0530

    Added name attribute for the VNMC lifecycle commands

commit 6ce25ef11dd7eb98b0ae999f9748e7ea907b7e10
Author: Chiradeep Vittal <ch...@apache.org>
Date:   Wed Jan 16 16:44:28 2013 -0800

    Fix licensing

commit 392cd8ed631009590c0001e88a82b17294af2c3e
Author: Chiradeep Vittal <ch...@apache.org>
Date:   Wed Jan 16 16:38:19 2013 -0800

    cisco-vnmc: Fix api to use new conventions

commit 6b142bbaabc1a00c94ec598bbd8e257274372d42
Author: Chiradeep Vittal <ch...@apache.org>
Date:   Wed Jan 16 15:33:33 2013 -0800

    WIP: configure ASA port profile

    Signed-off-by: Chiradeep Vittal <ch...@apache.org>

commit 1ae21ea49a5535a3e839aba0ccfe95c7e9d9abbd
Author: Chiradeep Vittal <ch...@apache.org>
Date:   Wed Jan 16 15:33:01 2013 -0800

    WIP rename device to resource to better reflect nature of VNMC

    Signed-off-by: Chiradeep Vittal <ch...@apache.org>

commit 84d218f972e48d5f92e6659282d6d1762070b108
Author: Chiradeep Vittal <ch...@apache.org>
Date:   Wed Jan 16 15:32:54 2013 -0800

    WIP: fixes for associating ASA1000v to tenant

    Signed-off-by: Chiradeep Vittal <ch...@apache.org>

commit d74c6a9ac2efc939aa98c466bf0cd9bcf5e5563c
Author: Chiradeep Vittal <ch...@apache.org>
Date:   Wed Jan 16 15:32:45 2013 -0800

    WIP: fixes for associating ASA1000v to tenant

    Signed-off-by: Chiradeep Vittal <ch...@apache.org>

commit 9350d10849015c3bc710efff48045ca7bd9513f4
Author: Chiradeep Vittal <ch...@apache.org>
Date:   Wed Jan 16 15:32:29 2013 -0800

    WIP: admin commands for adding / listing VNMC

    Signed-off-by: Chiradeep Vittal <ch...@apache.org>

commit a8031a0cfed08f59b9e22f5b914f7bc205e04104
Author: Chiradeep Vittal <ch...@apache.org>
Date:   Wed Jan 16 15:30:41 2013 -0800

    WIP ASA 1000v listing"

    Signed-off-by: Chiradeep Vittal <ch...@apache.org>

commit f9cc674b9ce5a04f4cf1c17882c597fcc336b121
Author: Chiradeep Vittal <ch...@apache.org>
Date:   Wed Jan 16 15:30:36 2013 -0800

    WIP : edge firewall

    Signed-off-by: Chiradeep Vittal <ch...@apache.org>

commit 6a0964af00437e2175c95f76e913683393ee8988
Author: Chiradeep Vittal <ch...@apache.org>
Date:   Wed Jan 16 15:30:30 2013 -0800

    WIP : edge security policy

    Signed-off-by: Chiradeep Vittal <ch...@apache.org>

commit e32295e8cf3baacb154b2a6cecf48dc3be74f505
Author: Chiradeep Vittal <ch...@apache.org>
Date:   Wed Jan 16 15:30:24 2013 -0800

    WIP : dhcp server policy

    Signed-off-by: Chiradeep Vittal <ch...@apache.org>

commit 446a9b84919e8e3d0ed9f131c675726c42ed6a4f
Author: Chiradeep Vittal <ch...@apache.org>
Date:   Wed Jan 16 15:30:18 2013 -0800

    WIP : dhcp server policy

    Signed-off-by: Chiradeep Vittal <ch...@apache.org>

commit e35e0eb59ba3e011cad68155b06e96eaf257e91e
Author: Chiradeep Vittal <ch...@apache.org>
Date:   Wed Jan 16 15:30:14 2013 -0800

    Move unit test

    Signed-off-by: Chiradeep Vittal <ch...@apache.org>

commit 2b43a3e74ef0e448eb407d3a967f9d8cf2a1d71b
Author: Chiradeep Vittal <ch...@apache.org>
Date:   Wed Jan 16 15:30:08 2013 -0800

    Move unit test

    Signed-off-by: Chiradeep Vittal <ch...@apache.org>

commit 11b804a8940c17e105b25ac7f9dfd87651e4c55a
Author: Chiradeep Vittal <ch...@apache.org>
Date:   Wed Jan 16 15:29:54 2013 -0800

    WIP: XML control of VNMC

    Signed-off-by: Chiradeep Vittal <ch...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e94c7025
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e94c7025
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e94c7025

Branch: refs/heads/ui-vm-affinity
Commit: e94c70254be7a593b9c30931948621a86b35455f
Parents: ae16f33
Author: Koushik Das <ko...@citrix.com>
Authored: Mon Apr 15 18:58:43 2013 +0530
Committer: Koushik Das <ko...@citrix.com>
Committed: Mon Apr 15 18:58:43 2013 +0530

----------------------------------------------------------------------
 api/src/com/cloud/network/Network.java             |    1 +
 .../org/apache/cloudstack/api/ApiConstants.java    |    1 +
 .../network/ExternalNetworkDeviceManager.java      |    1 +
 client/pom.xml                                     |   10 +
 client/tomcatconf/commands.properties.in           |   11 +
 client/tomcatconf/nonossComponentContext.xml.in    |   11 +
 .../src/com/cloud/hypervisor/guru/VMwareGuru.java  |   18 +-
 .../vmware/manager/VmwareManagerImpl.java          |    3 +-
 .../hypervisor/vmware/resource/VmwareResource.java |   13 +-
 plugins/network-elements/cisco-vnmc/pom.xml        |   42 +
 .../scripts/network/cisco/assoc-asa1000v.xml       |   34 +
 .../network/cisco/associate-acl-policy-set.xml     |   37 +
 .../network/cisco/associate-dhcp-policy.xml        |   34 +
 .../network/cisco/associate-dhcp-server.xml        |   32 +
 .../network/cisco/associate-nat-policy-set.xml     |   35 +
 .../network/cisco/associate-route-policy.xml       |   33 +
 .../network/cisco/create-acl-policy-ref.xml        |   38 +
 .../network/cisco/create-acl-policy-set.xml        |   36 +
 .../scripts/network/cisco/create-acl-policy.xml    |   35 +
 .../network/cisco/create-acl-rule-for-dnat.xml     |   82 +
 .../network/cisco/create-acl-rule-for-pf.xml       |  156 ++
 .../scripts/network/cisco/create-dhcp-policy.xml   |   72 +
 .../scripts/network/cisco/create-dnat-rule.xml     |   91 +
 .../network/cisco/create-edge-device-profile.xml   |   32 +
 .../cisco/create-edge-device-route-policy.xml      |   30 +
 .../network/cisco/create-edge-device-route.xml     |   35 +
 .../scripts/network/cisco/create-edge-firewall.xml |   89 +
 .../network/cisco/create-edge-security-profile.xml |   41 +
 .../network/cisco/create-egress-acl-rule.xml       |  201 ++
 .../cisco/create-generic-egress-acl-rule.xml       |  122 ++
 .../cisco/create-generic-ingress-acl-rule.xml      |  121 ++
 .../network/cisco/create-ingress-acl-rule.xml      |  201 ++
 .../scripts/network/cisco/create-ip-pool.xml       |   58 +
 .../network/cisco/create-nat-policy-ref.xml        |   38 +
 .../network/cisco/create-nat-policy-set.xml        |   37 +
 .../scripts/network/cisco/create-nat-policy.xml    |   33 +
 .../scripts/network/cisco/create-pf-rule.xml       |  166 ++
 .../scripts/network/cisco/create-port-pool.xml     |   72 +
 .../network/cisco/create-source-nat-pool.xml       |   58 +
 .../network/cisco/create-source-nat-rule.xml       |  103 ++
 .../scripts/network/cisco/create-tenant.xml        |   29 +
 .../scripts/network/cisco/create-vdc.xml           |   30 +
 .../network/cisco/delete-acl-policy-set.xml        |   30 +
 .../scripts/network/cisco/delete-acl-policy.xml    |   33 +
 .../scripts/network/cisco/delete-edge-firewall.xml |   30 +
 .../network/cisco/delete-edge-security-profile.xml |   38 +
 .../network/cisco/delete-nat-policy-set.xml        |   30 +
 .../scripts/network/cisco/delete-nat-policy.xml    |   33 +
 .../scripts/network/cisco/delete-rule.xml          |   31 +
 .../scripts/network/cisco/delete-tenant.xml        |   30 +
 .../scripts/network/cisco/delete-vdc.xml           |   30 +
 .../scripts/network/cisco/disassoc-asa1000v.xml    |   30 +
 .../scripts/network/cisco/list-acl-policies.xml    |   31 +
 .../scripts/network/cisco/list-children.xml        |   27 +
 .../scripts/network/cisco/list-nat-policies.xml    |   31 +
 .../network/cisco/list-policyrefs-in-policyset.xml |   31 +
 .../scripts/network/cisco/list-tenants.xml         |   26 +
 .../network/cisco/list-unassigned-asa1000v.xml     |   39 +
 .../cisco-vnmc/scripts/network/cisco/login.xml     |   20 +
 ...AssociateAsaWithLogicalEdgeFirewallCommand.java |   53 +
 .../api/CleanupLogicalEdgeFirewallCommand.java     |   43 +
 .../agent/api/ConfigureNexusVsmForAsaCommand.java  |   95 +
 .../api/CreateLogicalEdgeFirewallCommand.java      |   94 +
 .../api/commands/AddCiscoAsa1000vResourceCmd.java  |  116 ++
 .../api/commands/AddCiscoVnmcResourceCmd.java      |  115 ++
 .../commands/DeleteCiscoAsa1000vResourceCmd.java   |   93 +
 .../api/commands/DeleteCiscoVnmcResourceCmd.java   |   93 +
 .../commands/ListCiscoAsa1000vResourcesCmd.java    |  110 ++
 .../api/commands/ListCiscoVnmcResourcesCmd.java    |  106 ++
 .../response/CiscoAsa1000vResourceResponse.java    |   88 +
 .../api/response/CiscoVnmcResourceResponse.java    |   75 +
 .../cloud/network/cisco/CiscoAsa1000vDevice.java   |   39 +
 .../cloud/network/cisco/CiscoAsa1000vDeviceVO.java |  101 +
 .../cloud/network/cisco/CiscoVnmcConnection.java   |  196 ++
 .../network/cisco/CiscoVnmcConnectionImpl.java     | 1415 +++++++++++++++
 .../cloud/network/cisco/CiscoVnmcController.java   |   40 +
 .../cloud/network/cisco/CiscoVnmcControllerVO.java |  102 ++
 .../cloud/network/cisco/NetworkAsa1000vMap.java    |   31 +
 .../cloud/network/cisco/NetworkAsa1000vMapVO.java  |   73 +
 .../com/cloud/network/dao/CiscoAsa1000vDao.java    |   33 +
 .../cloud/network/dao/CiscoAsa1000vDaoImpl.java    |   63 +
 .../src/com/cloud/network/dao/CiscoVnmcDao.java    |   32 +
 .../com/cloud/network/dao/CiscoVnmcDaoImpl.java    |   51 +
 .../cloud/network/dao/NetworkAsa1000vMapDao.java   |   28 +
 .../network/dao/NetworkAsa1000vMapDaoImpl.java     |   61 +
 .../network/element/CiscoAsa1000vService.java      |   43 +
 .../cloud/network/element/CiscoVnmcElement.java    |  928 ++++++++++
 .../network/element/CiscoVnmcElementService.java   |   42 +
 .../cloud/network/resource/CiscoVnmcResource.java  |  780 ++++++++
 .../contrib/ssl/EasySSLProtocolSocketFactory.java  |  232 +++
 .../contrib/ssl/EasyX509TrustManager.java          |  114 ++
 .../network/cisco/CiscoVnmcConnectionTest.java     |  248 +++
 .../network/element/CiscoVnmcElementTest.java      |  401 ++++
 .../network/resource/CiscoVnmcResourceTest.java    |  285 +++
 plugins/pom.xml                                    |    1 +
 server/src/com/cloud/api/ApiResponseHelper.java    |    4 +-
 .../configuration/ConfigurationManagerImpl.java    |    4 +-
 setup/db/db/schema-410to420.sql                    |   38 +-
 test/integration/component/test_asa1000v_fw.py     |  134 ++
 tools/marvin/marvin/integration/lib/base.py        |   65 +-
 .../cloud/utils/cisco/n1kv/vsm/NetconfHelper.java  |   22 +
 .../com/cloud/utils/cisco/n1kv/vsm/VsmCommand.java |  213 +++
 .../hypervisor/vmware/mo/HypervisorHostHelper.java |   45 +-
 103 files changed, 9751 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/api/src/com/cloud/network/Network.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/Network.java b/api/src/com/cloud/network/Network.java
index c0b0117..ffe70d1 100644
--- a/api/src/com/cloud/network/Network.java
+++ b/api/src/com/cloud/network/Network.java
@@ -137,6 +137,7 @@ public interface Network extends ControlledEntity, StateObject<Network.State>, I
         public static final Provider None = new Provider("None", false);
         // NiciraNvp is not an "External" provider, otherwise we get in trouble with NetworkServiceImpl.providersConfiguredForExternalNetworking 
         public static final Provider NiciraNvp = new Provider("NiciraNvp", false);
+        public static final Provider CiscoVnmc = new Provider("CiscoVnmc", true);
 
         private String name;
         private boolean isExternal;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/api/src/org/apache/cloudstack/api/ApiConstants.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java
index b08e992..37cb59f 100755
--- a/api/src/org/apache/cloudstack/api/ApiConstants.java
+++ b/api/src/org/apache/cloudstack/api/ApiConstants.java
@@ -476,6 +476,7 @@ public class ApiConstants {
     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 {
         all, capacity, events, stats, min;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/api/src/org/apache/cloudstack/network/ExternalNetworkDeviceManager.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/network/ExternalNetworkDeviceManager.java b/api/src/org/apache/cloudstack/network/ExternalNetworkDeviceManager.java
index aeed81d..29ce2e3 100644
--- a/api/src/org/apache/cloudstack/network/ExternalNetworkDeviceManager.java
+++ b/api/src/org/apache/cloudstack/network/ExternalNetworkDeviceManager.java
@@ -43,6 +43,7 @@ public interface ExternalNetworkDeviceManager extends Manager {
         public static final NetworkDevice F5BigIpLoadBalancer = new NetworkDevice("F5BigIpLoadBalancer", Network.Provider.F5BigIp.getName());
         public static final NetworkDevice JuniperSRXFirewall = new NetworkDevice("JuniperSRXFirewall", Network.Provider.JuniperSRX.getName());
         public static final NetworkDevice NiciraNvp = new NetworkDevice("NiciraNvp", Network.Provider.NiciraNvp.getName());
+        public static final NetworkDevice CiscoVnmc = new NetworkDevice("CiscoVnmc", Network.Provider.CiscoVnmc.getName());
 
         public NetworkDevice(String deviceName, String ntwkServiceprovider) {
             _name = deviceName;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index 08946b6..743cd36 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -455,6 +455,11 @@
                   file="${basedir}/target/generated-webapp/WEB-INF/web.xml"
                   match="classpath:componentContext.xml"
                   replace="classpath:nonossComponentContext.xml" byline="true" />
+                <exec executable="cp">
+                    <arg value="-r" />
+                    <arg value="${basedir}/../plugins/network-elements/cisco-vnmc/scripts" />
+                    <arg value="${basedir}/target/generated-webapp/WEB-INF/classes/" />
+                </exec>
               </target>
             </configuration>
           </execution>
@@ -639,6 +644,11 @@
           <artifactId>cloud-vmware-base</artifactId>
           <version>${project.version}</version>
         </dependency>
+        <dependency>
+          <groupId>org.apache.cloudstack</groupId>
+          <artifactId>cloud-plugin-network-cisco-vnmc</artifactId>
+          <version>${project.version}</version>
+        </dependency>
       </dependencies>
     </profile>
   </profiles>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in
index 798d226..10fcfe3 100644
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@ -577,3 +577,14 @@ deleteAffinityGroup=15
 listAffinityGroups=15
 updateVMAffinityGroup=15
 listAffinityGroupTypes=15
+
+#### Cisco Vnmc commands
+addCiscoVnmcResource=1
+deleteCiscoVnmcResource=1
+listCiscoVnmcResources=1
+
+#### Cisco Asa1000v commands
+addCiscoAsa1000vResource=1
+deleteCiscoAsa1000vResource=1
+listCiscoAsa1000vResources=1
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/client/tomcatconf/nonossComponentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/nonossComponentContext.xml.in b/client/tomcatconf/nonossComponentContext.xml.in
index 3ede263..aac3b89 100644
--- a/client/tomcatconf/nonossComponentContext.xml.in
+++ b/client/tomcatconf/nonossComponentContext.xml.in
@@ -137,6 +137,16 @@
   </bean>
   
   <!--
+    Cisco VNMC support components
+  -->
+  <bean id="ciscoVnmcDaoImpl" class="com.cloud.network.dao.CiscoVnmcDaoImpl" />
+  <bean id="ciscoAsa1000vDaoImpl" class="com.cloud.network.dao.CiscoAsa1000vDaoImpl" />
+  <bean id="networkAsa1000vMapDaoImpl" class="com.cloud.network.dao.NetworkAsa1000vMapDaoImpl" />
+  <bean id="CiscoVNMC" class="com.cloud.network.element.CiscoVnmcElement">
+    <property name="name" value="CiscoVNMC"/>
+  </bean>
+  
+  <!--
     BigSwitch support components
   -->  
   <bean id="bigSwitchVnsDaoImpl" class="com.cloud.network.dao.BigSwitchVnsDaoImpl" />
@@ -324,6 +334,7 @@
           <ref bean="Netscaler"/>
           <ref bean="F5BigIP"/>
           <ref bean="CiscoNexus1000vVSM"/>
+          <ref bean="CiscoVNMC"/>
           <ref bean="NiciraNvp" />
           <ref bean="MidoNetElement" />
           <ref bean="bigSwitchVnsElement"/>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
index f6f0923..122ba3b 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
@@ -52,7 +52,9 @@ import com.cloud.hypervisor.HypervisorGuru;
 import com.cloud.hypervisor.HypervisorGuruBase;
 import com.cloud.hypervisor.vmware.manager.VmwareManager;
 import com.cloud.hypervisor.vmware.mo.VirtualEthernetCardType;
+import com.cloud.network.Network.Provider;
 import com.cloud.network.NetworkModel;
+import com.cloud.network.Network.Service;
 import com.cloud.network.Networks.TrafficType;
 import com.cloud.network.dao.NetworkDao;
 import com.cloud.network.dao.NetworkVO;
@@ -143,13 +145,23 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru {
 		    details.put(VmDetailConstants.ROOK_DISK_CONTROLLER, _vmwareMgr.getRootDiskController());
             }
         }
-        
+
+        List<NicProfile> nicProfiles = vm.getNics();
+
+        for(NicProfile nicProfile : nicProfiles) {
+            if(nicProfile.getTrafficType() == TrafficType.Guest) {
+                if(_networkMgr.isProviderSupportServiceInNetwork(nicProfile.getNetworkId(), Service.Firewall, Provider.CiscoVnmc)) {
+                    details.put("ConfigureVServiceInNexus", Boolean.TRUE.toString());
+                }
+                break;
+            }
+        }
+
         to.setDetails(details);
 
         if(vm.getVirtualMachine() instanceof DomainRouterVO) {
-            List<NicProfile> nicProfiles = vm.getNics();
-            NicProfile publicNicProfile = null;
 
+            NicProfile publicNicProfile = null;
             for(NicProfile nicProfile : nicProfiles) {
                 if(nicProfile.getTrafficType() == TrafficType.Public) {
                     publicNicProfile = nicProfile;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
index b2e3768..eb09af0 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
@@ -317,8 +317,7 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw
         }
 
         s_logger.info("Preparing network on host " + hostMo.getContext().toString() + " for " + privateTrafficLabel);
-            HypervisorHostHelper.prepareNetwork(vSwitchName, "cloud.private", hostMo, vlanId, null, null, 180000, false);
-
+        HypervisorHostHelper.prepareNetwork(vSwitchName, "cloud.private", hostMo, vlanId, null, null, 180000, false);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index f569595..3dc23cc 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -1329,7 +1329,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
             NicTO nicTo = cmd.getNic();
             VirtualDevice nic;
-            Pair<ManagedObjectReference, String> networkInfo = prepareNetworkFromNicInfo(vmMo.getRunningHost(), nicTo);
+            Pair<ManagedObjectReference, String> networkInfo = prepareNetworkFromNicInfo(vmMo.getRunningHost(), nicTo, false);
             if (VmwareHelper.isDvPortGroup(networkInfo.first())) {
                 String dvSwitchUuid;
                 ManagedObjectReference dcMor = hyperHost.getHyperHostDatacenter();
@@ -1571,7 +1571,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
                     vmMo.getRunningHost(), vlanId, null, null, this._ops_timeout, true);
         } else {
             networkInfo = HypervisorHostHelper.prepareNetwork(this._publicTrafficInfo.getVirtualSwitchName(), "cloud.public",
-                    vmMo.getRunningHost(), vlanId, null, null, this._ops_timeout, vSwitchType, _portsPerDvPortGroup);
+                    vmMo.getRunningHost(), vlanId, null, null, this._ops_timeout, vSwitchType, _portsPerDvPortGroup, null, false);
         }
 
         int nicIndex = allocPublicNicIndex(vmMo);
@@ -2304,7 +2304,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
             for (NicTO nicTo : sortNicsByDeviceId(nics)) {
                 s_logger.info("Prepare NIC device based on NicTO: " + _gson.toJson(nicTo));
 
-                Pair<ManagedObjectReference, String> networkInfo = prepareNetworkFromNicInfo(vmMo.getRunningHost(), nicTo);
+                boolean configureVServiceInNexus = (nicTo.getType() == TrafficType.Guest) && (vmSpec.getDetails().containsKey("ConfigureVServiceInNexus"));
+                Pair<ManagedObjectReference, String> networkInfo = prepareNetworkFromNicInfo(vmMo.getRunningHost(), nicTo, configureVServiceInNexus);
                 if (VmwareHelper.isDvPortGroup(networkInfo.first())) {
                     String dvSwitchUuid;
                     ManagedObjectReference dcMor = hyperHost.getHyperHostDatacenter();
@@ -2504,7 +2505,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         return defaultVlan;
     }
 
-    private Pair<ManagedObjectReference, String> prepareNetworkFromNicInfo(HostMO hostMo, NicTO nicTo) throws Exception {
+    private Pair<ManagedObjectReference, String> prepareNetworkFromNicInfo(HostMO hostMo, NicTO nicTo, boolean configureVServiceInNexus) throws Exception {
         Pair<String, String> switchName;
         TrafficType trafficType;
         VirtualSwitchType switchType;
@@ -2534,7 +2535,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         }
         else {
             networkInfo = HypervisorHostHelper.prepareNetwork(switchName.first(), namePrefix, hostMo, getVlanInfo(nicTo, switchName.second()),
-                    nicTo.getNetworkRateMbps(), nicTo.getNetworkRateMulticastMbps(), _ops_timeout, switchType, _portsPerDvPortGroup);
+                    nicTo.getNetworkRateMbps(), nicTo.getNetworkRateMulticastMbps(), _ops_timeout, switchType, _portsPerDvPortGroup, nicTo.getGateway(), configureVServiceInNexus);
         }
 
         return networkInfo;
@@ -3024,7 +3025,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
             NicTO[] nics = vm.getNics();
             for (NicTO nic : nics) {
                 // prepare network on the host
-                prepareNetworkFromNicInfo(new HostMO(getServiceContext(), _morHyperHost), nic);
+                prepareNetworkFromNicInfo(new HostMO(getServiceContext(), _morHyperHost), nic, false);
             }
 
             String secStoreUrl = mgr.getSecondaryStorageStoreUrl(Long.parseLong(_dcId));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/pom.xml b/plugins/network-elements/cisco-vnmc/pom.xml
new file mode 100644
index 0000000..1ac6bd8
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/pom.xml
@@ -0,0 +1,42 @@
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>cloud-plugin-network-cisco-vnmc</artifactId>
+  <name>Apache CloudStack Plugin - Cisco VNMC</name>
+  <parent>
+    <groupId>org.apache.cloudstack</groupId>
+    <artifactId>cloudstack-plugins</artifactId>
+    <version>4.2.0-SNAPSHOT</version>
+    <relativePath>../../pom.xml</relativePath>
+  </parent>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-plugin-hypervisor-vmware</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-vmware-base</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/assoc-asa1000v.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/assoc-asa1000v.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/assoc-asa1000v.xml
new file mode 100644
index 0000000..b0249db
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/assoc-asa1000v.xml
@@ -0,0 +1,34 @@
+<!--
+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.
+-->
+<configConfMo
+  dn=""
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfig>
+    <fwResourceBinding
+      assignedToDn="%fwdn%"
+      dn="%binddn%"
+      status="created"/>
+  </inConfig>
+</configConfMo>
+
+<!--
+    assignedToDn="fw/inst-1007"
+    dn="org-root/org-TenantD/org-VDC-TenantD/efw-ASA-1000v-TenantD/binding"
+-->

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-acl-policy-set.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-acl-policy-set.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-acl-policy-set.xml
new file mode 100755
index 0000000..e3113ae
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-acl-policy-set.xml
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+<configConfMos 
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+    <pair key="%espdn%">
+      <policyVirtualNetworkEdgeProfile
+        connTimeoutRef=""
+        descr="%descr%"
+        dn="%espdn%"
+        egressAclPsetRef="%egresspolicysetname%"
+        ingressAclPsetRef="%ingresspolicysetname%"
+        inspectRef=""
+        name="%name%"
+        natPsetRef="%natpolicysetname%"
+        status="modified"
+        vpnRef=""/>
+    </pair>
+  </inConfigs>
+</configConfMos>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-dhcp-policy.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-dhcp-policy.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-dhcp-policy.xml
new file mode 100644
index 0000000..e866f51
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-dhcp-policy.xml
@@ -0,0 +1,34 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+    <pair key="%dhcpdn%">
+      <policyDhcpPolicyAssoc
+        dn="%dhcpdn%"
+        interfaceName="%insideintf%"
+        policyRef=""
+        status="created"
+        type="server"/>
+    </pair>
+  </inConfigs>
+</configConfMos>
+
+<!--dn="org-root/org-TestTenant3/org-Tenant3-VDC/edsp-Tenant3-Edge-Device-Profile/dhcp-Edge_Inside"-->

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-dhcp-server.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-dhcp-server.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-dhcp-server.xml
new file mode 100644
index 0000000..930e4ec
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-dhcp-server.xml
@@ -0,0 +1,32 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+    <pair key="%dhcpdn%">
+      <policyDhcpPolicyAssoc
+        dn="%dhcpdn%"
+        interfaceName="%insideintf%"
+        policyRef="%dhcpserverpolicyname%"
+        status="modified"
+        type="server"/>
+    </pair>
+  </inConfigs>
+</configConfMos>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-nat-policy-set.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-nat-policy-set.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-nat-policy-set.xml
new file mode 100644
index 0000000..6d67c31
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-nat-policy-set.xml
@@ -0,0 +1,35 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+    <pair key="%espdn%">
+      <policyVirtualNetworkEdgeProfile
+        connTimeoutRef=""
+        descr="%descr%"
+        dn="%espdn%"
+        inspectRef=""
+        name="%name%"
+        natPsetRef="%natpolicysetname%"
+        status="modified"
+        vpnRef=""/>
+    </pair>
+  </inConfigs>
+</configConfMos>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-route-policy.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-route-policy.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-route-policy.xml
new file mode 100644
index 0000000..8884a1b
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/associate-route-policy.xml
@@ -0,0 +1,33 @@
+<!--
+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.
+-->
+<configConfMo
+  dn=""
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfig>
+    <policyEdgeDeviceServiceProfile
+      addrTranslationTimeout="10800"
+      dn="%dn%"
+      ipAudit=""
+      name="%name%"
+      routing="%routepolicyname%"
+      status="modified"
+      vpn=""/>
+  </inConfig>
+</configConfMo>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-policy-ref.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-policy-ref.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-policy-ref.xml
new file mode 100755
index 0000000..c534c32
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-policy-ref.xml
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+
+  <inConfigs>
+    <pair key="%aclpolicyrefdn%">
+      <policyPolicyNameRef
+        dn="%aclpolicyrefdn%"
+        order="%order%"
+        policyName="%aclpolicyname%"
+        status="created"/>
+    </pair>
+
+  </inConfigs>
+</configConfMos>
+
+<!--
+    aclpolicyrefdn="org-root/org-vlan-123/org-VDC-vlan-123/pset-Ingress-ACL-Policy-Set-vlan-123/polref-aaa"
+    aclpolicyname="aaa"
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-policy-set.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-policy-set.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-policy-set.xml
new file mode 100755
index 0000000..b475d2c
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-policy-set.xml
@@ -0,0 +1,36 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+    <pair key="%aclpolicysetdn%">
+      <policyPolicySet
+        descr="%descr%"
+        dn="%aclpolicysetdn%"
+        name="%aclpolicysetname%"
+        status="created"/>
+    </pair>
+  </inConfigs>
+</configConfMos>
+
+<!--
+    aclpolicysetdn="org-root/org-vlan-123/org-VDC-vlan-123/pset-foo"
+    aclpolicysetname="foo"
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-policy.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-policy.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-policy.xml
new file mode 100755
index 0000000..e71cd42
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-policy.xml
@@ -0,0 +1,35 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<configConfMo
+  dn=""
+  cookie="%cookie%"
+  inHierarchical="false">
+    <inConfig>
+      <policyRuleBasedPolicy
+        descr=""
+        dn="%aclpolicydn%"
+        name="%aclpolicyname%"
+        status="created"/>
+    </inConfig>
+</configConfMo>
+
+<!--
+    aclpolicydn="org-root/org-vlan-123/org-VDC-vlan-123/pol-test_policy"
+    aclpolicyname="test_policy"
+--!>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-rule-for-dnat.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-rule-for-dnat.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-rule-for-dnat.xml
new file mode 100755
index 0000000..5b6aaa3
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-rule-for-dnat.xml
@@ -0,0 +1,82 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+
+    <pair key="%aclruledn%">
+      <policyRule
+        descr="%descr%"
+        dn="%aclruledn%"
+        name="%aclrulename%"
+        order="%order%"
+        status="created"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-action-0">
+      <fwpolicyAction
+        actionType="%actiontype%"
+        dn="%aclruledn%/rule-action-0"
+        id="0"
+        status="created"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-cond-2">
+      <policyRuleCondition
+        dn="%aclruledn%/rule-cond-2"
+        id="2"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-2/nw-expr2">
+      <policyNetworkExpression
+        dn="%aclruledn%/rule-cond-2/nw-expr2"
+        id="2"
+        opr="eq"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-2/nw-expr2/nw-attr-qual">
+      <policyNwAttrQualifier
+        attrEp="destination"
+        dn="%aclruledn%/rule-cond-2/nw-expr2/nw-attr-qual"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-2/nw-expr2/nw-ip-2">
+      <policyIPAddress
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-2/nw-expr2/nw-ip-2"
+        id="2"
+        name=""
+        placement="none"
+        status="created"
+        value="%ip%"/>
+    </pair>
+
+  </inConfigs>
+</configConfMos>
+
+<!--
+    aclruledn="org-root/org-vlan-123/org-VDC-vlan-123/pol-test_policy/rule-dummy"
+    aclrulename="dummy"
+    descr=value
+    actiontype="drop" or "permit"
+    ip="public ip at destination"
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-rule-for-pf.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-rule-for-pf.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-rule-for-pf.xml
new file mode 100755
index 0000000..1a1d9cb
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-acl-rule-for-pf.xml
@@ -0,0 +1,156 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+
+    <pair key="%aclruledn%">
+      <policyRule
+        descr="%descr%"
+        dn="%aclruledn%"
+        name="%aclrulename%"
+        order="%order%"
+        status="created"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-action-0">
+      <fwpolicyAction
+        actionType="%actiontype%"
+        dn="%aclruledn%/rule-action-0"
+        id="0"
+        status="created"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-cond-2">
+      <policyRuleCondition
+        dn="%aclruledn%/rule-cond-2"
+        id="2"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-2/nw-expr2">
+      <policyNetworkExpression
+        dn="%aclruledn%/rule-cond-2/nw-expr2"
+        id="2"
+        opr="eq"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-2/nw-expr2/nw-protocol-2">
+      <policyProtocol
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-2/nw-expr2/nw-protocol-2"
+        id="2"
+        name=""
+        placement="none"
+        status="created"
+        value="%protocolvalue%"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-cond-3">
+      <policyRuleCondition
+        dn="%aclruledn%/rule-cond-3"
+        id="3"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2">
+      <policyNetworkExpression
+        dn="%aclruledn%/rule-cond-3/nw-expr2"
+        id="2"
+        opr="eq"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2/nw-attr-qual">
+      <policyNwAttrQualifier
+        attrEp="destination"
+        dn="%aclruledn%/rule-cond-3/nw-expr2/nw-attr-qual"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2/nw-ip-2">
+      <policyIPAddress
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-3/nw-expr2/nw-ip-2"
+        id="2"
+        name=""
+        placement="begin"
+        status="created"
+        value="%ip%"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-cond-4">
+      <policyRuleCondition
+        dn="%aclruledn%/rule-cond-4"
+        id="4"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-4/nw-expr2">
+      <policyNetworkExpression
+        dn="%aclruledn%/rule-cond-4/nw-expr2"
+        id="2"
+        opr="range"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-4/nw-expr2/nw-attr-qual">
+      <policyNwAttrQualifier
+        attrEp="destination"
+        dn="%aclruledn%/rule-cond-4/nw-expr2/nw-attr-qual"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-4/nw-expr2/nw-port-2">
+      <policyNetworkPort
+        appType="Other"
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-4/nw-expr2/nw-port-2"
+        id="2"
+        name=""
+        placement="begin"
+        status="created"
+        value="%startport%"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-4/nw-expr2/nw-port-3">
+      <policyNetworkPort
+        appType="Other"
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-4/nw-expr2/nw-port-3"
+        id="3"
+        name=""
+        placement="end"
+        status="created"
+        value="%endport%"/>
+    </pair>
+
+  </inConfigs>
+</configConfMos>
+
+<!--
+    aclruledn="org-root/org-vlan-123/org-VDC-vlan-123/pol-test_policy/rule-dummy"
+    aclrulename="dummy"
+    descr=value
+    actiontype="drop" or "permit"
+    protocolvalue="TCP" or "UDP"
+    ip="public ip at destination"
+    startport="start port at destination"
+    endport="end port at destination"
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-dhcp-policy.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-dhcp-policy.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-dhcp-policy.xml
new file mode 100644
index 0000000..5bb4abc
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-dhcp-policy.xml
@@ -0,0 +1,72 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+
+    <pair key="%dhcpserverdn%">
+      <policyDhcpServerPolicy
+        descr="%dhcpserverdescr%"
+        dn="%dhcpserverdn%"
+        dnsDomainRef=""
+        leaseTime="1036799"
+        name="%dhcpservername%"
+        pingTimeout="50"
+        status="created"/>
+    </pair>
+
+    <pair key="%iprangedn%">
+      <policyIPAddressRange
+        dn="%iprangedn%"
+        endip="%endip%"
+        name="iprange"
+        startip="%startip%"
+        status="created"
+        subnet="%subnet%"/>
+    </pair>
+
+    <pair key="%dnsservicedn%">
+      <commDns
+        descr=""
+        dn="%dnsservicedn%"
+        domain="%domain%"
+        name="%dnsservicename%"
+        status="created"/>
+    </pair>
+
+    <pair key="%nameserverdn%">
+      <commDnsProvider
+        descr=""
+        dn="%nameserverdn%"
+        hostip="%nameserverip%"
+        order="100"
+        status="created"/>
+    </pair>
+
+  </inConfigs>  
+</configConfMos> 
+  
+<!--
+    "org-root/org-TestTenant3/org-Tenant3-VDC/dhcp-server-Tenant3-DHCP-Policy" 
+    "org-root/org-TestTenant3/org-Tenant3-VDC/dhcp-server-Tenant3-DHCP-Policy/ip-range-iprange" 
+    "org-root/org-TenantC/org-VDC-TenantC/dhcp-server-TenantC-Dhcp-Policy/ip-range-iprange"
+    "org-root/org-TestTenant3/org-Tenant3-VDC/dhcp-server-Tenant3-DHCP-Policy/dns-svc-Tenant3-DNS" 
+    "org-root/org-TestTenant3/org-Tenant3-VDC/dhcp-server-Tenant3-DHCP-Policy/dns-svc-Tenant3-DNS/dns-8.8.8.8" 
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-dnat-rule.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-dnat-rule.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-dnat-rule.xml
new file mode 100755
index 0000000..bd8dbff
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-dnat-rule.xml
@@ -0,0 +1,91 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+
+    <pair key="%natruledn%">
+      <policyRule
+        descr="%descr%"
+        dn="%natruledn%"
+        name="%natrulename%"
+        order="%order%"
+        status="created"/>
+    </pair>
+
+    <pair key="%natruledn%/nat-action">
+      <natpolicyNatAction
+        actionType="static"
+        destTranslatedIpPool="%ippoolname%"
+        destTranslatedPortPool=""
+        dn="%natruledn%/nat-action"
+        id="0"
+        isBidirectionalEnabled="yes"
+        isDnsEnabled="no"
+        isNoProxyArpEnabled="no"
+        isRoundRobinIpEnabled="no"
+        srcTranslatedIpPatPool=""
+        srcTranslatedIpPool=""
+        srcTranslatedPortPool=""
+        status="created"/>
+    </pair>
+
+    <pair key="%natruledn%/rule-cond-2">
+      <policyRuleCondition
+        dn="%natruledn%/rule-cond-2"
+        id="2"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%natruledn%/rule-cond-2/nw-expr2/nw-attr-qual">
+      <policyNwAttrQualifier
+        attrEp="destination"
+        dn="%natruledn%/rule-cond-2/nw-expr2/nw-attr-qual"
+        status="created"/>
+    </pair>
+    <pair key="%natruledn%/rule-cond-2/nw-expr2">
+      <policyNetworkExpression
+        dn="%natruledn%/rule-cond-2/nw-expr2"
+        id="2"
+        opr="eq"
+        status="created"/>
+    </pair>
+    <pair key="%natruledn%/rule-cond-2/nw-expr2/nw-ip-2">
+      <policyIPAddress
+        dataType="string"
+        descr=""
+        dn="%natruledn%/rule-cond-2/nw-expr2/nw-ip-2"
+        id="2"
+        name=""
+        placement="none"
+        status="created"
+        value="%ip%"/>
+    </pair>
+
+  </inConfigs>
+</configConfMos>
+
+<!--
+    natruledn="org-root/org-vlan-123/org-VDC-vlan-123/natpol-aaa/rule-bbb"
+    natrulename="bbb"
+    descr=value
+    ippoolname="ccc"
+    ip="10.147.30.230"
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-device-profile.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-device-profile.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-device-profile.xml
new file mode 100644
index 0000000..c4bdd02
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-device-profile.xml
@@ -0,0 +1,32 @@
+<!--
+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.
+-->
+<configConfMo
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfig>
+    <policyEdgeDeviceServiceProfile
+      addrTranslationTimeout="10800"
+      descr="%descr%"
+      dn="%dn%"
+      name="%name%"
+      status="created"
+      vpn=""/>
+  </inConfig>
+</configConfMo>
+<!-- dn="org-root/org-TestTenant3/org-Tenant3-VDC/edsp-Tenant3-Edge-Device-Profile" -->

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-device-route-policy.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-device-route-policy.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-device-route-policy.xml
new file mode 100644
index 0000000..69f4a5f
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-device-route-policy.xml
@@ -0,0 +1,30 @@
+<!--
+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.
+-->
+<configConfMo
+  dn=""
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfig>
+    <routeRoutingPolicy
+      descr="%descr%"
+      dn="%routepolicydn%"
+      name="%name%"
+      status="created"/>
+  </inConfig>
+</configConfMo>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-device-route.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-device-route.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-device-route.xml
new file mode 100644
index 0000000..126c188
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-device-route.xml
@@ -0,0 +1,35 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+    <pair key="%routepolicydn%/sroute-2">
+      <routeStaticRoute
+        dn="%routepolicydn%/sroute-2"
+        id="2"
+        ipAddress="%destination%"
+        ipSubnet="%netmask%"
+        nextHopGWIp="%nexthop%"
+        nextHopIntf="%nexthopintf%"
+        routeMetric="1"
+        status="created"/>
+    </pair>
+  </inConfigs>
+</configConfMos>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-firewall.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-firewall.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-firewall.xml
new file mode 100644
index 0000000..e5447e3
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-firewall.xml
@@ -0,0 +1,89 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+    <inConfigs>
+      <pair key="%edgefwdn%" >
+        <fwEdgeFirewall
+          haMode="standalone"
+          descr="%edgefwdescr%"
+          dn="%edgefwdn%"
+          name="%edgefwname%"
+          status="created"/>
+      </pair>
+
+      <pair key="%insideintfdn%">
+        <fwDataInterface
+          descr="ASA Inside Interface"
+          dn="%insideintfdn%"
+          ipAddressPrimary="%insideip%"
+          ipAddressSecondary="0.0.0.0"
+          ipSubnet="%insidesubnet%"
+          isIpViaDHCP="no"
+          name="%insideintfname%"
+          role="inside"
+          status="created"/>
+      </pair>
+
+      <pair key="%outsideintfdn%">
+        <fwDataInterface
+          descr="ASA Outside interface "
+          dn="%outsideintfdn%"
+          ipAddressPrimary="%publicip%"
+          ipAddressSecondary="0.0.0.0"
+          ipSubnet="%outsidesubnet%"
+          isIpViaDHCP="no"
+          name="%outsideintfname%"
+          role="outside"
+          status="created"/>
+      </pair>
+
+      <pair key="%outsideintfsp%" >
+        <logicalInterfaceServiceProfileAssociation
+          descr=""
+          dn="%outsideintfsp%"
+          name=""
+          profileRef="%secprofileref%"
+          status="created"/>
+      </pair>
+
+      <pair key="%deviceserviceprofiledn%" >
+        <logicalDeviceServiceProfileAssociation
+          descr=""
+          dn="%deviceserviceprofiledn%"
+          name=""
+          profileRef="%deviceserviceprofile%"
+          status="created"/>
+      </pair>
+    </inConfigs>
+</configConfMos>
+  
+<!--
+    edgefwdn="org-root/org-TenantD/org-VDC-TenantD/efw-ASA-1000v-TenantD"
+    insideintfdn="org-root/org-TenantD/org-VDC-TenantD/efw-ASA-1000v-TenantD/interface-Edge_Inside"
+    descr="%edgefwdescr%"
+    ipAddressPrimary="%insideip%"
+    ipSubnet="%insidesubnet%"
+    name="%insideintfname%"
+    outsideintfdn="%outsideintfdn%"
+    ipAddressPrimary="%publicip%"
+    ipSubnet="%outsidesubnet%"
+    name="%outsideintfname%
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-security-profile.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-security-profile.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-security-profile.xml
new file mode 100644
index 0000000..e2f5eaf
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-edge-security-profile.xml
@@ -0,0 +1,41 @@
+<!--
+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.
+-->
+<configConfMo
+  dn=""
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfig>
+    <policyVirtualNetworkEdgeProfile
+      descr="%descr%"
+      dn="%espdn%"
+      egressAclPsetRef="%egressref%"
+      ingressAclPsetRef="%ingressref%"
+      name="%name%"
+      status="created"
+      vpnRef=""/>
+  </inConfig>
+</configConfMo>
+
+<!--
+    descr="Edge Security Profile for Tenant3"
+    dn="org-root/org-TestTenant3/org-Tenant3-VDC/vnep-Tenant3-ESSP"
+    egressAclPsetRef="default-egress"
+    ingressAclPsetRef="default-ingress"
+    name="Tenant3-ESSP"
+--!>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-egress-acl-rule.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-egress-acl-rule.xml b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-egress-acl-rule.xml
new file mode 100755
index 0000000..930272e
--- /dev/null
+++ b/plugins/network-elements/cisco-vnmc/scripts/network/cisco/create-egress-acl-rule.xml
@@ -0,0 +1,201 @@
+<!--
+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.
+-->
+<configConfMos
+  cookie="%cookie%"
+  inHierarchical="false">
+  <inConfigs>
+
+    <pair key="%aclruledn%">
+      <policyRule
+        descr="%descr%"
+        dn="%aclruledn%"
+        name="%aclrulename%"
+        order="%order%"
+        status="created"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-action-0">
+      <fwpolicyAction
+        actionType="%actiontype%"
+        dn="%aclruledn%/rule-action-0"
+        id="0"
+        status="created"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-cond-2">
+      <policyRuleCondition
+        dn="%aclruledn%/rule-cond-2"
+        id="2"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-2/nw-expr2">
+      <policyNetworkExpression
+        dn="%aclruledn%/rule-cond-2/nw-expr2"
+        id="2"
+        opr="eq"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-2/nw-expr2/nw-protocol-2">
+      <policyProtocol
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-2/nw-expr2/nw-protocol-2"
+        id="2"
+        name=""
+        placement="none"
+        status="created"
+        value="%protocolvalue%"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-cond-3">
+      <policyRuleCondition
+        dn="%aclruledn%/rule-cond-3"
+        id="3"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2">
+      <policyNetworkExpression
+        dn="%aclruledn%/rule-cond-3/nw-expr2"
+        id="2"
+        opr="range"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2/nw-attr-qual">
+      <policyNwAttrQualifier
+        attrEp="destination"
+        dn="%aclruledn%/rule-cond-3/nw-expr2/nw-attr-qual"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2/nw-ip-2">
+      <policyIPAddress
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-3/nw-expr2/nw-ip-2"
+        id="2"
+        name=""
+        placement="begin"
+        status="created"
+        value="%deststartip%"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-3/nw-expr2/nw-ip-3">
+      <policyIPAddress
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-3/nw-expr2/nw-ip-3"
+        id="3"
+        name=""
+        placement="end"
+        status="created"
+        value="%destendip%"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-cond-4">
+      <policyRuleCondition
+        dn="%aclruledn%/rule-cond-4"
+        id="4"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-4/nw-expr2">
+      <policyNetworkExpression
+        dn="%aclruledn%/rule-cond-4/nw-expr2"
+        id="2"
+        opr="eq"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-4/nw-expr2/nw-attr-qual">
+      <policyNwAttrQualifier
+        attrEp="source"
+        dn="%aclruledn%/rule-cond-4/nw-expr2/nw-attr-qual"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-4/nw-expr2/nw-ip-2">
+      <policyIPAddress
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-4/nw-expr2/nw-ip-2"
+        id="2"
+        name=""
+        placement="none"
+        status="created"
+        value="%sourceip%"/>
+    </pair>
+
+    <pair key="%aclruledn%/rule-cond-5">
+      <policyRuleCondition
+        dn="%aclruledn%/rule-cond-5"
+        id="5"
+        order="unspecified"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-5/nw-expr2">
+      <policyNetworkExpression
+        dn="%aclruledn%/rule-cond-5/nw-expr2"
+        id="2"
+        opr="range"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-5/nw-expr2/nw-attr-qual">
+      <policyNwAttrQualifier
+        attrEp="source"
+        dn="%aclruledn%/rule-cond-5/nw-expr2/nw-attr-qual"
+        status="created"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-5/nw-expr2/nw-port-2">
+      <policyNetworkPort
+        appType="Other"
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-5/nw-expr2/nw-port-2"
+        id="2"
+        name=""
+        placement="begin"
+        status="created"
+        value="%sourcestartport%"/>
+    </pair>
+    <pair key="%aclruledn%/rule-cond-5/nw-expr2/nw-port-3">
+      <policyNetworkPort
+        appType="Other"
+        dataType="string"
+        descr=""
+        dn="%aclruledn%/rule-cond-5/nw-expr2/nw-port-3"
+        id="3"
+        name=""
+        placement="end"
+        status="created"
+        value="%sourceendport%"/>
+    </pair>
+
+  </inConfigs>
+</configConfMos>
+
+<!--
+    aclruledn="org-root/org-vlan-123/org-VDC-vlan-123/pol-test_policy/rule-dummy"
+    aclrulename="dummy"
+    descr=value
+    actiontype="drop" or "permit"
+    protocolvalue = "TCP" or "UDP"
+    deststartip="destination start ip"
+    destendip="destination end ip"
+    sourcestartport="start port at source"
+    sourceendport="end port at source"
+    sourceip="source ip"
+--!>


[19/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
CLOUDSTACK-779:Enabling Egress rules feature for SRX


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/97911e9f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/97911e9f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/97911e9f

Branch: refs/heads/ui-vm-affinity
Commit: 97911e9fe6ba110b25a9b52a443e31ebfb42a4c8
Parents: e05defc
Author: Pranav Saxena <pr...@citrix.com>
Authored: Mon Apr 15 16:28:45 2013 +0530
Committer: Pranav Saxena <pr...@citrix.com>
Committed: Mon Apr 15 16:28:45 2013 +0530

----------------------------------------------------------------------
 ui/scripts/network.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97911e9f/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index b6ed0fe..a759fb2 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -923,7 +923,7 @@
                 hiddenTabs.push("addloadBalancer");
               }
 
-              if (isVPC || isAdvancedSGZone || hasSRXFirewall) {
+              if (isVPC || isAdvancedSGZone ) {
                  hiddenTabs.push('egressRules');
                }
               


[33/33] git commit: updated refs/heads/ui-vm-affinity to 2675684

Posted by bf...@apache.org.
Merge branch 'master' into ui-vm-affinity


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/26756848
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/26756848
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/26756848

Branch: refs/heads/ui-vm-affinity
Commit: 267568483b6219c810caa1bd007f6037a73df666
Parents: 51cfc07 1f76d8b
Author: Brian Federle <br...@citrix.com>
Authored: Mon Apr 15 10:24:36 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Mon Apr 15 10:24:36 2013 -0700

----------------------------------------------------------------------
 DISCLAIMER                                         |    7 -
 .../cloud/configuration/ConfigurationService.java  |    6 +
 api/src/com/cloud/event/EventTypes.java            |    4 +
 api/src/com/cloud/network/Network.java             |    1 +
 api/src/com/cloud/network/NetworkService.java      |    2 +-
 api/src/com/cloud/vm/DiskProfile.java              |    2 +-
 .../org/apache/cloudstack/api/ApiConstants.java    |    1 +
 .../admin/vlan/DedicatePublicIpRangeCmd.java       |  108 +
 .../admin/vlan/ReleasePublicIpRangeCmd.java        |   77 +
 .../command/user/address/AssociateIPAddrCmd.java   |   31 +-
 .../network/ExternalNetworkDeviceManager.java      |    1 +
 client/pom.xml                                     |   10 +
 client/tomcatconf/applicationContext.xml.in        |    6 +-
 client/tomcatconf/commands.properties.in           |   13 +
 client/tomcatconf/componentContext.xml.in          |    1 +
 client/tomcatconf/nonossComponentContext.xml.in    |   20 +
 debian/cloudstack-awsapi.install                   |   10 +-
 debian/rules                                       |   20 +-
 docs/en-US/Release_Notes.xml                       | 4414 ++++++++++++++-
 docs/en-US/hypervisor-kvm-install-flow.xml         |    1 +
 .../subsystem/api/storage/CommandResult.java       |    2 +-
 .../api/storage/ObjectInDataStoreStateMachine.java |    2 +-
 .../image/motion/DefaultImageMotionStrategy.java   |    4 +-
 .../test/MockHypervisorHostEndPointRpcServer.java  |   72 +
 .../test/MockHypervsiorHostEndPointRpcServer.java  |   72 -
 .../integration-test/test/resource/component.xml   |    2 +-
 .../storage/HypervisorHostEndPointRpcServer.java   |  119 +
 .../storage/HypervsiorHostEndPointRpcServer.java   |  119 -
 .../allocator/AbstractStoragePoolAllocator.java    |    2 +-
 .../allocator/ZoneWideStoragePoolAllocator.java    |    2 +-
 .../storage/datastore/DataObjectManagerImpl.java   |    6 +-
 .../driver/DefaultPrimaryDataStoreDriverImpl.java  |    4 +-
 .../DefaultPrimaryDatastoreProviderImpl.java       |    6 +-
 .../volume/TemplateInstallStrategyImpl.java        |    6 +-
 packaging/centos63/cloud.spec                      |   19 +-
 .../src/com/cloud/hypervisor/guru/VMwareGuru.java  |   18 +-
 .../vmware/manager/VmwareManagerImpl.java          |    3 +-
 .../hypervisor/vmware/resource/VmwareResource.java |   13 +-
 plugins/network-elements/cisco-vnmc/pom.xml        |   42 +
 .../scripts/network/cisco/assoc-asa1000v.xml       |   34 +
 .../network/cisco/associate-acl-policy-set.xml     |   37 +
 .../network/cisco/associate-dhcp-policy.xml        |   34 +
 .../network/cisco/associate-dhcp-server.xml        |   32 +
 .../network/cisco/associate-nat-policy-set.xml     |   35 +
 .../network/cisco/associate-route-policy.xml       |   33 +
 .../network/cisco/create-acl-policy-ref.xml        |   38 +
 .../network/cisco/create-acl-policy-set.xml        |   36 +
 .../scripts/network/cisco/create-acl-policy.xml    |   35 +
 .../network/cisco/create-acl-rule-for-dnat.xml     |   82 +
 .../network/cisco/create-acl-rule-for-pf.xml       |  156 +
 .../scripts/network/cisco/create-dhcp-policy.xml   |   72 +
 .../scripts/network/cisco/create-dnat-rule.xml     |   91 +
 .../network/cisco/create-edge-device-profile.xml   |   32 +
 .../cisco/create-edge-device-route-policy.xml      |   30 +
 .../network/cisco/create-edge-device-route.xml     |   35 +
 .../scripts/network/cisco/create-edge-firewall.xml |   89 +
 .../network/cisco/create-edge-security-profile.xml |   41 +
 .../network/cisco/create-egress-acl-rule.xml       |  201 +
 .../cisco/create-generic-egress-acl-rule.xml       |  122 +
 .../cisco/create-generic-ingress-acl-rule.xml      |  121 +
 .../network/cisco/create-ingress-acl-rule.xml      |  201 +
 .../scripts/network/cisco/create-ip-pool.xml       |   58 +
 .../network/cisco/create-nat-policy-ref.xml        |   38 +
 .../network/cisco/create-nat-policy-set.xml        |   37 +
 .../scripts/network/cisco/create-nat-policy.xml    |   33 +
 .../scripts/network/cisco/create-pf-rule.xml       |  166 +
 .../scripts/network/cisco/create-port-pool.xml     |   72 +
 .../network/cisco/create-source-nat-pool.xml       |   58 +
 .../network/cisco/create-source-nat-rule.xml       |  103 +
 .../scripts/network/cisco/create-tenant.xml        |   29 +
 .../scripts/network/cisco/create-vdc.xml           |   30 +
 .../network/cisco/delete-acl-policy-set.xml        |   30 +
 .../scripts/network/cisco/delete-acl-policy.xml    |   33 +
 .../scripts/network/cisco/delete-edge-firewall.xml |   30 +
 .../network/cisco/delete-edge-security-profile.xml |   38 +
 .../network/cisco/delete-nat-policy-set.xml        |   30 +
 .../scripts/network/cisco/delete-nat-policy.xml    |   33 +
 .../scripts/network/cisco/delete-rule.xml          |   31 +
 .../scripts/network/cisco/delete-tenant.xml        |   30 +
 .../scripts/network/cisco/delete-vdc.xml           |   30 +
 .../scripts/network/cisco/disassoc-asa1000v.xml    |   30 +
 .../scripts/network/cisco/list-acl-policies.xml    |   31 +
 .../scripts/network/cisco/list-children.xml        |   27 +
 .../scripts/network/cisco/list-nat-policies.xml    |   31 +
 .../network/cisco/list-policyrefs-in-policyset.xml |   31 +
 .../scripts/network/cisco/list-tenants.xml         |   26 +
 .../network/cisco/list-unassigned-asa1000v.xml     |   39 +
 .../cisco-vnmc/scripts/network/cisco/login.xml     |   20 +
 ...AssociateAsaWithLogicalEdgeFirewallCommand.java |   53 +
 .../api/CleanupLogicalEdgeFirewallCommand.java     |   43 +
 .../agent/api/ConfigureNexusVsmForAsaCommand.java  |   95 +
 .../api/CreateLogicalEdgeFirewallCommand.java      |   94 +
 .../api/commands/AddCiscoAsa1000vResourceCmd.java  |  116 +
 .../api/commands/AddCiscoVnmcResourceCmd.java      |  115 +
 .../commands/DeleteCiscoAsa1000vResourceCmd.java   |   93 +
 .../api/commands/DeleteCiscoVnmcResourceCmd.java   |   93 +
 .../commands/ListCiscoAsa1000vResourcesCmd.java    |  110 +
 .../api/commands/ListCiscoVnmcResourcesCmd.java    |  106 +
 .../response/CiscoAsa1000vResourceResponse.java    |   88 +
 .../api/response/CiscoVnmcResourceResponse.java    |   75 +
 .../cloud/network/cisco/CiscoAsa1000vDevice.java   |   39 +
 .../cloud/network/cisco/CiscoAsa1000vDeviceVO.java |  101 +
 .../cloud/network/cisco/CiscoVnmcConnection.java   |  196 +
 .../network/cisco/CiscoVnmcConnectionImpl.java     | 1415 +++++
 .../cloud/network/cisco/CiscoVnmcController.java   |   40 +
 .../cloud/network/cisco/CiscoVnmcControllerVO.java |  102 +
 .../cloud/network/cisco/NetworkAsa1000vMap.java    |   31 +
 .../cloud/network/cisco/NetworkAsa1000vMapVO.java  |   73 +
 .../com/cloud/network/dao/CiscoAsa1000vDao.java    |   33 +
 .../cloud/network/dao/CiscoAsa1000vDaoImpl.java    |   63 +
 .../src/com/cloud/network/dao/CiscoVnmcDao.java    |   32 +
 .../com/cloud/network/dao/CiscoVnmcDaoImpl.java    |   51 +
 .../cloud/network/dao/NetworkAsa1000vMapDao.java   |   28 +
 .../network/dao/NetworkAsa1000vMapDaoImpl.java     |   61 +
 .../network/element/CiscoAsa1000vService.java      |   43 +
 .../cloud/network/element/CiscoVnmcElement.java    |  928 +++
 .../network/element/CiscoVnmcElementService.java   |   42 +
 .../cloud/network/resource/CiscoVnmcResource.java  |  780 +++
 .../contrib/ssl/EasySSLProtocolSocketFactory.java  |  232 +
 .../contrib/ssl/EasyX509TrustManager.java          |  114 +
 .../network/cisco/CiscoVnmcConnectionTest.java     |  248 +
 .../network/element/CiscoVnmcElementTest.java      |  401 ++
 .../network/resource/CiscoVnmcResourceTest.java    |  285 +
 .../dns-notifier/resources/components-example.xml  |    2 +-
 .../element/F5ExternalLoadBalancerElement.java     |   15 +-
 .../element/JuniperSRXExternalFirewallElement.java |   58 +-
 .../cloud/network/element/NetscalerElement.java    |    3 +-
 plugins/pom.xml                                    |    1 +
 .../CloudStackPrimaryDataStoreProviderImpl.java    |    6 +-
 server/src/com/cloud/api/ApiResponseHelper.java    |    4 +-
 .../src/com/cloud/api/query/QueryManagerImpl.java  |   65 +-
 .../cloud/configuration/ConfigurationManager.java  |    5 +-
 .../configuration/ConfigurationManagerImpl.java    |  177 +-
 .../AgentBasedConsoleProxyManager.java.orig        |  298 -
 .../cloud/network/ExteralIpAddressAllocator.java   |  165 -
 .../cloud/network/ExternalIpAddressAllocator.java  |  165 +
 server/src/com/cloud/network/IpAddrAllocator.java  |    2 +-
 .../src/com/cloud/network/NetworkManagerImpl.java  |  317 +-
 .../src/com/cloud/network/NetworkServiceImpl.java  |  109 +-
 .../src/com/cloud/server/ManagementServerImpl.java |    3 +
 .../com/cloud/template/TemplateManagerImpl.java    |    2 +-
 server/src/com/cloud/user/AccountManagerImpl.java  |    6 +-
 .../configuration/ConfigurationManagerTest.java    |  413 ++
 .../com/cloud/network/MockNetworkManagerImpl.java  |   38 +-
 .../cloud/vpc/MockConfigurationManagerImpl.java    |   23 +-
 .../test/com/cloud/vpc/MockNetworkManagerImpl.java |   54 +-
 server/test/resources/network-mgr-component.xml    |    2 +-
 setup/db/db/schema-410to420.sql                    |   38 +-
 test/integration/component/test_asa1000v_fw.py     |  134 +
 test/integration/smoke/test_iso.py                 |    3 +-
 test/integration/smoke/test_network.py             |    4 +-
 test/integration/smoke/test_public_ip_range.py     |  173 +
 test/integration/smoke/test_routers.py             |    2 +-
 test/integration/smoke/test_templates.py           |    3 +-
 test/integration/smoke/test_vm_life_cycle.py       |    2 +-
 test/integration/smoke/test_volumes.py             |   55 +-
 tools/apidoc/gen_toc.py                            |    1 +
 tools/build/build_docs.sh                          |   11 +-
 tools/marvin/marvin/integration/lib/base.py        |   84 +-
 ui/scripts/dashboard.js                            |    2 +-
 ui/scripts/instances.js                            |   29 +-
 ui/scripts/network.js                              |    2 +-
 ui/scripts/sharedFunctions.js                      |   28 +-
 .../cloud/utils/cisco/n1kv/vsm/NetconfHelper.java  |   22 +
 .../com/cloud/utils/cisco/n1kv/vsm/VsmCommand.java |  213 +
 .../cloud/utils/component/ComponentContext.java    |    4 +-
 .../hypervisor/vmware/mo/HypervisorHostHelper.java |   45 +-
 167 files changed, 15778 insertions(+), 1408 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/26756848/ui/scripts/instances.js
----------------------------------------------------------------------


[22/33] Squashed commit of the following:

Posted by bf...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e94c7025/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
index 621c091..7f323c5 100755
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
@@ -163,7 +163,8 @@ public class HypervisorHostHelper {
     }
 
     public static void createPortProfile(VmwareContext context, String ethPortProfileName, String networkName,
-            Integer vlanId, Integer networkRateMbps, long peakBandwidth, long burstSize) throws Exception {
+            Integer vlanId, Integer networkRateMbps, long peakBandwidth, long burstSize,
+            String gateway, boolean configureVServiceInNexus) throws Exception {
         Map<String, String> vsmCredentials = getValidatedVsmCredentials(context);
         String vsmIp = vsmCredentials.get("vsmip");
         String vsmUserName = vsmCredentials.get("vsmusername");
@@ -233,8 +234,18 @@ public class HypervisorHostHelper {
                 s_logger.info("Adding port profile configured over untagged VLAN.");
                 netconfClient.addPortProfile(networkName, PortProfileType.vethernet, BindingType.portbindingstatic, SwitchPortMode.access, 0);
             } else {
-                s_logger.info("Adding port profile configured over VLAN : " + vlanId.toString());
-                netconfClient.addPortProfile(networkName, PortProfileType.vethernet, BindingType.portbindingstatic, SwitchPortMode.access, vlanId.intValue());
+                if (!configureVServiceInNexus) {
+                    s_logger.info("Adding port profile configured over VLAN : " + vlanId.toString());
+                    netconfClient.addPortProfile(networkName, PortProfileType.vethernet, BindingType.portbindingstatic, SwitchPortMode.access, vlanId.intValue());
+                } else {
+                    String tenant = "vlan-" + vlanId.intValue();
+                    String vdc = "root/" + tenant + "/VDC-" + tenant;
+                    String esp = "ESP-" + tenant;
+                    s_logger.info("Adding vservice node in Nexus VSM for VLAN : " + vlanId.toString());
+                    netconfClient.addVServiceNode(vlanId.toString(), gateway);
+                    s_logger.info("Adding port profile with vservice details configured over VLAN : " + vlanId.toString());
+                    netconfClient.addPortProfile(networkName, PortProfileType.vethernet, BindingType.portbindingstatic, SwitchPortMode.access, vlanId.intValue(), vdc, esp);
+                }
             }
         } catch (CloudRuntimeException e) {
             msg = "Failed to add vEthernet port profile " + networkName + "." + ". Exception: " + e.toString();
@@ -402,7 +413,7 @@ public class HypervisorHostHelper {
 
     public static Pair<ManagedObjectReference, String> prepareNetwork(String physicalNetwork, String namePrefix,
             HostMO hostMo, String vlanId, Integer networkRateMbps, Integer networkRateMulticastMbps, long timeOutMs,
-            VirtualSwitchType vSwitchType, int numPorts) throws Exception {
+            VirtualSwitchType vSwitchType, int numPorts, String gateway, boolean configureVServiceInNexus) throws Exception {
         ManagedObjectReference morNetwork = null;
         VmwareContext context = hostMo.getContext();
         ManagedObjectReference dcMor = hostMo.getHyperHostDatacenter();
@@ -504,22 +515,22 @@ public class HypervisorHostHelper {
             } else {
                 s_logger.info("Found Ethernet port profile " + ethPortProfileName);
             }
-        long averageBandwidth = 0L;
-        if (networkRateMbps != null && networkRateMbps.intValue() > 0) {
-            averageBandwidth = (long) (networkRateMbps.intValue() * 1024L * 1024L);
-        }
-        // We chose 50% higher allocation than average bandwidth.
+            long averageBandwidth = 0L;
+            if (networkRateMbps != null && networkRateMbps.intValue() > 0) {
+                averageBandwidth = (long) (networkRateMbps.intValue() * 1024L * 1024L);
+            }
+            // We chose 50% higher allocation than average bandwidth.
             // TODO(sateesh): Optionally let user specify the peak coefficient
-        long peakBandwidth = (long) (averageBandwidth * 1.5);
+            long peakBandwidth = (long) (averageBandwidth * 1.5);
             // TODO(sateesh): Optionally let user specify the burst coefficient
-        long burstSize = 5 * averageBandwidth / 8;
+            long burstSize = 5 * averageBandwidth / 8;
 
-        if (!dataCenterMo.hasDvPortGroup(networkName)) {
-            s_logger.info("Port profile " + networkName + " not found.");
-                createPortProfile(context, physicalNetwork, networkName, vid, networkRateMbps, peakBandwidth, burstSize);
-            bWaitPortGroupReady = true;
-        } else {
-            s_logger.info("Port profile " + networkName + " found.");
+            if (!dataCenterMo.hasDvPortGroup(networkName)) {
+                s_logger.info("Port profile " + networkName + " not found.");
+                createPortProfile(context, physicalNetwork, networkName, vid, networkRateMbps, peakBandwidth, burstSize, gateway, configureVServiceInNexus);
+                bWaitPortGroupReady = true;
+            } else {
+                s_logger.info("Port profile " + networkName + " found.");
                 updatePortProfile(context, physicalNetwork, networkName, vid, networkRateMbps, peakBandwidth, burstSize);
             }
         }