You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by se...@apache.org on 2013/07/12 09:50:56 UTC

[01/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Updated Branches:
  refs/heads/sdnextensions a711db5a3 -> bcfb4e67c


CLOUDSTACK-3417: Remove baremetal foreign key in upgrade path

They're already handled by java code.


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

Branch: refs/heads/sdnextensions
Commit: da8b1ef81aee27199e7abd4c0a0ba155bc0ba489
Parents: 37ba08a
Author: Sheng Yang <sh...@citrix.com>
Authored: Wed Jul 10 11:29:30 2013 -0700
Committer: Sheng Yang <sh...@citrix.com>
Committed: Wed Jul 10 11:31:24 2013 -0700

----------------------------------------------------------------------
 setup/db/db/schema-410to420.sql | 9 ---------
 1 file changed, 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/da8b1ef8/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 5edf733..c7787f3 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -2163,15 +2163,6 @@ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'manag
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'interval.baremetal.securitygroup.agent.echo', 10, 'Interval to echo baremetal security group agent, in seconds');
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'timeout.baremetal.securitygroup.agent.echo', 3600, 'Timeout to echo baremetal security group agent, in seconds, the provisioning process will be treated as a failure');
 
-ALTER TABLE `cloud`.`baremetal_dhcp_devices` ADD CONSTRAINT `fk_external_dhcp_devices_nsp_id` FOREIGN KEY (`nsp_id`) REFERENCES `physical_network_service_providers` (`id`) ON DELETE CASCADE;
-ALTER TABLE `cloud`.`baremetal_dhcp_devices` ADD CONSTRAINT `fk_external_dhcp_devices_host_id` FOREIGN KEY (`host_id`) REFERENCES `host`(`id`) ON DELETE CASCADE;
-ALTER TABLE `cloud`.`baremetal_dhcp_devices` ADD CONSTRAINT `fk_external_dhcp_devices_pod_id` FOREIGN KEY (`pod_id`) REFERENCES `host_pod_ref`(`id`) ON DELETE CASCADE;
-ALTER TABLE `cloud`.`baremetal_dhcp_devices` ADD CONSTRAINT `fk_external_dhcp_devices_physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`) ON DELETE CASCADE;
-
-ALTER TABLE `cloud`.`baremetal_pxe_devices` ADD CONSTRAINT `fk_external_pxe_devices_nsp_id` FOREIGN KEY (`nsp_id`) REFERENCES `physical_network_service_providers` (`id`) ON DELETE CASCADE;
-ALTER TABLE `cloud`.`baremetal_pxe_devices` ADD CONSTRAINT `fk_external_pxe_devices_host_id` FOREIGN KEY (`host_id`) REFERENCES `host`(`id`) ON DELETE CASCADE;
-ALTER TABLE `cloud`.`baremetal_pxe_devices` ADD CONSTRAINT `fk_external_pxe_devices_physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`) ON DELETE CASCADE;
-
 alter table `cloud`.`network_offerings` add column egress_default_policy boolean default false;
 
 -- Add stratospher ssp tables


[20/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-1960: Fix for UK Keyboard - Bar symbol i.e. "|".


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

Branch: refs/heads/sdnextensions
Commit: 8bd1d27315cf1dbac29e2328bbf50c4aff784555
Parents: 2e8d16b
Author: Sanjay Tripathi <sa...@citrix.com>
Authored: Wed Jul 3 17:05:22 2013 +0530
Committer: Devdeep Singh <de...@gmail.com>
Committed: Thu Jul 11 10:41:45 2013 +0530

----------------------------------------------------------------------
 services/console-proxy/server/js/ajaxkeys.js | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8bd1d273/services/console-proxy/server/js/ajaxkeys.js
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/js/ajaxkeys.js b/services/console-proxy/server/js/ajaxkeys.js
index 677962b..725c8c5 100644
--- a/services/console-proxy/server/js/ajaxkeys.js
+++ b/services/console-proxy/server/js/ajaxkeys.js
@@ -321,6 +321,10 @@ var	keyboardTables = [
                           {keycode: 92, entry:
                               [{type : KEY_DOWN, code : 0xa6, modifiers : 0, shift : false}]
                           },
+                          // [124 = |]
+                          {keycode: 124, entry:
+                              [{type : KEY_DOWN, code : 0xa6, modifiers : 64, shift : true}]
+                          },
                           // [126 = ~]
                           {keycode: 126, entry:
                               [{type : KEY_DOWN, code : 0x7c, modifiers : 64, shift : true}]


[39/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3458: network GC thread - acquire global lock to prevent multiple MS from running the GC thread on the network at the same time


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

Branch: refs/heads/sdnextensions
Commit: 398428743484bbacc1d99bf60ae253d36c4c153b
Parents: a3660d8
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Wed Jul 10 16:27:31 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Thu Jul 11 09:37:57 2013 -0700

----------------------------------------------------------------------
 .../src/com/cloud/network/NetworkManagerImpl.java   | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/39842874/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 e322c9d..dbd3c1d 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -3016,9 +3016,23 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
     }
 
     public class NetworkGarbageCollector implements Runnable {
-
         @Override
         public void run() {
+            GlobalLock gcLock = GlobalLock.getInternLock("Network.GC.Lock");
+            try {
+                if(gcLock.lock(3)) {
+                    try {
+                        reallyRun();
+                    } finally {
+                        gcLock.unlock();
+                    }
+                }
+            } finally {
+                gcLock.releaseRef();
+            }
+        }
+        
+        public void reallyRun() {
             try {
                 List<Long> shutdownList = new ArrayList<Long>();
                 long currentTime = System.currentTimeMillis() / 1000 ;


[36/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3368: clear download URLs when create SSVM and validate download URLs


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

Branch: refs/heads/sdnextensions
Commit: 1a0302465b68ec61e458aefa71e0a3fdeedacd27
Parents: d2a751f
Author: Wei Zhou <w....@leaseweb.com>
Authored: Thu Jul 11 16:07:48 2013 +0200
Committer: Wei Zhou <w....@leaseweb.com>
Committed: Thu Jul 11 16:07:48 2013 +0200

----------------------------------------------------------------------
 .../secondary/SecondaryStorageManagerImpl.java  |  7 +++++
 .../cloud/storage/upload/UploadMonitorImpl.java | 27 +++++++++++++++++---
 2 files changed, 30 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1a030246/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
index 05256a8..6859b0b 100755
--- a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
+++ b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
@@ -98,9 +98,11 @@ import com.cloud.resource.ServerResource;
 import com.cloud.resource.UnableDeleteHostException;
 import com.cloud.service.ServiceOfferingVO;
 import com.cloud.service.dao.ServiceOfferingDao;
+import com.cloud.storage.UploadVO;
 import com.cloud.storage.VMTemplateVO;
 import com.cloud.storage.dao.SnapshotDao;
 import com.cloud.storage.dao.StoragePoolHostDao;
+import com.cloud.storage.dao.UploadDao;
 import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.storage.template.TemplateConstants;
 import com.cloud.template.TemplateManager;
@@ -114,6 +116,7 @@ import com.cloud.utils.Pair;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.GlobalLock;
 import com.cloud.utils.db.SearchCriteria.Op;
+import com.cloud.utils.db.SearchCriteria;
 import com.cloud.utils.db.SearchCriteria2;
 import com.cloud.utils.db.SearchCriteriaService;
 import com.cloud.utils.events.SubscriptionMgr;
@@ -225,6 +228,8 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
     protected RulesManager _rulesMgr;
     @Inject
     TemplateManager templateMgr;
+    @Inject
+    UploadDao _uploadDao;
 
     @Inject
     KeystoreManager _keystoreMgr;
@@ -658,6 +663,8 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
             if (_allocLock.lock(ACQUIRE_GLOBAL_LOCK_TIMEOUT_FOR_SYNC)) {
                 try {
                     secStorageVm = startNew(dataCenterId, role);
+                    for (UploadVO upload :_uploadDao.listAll())
+                        _uploadDao.expunge(upload.getId());
                 } finally {
                     _allocLock.unlock();
                 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1a030246/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/upload/UploadMonitorImpl.java b/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
index d46db0c..a589e7d 100755
--- a/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
+++ b/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
@@ -211,11 +211,33 @@ public class UploadMonitorImpl extends ManagerBase implements UploadMonitor {
 	    boolean success = false;
 	    Type type = (template.getFormat() == ImageFormat.ISO) ? Type.ISO : Type.TEMPLATE ;
 
+            // find an endpoint to send command
+            DataStore store = this.storeMgr.getDataStore(vmTemplateHost.getDataStoreId(), DataStoreRole.Image);
+            EndPoint ep = _epSelector.select(store);
 
 	    //Check if it already exists.
 	    List<UploadVO> extractURLList = _uploadDao.listByTypeUploadStatus(template.getId(), type, UploadVO.Status.DOWNLOAD_URL_CREATED);
 	    if (extractURLList.size() > 0) {
-            return extractURLList.get(0);
+               // do some check here
+               UploadVO upload = extractURLList.get(0);
+               String uploadUrl = extractURLList.get(0).getUploadUrl();
+               String[] token = uploadUrl.split("/");
+               // example: uploadUrl = https://10-11-101-112.realhostip.com/userdata/2fdd9a70-9c4a-4a04-b1d5-1e41c221a1f9.iso
+               // then token[2] = 10-11-101-112.realhostip.com, token[4] = 2fdd9a70-9c4a-4a04-b1d5-1e41c221a1f9.iso
+               String hostname = ep.getPublicAddr().replace(".", "-") + ".";
+               if ((token != null) && (token.length == 5) && (token[2].equals(hostname + _ssvmUrlDomain))) // ssvm publicip and domain suffix not changed
+                   return extractURLList.get(0);
+               else if ((token != null) && (token.length == 5) && (token[2].startsWith(hostname))) { // domain suffix changed
+                   String uuid = token[4];
+                   uploadUrl = generateCopyUrl(ep.getPublicAddr(), uuid);
+                   UploadVO vo = _uploadDao.createForUpdate();
+                   vo.setLastUpdated(new Date());
+                   vo.setUploadUrl(uploadUrl);
+                   _uploadDao.update(upload.getId(), vo);
+                   return _uploadDao.findById(upload.getId(), true);
+               } else { // ssvm publicip changed
+                   return null;
+               }
         }
 
 	    // It doesn't exist so create a DB entry.
@@ -224,9 +246,6 @@ public class UploadMonitorImpl extends ManagerBase implements UploadMonitor {
 	    uploadTemplateObj.setInstallPath(vmTemplateHost.getInstallPath());
 	    _uploadDao.persist(uploadTemplateObj);
 
-	    // find an endpoint to send command
-	    DataStore store = this.storeMgr.getDataStore(vmTemplateHost.getDataStoreId(), DataStoreRole.Image);
-	    EndPoint ep = _epSelector.select(store);
 	    try{
     	    // Create Symlink at ssvm
 	    	String path = vmTemplateHost.getInstallPath();


[26/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3447. CLOUDSTACK-3448.
Correct the access check on networks in APIs addNicToVM and removeNicFromVM


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

Branch: refs/heads/sdnextensions
Commit: 47de56d665243eb648f10cac5c806e095e03ef75
Parents: 33376f1
Author: Likitha Shetty <li...@citrix.com>
Authored: Thu Jul 11 13:46:25 2013 +0530
Committer: Likitha Shetty <li...@citrix.com>
Committed: Thu Jul 11 13:50:11 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/vm/UserVmManagerImpl.java | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47de56d6/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 53b4b6e..f95123e 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -863,13 +863,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use
         }
 
         // Perform account permission check on network
-        if (network.getGuestType() != Network.GuestType.Shared) {
-            // Check account permissions
-            List<NetworkVO> networkMap = _networkDao.listBy(caller.getId(), network.getId());
-            if ((networkMap == null || networkMap.isEmpty() ) && caller.getType() != Account.ACCOUNT_TYPE_ADMIN) {
-                throw new PermissionDeniedException("Unable to modify a vm using network with id " + network.getId() + ", permission denied");
-            }
-        }
+        _accountMgr.checkAccess(caller, AccessType.UseNetwork, false, network);
 
         //ensure network belongs in zone
         if (network.getDataCenterId() != vmInstance.getDataCenterId()) {
@@ -940,13 +934,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use
         }
 
         // Perform account permission check on network
-        if (network.getGuestType() != Network.GuestType.Shared) {
-            // Check account permissions
-            List<NetworkVO> networkMap = _networkDao.listBy(caller.getId(), network.getId());
-            if ((networkMap == null || networkMap.isEmpty() ) && caller.getType() != Account.ACCOUNT_TYPE_ADMIN) {
-                throw new PermissionDeniedException("Unable to modify a vm using network with id " + network.getId() + ", permission denied");
-            }
-        }
+        _accountMgr.checkAccess(caller, AccessType.UseNetwork, false, network);
 
         boolean nicremoved = false;
 


[32/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3248: XenServer Host got removed successfully inspite of running VMs on the host
In UI there is a restriction to first put a host in maintenance and only then deletion is allowed. But there is no such restriction in the deleteHost API.
Added a validation in deleteHost API to prevent deletion if the host is not in maintenance. In case of a forced deletion the restriction doesn't apply.


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

Branch: refs/heads/sdnextensions
Commit: 5c3013a694666adc0466f88ab138f211f33038df
Parents: 535903f
Author: Koushik Das <ko...@citrix.com>
Authored: Thu Jul 11 17:25:42 2013 +0530
Committer: Koushik Das <ko...@citrix.com>
Committed: Thu Jul 11 17:25:42 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/resource/ResourceManagerImpl.java | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5c3013a6/server/src/com/cloud/resource/ResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java
index 41c6ad7..b009e63 100755
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -859,6 +859,9 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
         }
         _accountMgr.checkAccessAndSpecifyAuthority(UserContext.current().getCaller(), host.getDataCenterId());
 
+        if (!isForced && host.getResourceState() != ResourceState.Maintenance) {
+            throw new CloudRuntimeException("Host " + host.getUuid() + " cannot be deleted as it is not in maintenance mode. Either put the host into maintenance or perform a forced deletion.");
+        }
         /*
          * TODO: check current agent status and updateAgentStatus to removed. If
          * it was already removed, that means someone is deleting host


[03/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-2988: UI > templates menu > update template action - add Dynamically Scalable field.


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

Branch: refs/heads/sdnextensions
Commit: 8236e7b63395e1c24b8f22443823f8bfe72af09b
Parents: ec42d72
Author: Jessica Wang <je...@apache.org>
Authored: Wed Jul 10 14:15:33 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Wed Jul 10 14:15:33 2013 -0700

----------------------------------------------------------------------
 ui/scripts/templates.js | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8236e7b6/ui/scripts/templates.js
----------------------------------------------------------------------
diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js
index 61a524e..dbb0083 100644
--- a/ui/scripts/templates.js
+++ b/ui/scripts/templates.js
@@ -433,7 +433,8 @@
 									  name: args.data.name,
 										displaytext: args.data.displaytext,
 										ostypeid: args.data.ostypeid,
-										passwordenabled: (args.data.passwordenabled=="on")										
+										passwordenabled: (args.data.passwordenabled=="on"),
+										isdynamicallyscalable: (args.data.isdynamicallyscalable=="on")
 									};	   
                   $.ajax({
                     url: createURL('updateTemplate'),
@@ -727,6 +728,12 @@
                       isEditable: true,
                       converter:cloudStack.converters.toBooleanText
                     },
+                    isdynamicallyscalable: {
+                      label: 'Dynamically Scalable',
+                      isBoolean: true,
+                      isEditable: true,
+                      converter:cloudStack.converters.toBooleanText
+                    },    
                     ispublic: {
                       label: 'label.public',
                       isBoolean: true,


[41/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3450: UI > Infrastructure menu - zone detail - (1) Add VMware datacenter fields. (2) Show Remove VMware datacenter action where there is no VMware datacenter attached with the zone. Show Add VMware datacenter action otherwise.


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

Branch: refs/heads/sdnextensions
Commit: 8d7a2162e4caa663942a95b19a1c5b1b75778d7d
Parents: d912839
Author: Jessica Wang <je...@apache.org>
Authored: Thu Jul 11 11:08:20 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Thu Jul 11 11:11:18 2013 -0700

----------------------------------------------------------------------
 ui/scripts/system.js | 92 ++++++++++++++++++++++++++++++-----------------
 1 file changed, 59 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d7a2162/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 868d212d..db0689c 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -6152,14 +6152,15 @@
 												  converter:cloudStack.converters.toBooleanText
                         }
                       },
-
-                       {
-
-                       isdedicated:{label:'Dedicated'},
-                       domainid:{label:'Domain ID'}
-
+                      {
+                       isdedicated: {label:'Dedicated'},
+                       domainid: {label:'Domain ID'}
+                      },
+                      {
+                        vmwaredcName: { label: 'VMware datacenter Name' },
+                        vmwaredcVcenter: { label: 'VMware datacenter vcenter' },
+                        vmwaredcId: { label: 'VMware datacenter Id' }
                       }
-
                     ],
                     dataProvider: function(args) {
                       $.ajax({
@@ -6169,30 +6170,51 @@
                         },
                         success: function(json) {
                           selectedZoneObj = json.listzonesresponse.zone[0];
-                             $.ajax({
-                                                    url:createURL("listDedicatedZones&zoneid=" +args.context.physicalResources[0].id),
-                                                    dataType:"json",
-                                                    async:false,
-                                                    success:function(json){
-                                                        if(json.listdedicatedzonesresponse.dedicatedzone != undefined){
-                                                          var zoneItem = json.listdedicatedzonesresponse.dedicatedzone[0];
-                                                            if (zoneItem.domainid != null) {
-                                                            $.extend(selectedZoneObj, zoneItem , { isdedicated: 'Yes' });
-                                                          }
-                                                        }
-                                                        else
-                                                            $.extend(selectedZoneObj,{ isdedicated: 'No' })
-
-                                                    },
-                                                  error:function(json){
-                                                       args.response.error(parseXMLHttpResponse(XMLHttpResponse));
-                                                  }
-                                              });
+                          $.ajax({
+                            url: createURL("listDedicatedZones&zoneid=" +args.context.physicalResources[0].id),
+                            dataType: "json",
+                            async: false,
+                            success: function(json){
+                              if(json.listdedicatedzonesresponse.dedicatedzone != undefined) {
+                                var zoneItem = json.listdedicatedzonesresponse.dedicatedzone[0];
+                                if (zoneItem.domainid != null) {
+                                  $.extend(selectedZoneObj, zoneItem , { isdedicated: 'Yes' });
+                                }
+                              }
+                              else {
+                                $.extend(selectedZoneObj, { isdedicated: 'No' })
+                              }
+                            }
+                          });
+                           
+                          $.ajax({
+                            url: createURL('listVmwareDcs'),
+                            data: {
+                              zoneid: args.context.physicalResources[0].id
+                            },
+                            async: false,
+                            success: function(json) { //e.g. json == { "listvmwaredcsresponse" { "count":1 ,"VMwareDC" [ {"id":"c3c2562d-65e9-4fc7-92e2-773c2efe8f37","zoneid":1,"name":"datacenter","vcenter":"10.10.20.20"} ] } } 
+                              var vmwaredcs = json.listvmwaredcsresponse.VMwareDC;
+                              if(vmwaredcs != null) {
+                                selectedZoneObj.vmwaredcName = vmwaredcs[0].name;
+                                selectedZoneObj.vmwaredcVcenter = vmwaredcs[0].vcenter;
+                                selectedZoneObj.vmwaredcId = vmwaredcs[0].id;
+                              }                              
+                            }                         
+                          });                            
+                           
+                          // for testing only (begin)
+                          /*
+                          selectedZoneObj.vmwaredcName = "datacenter";
+                          selectedZoneObj.vmwaredcVcenter = "10.10.20.20";
+                          selectedZoneObj.vmwaredcId = "c3c2562d-65e9-4fc7-92e2-773c2efe8f37";
+                          */
+                          // for testing only (end)
+                          
                           args.response.success({
-                                                actionFilter: zoneActionfilter,
-                                                data: selectedZoneObj
+                            actionFilter: zoneActionfilter,
+                            data: selectedZoneObj
                           });
-
                         }
                       });
                     }
@@ -14945,19 +14967,23 @@
     var jsonObj = args.context.item;
     var allowedActions = ['enableSwift'];
 
-    allowedActions.push('addVmwareDc');
-    allowedActions.push('removeVmwareDc');
+    if(jsonObj.vmwaredcId == null)
+      allowedActions.push('addVmwareDc');
+    else
+      allowedActions.push('removeVmwareDc');
     
-     if(jsonObj.domainid != null)
+    if(jsonObj.domainid != null)
       allowedActions.push("releaseDedicatedZone");
     else
-    allowedActions.push("dedicateZone");
+      allowedActions.push("dedicateZone");
 
     allowedActions.push("edit");
+    
     if(jsonObj.allocationstate == "Disabled")
       allowedActions.push("enable");
     else if(jsonObj.allocationstate == "Enabled")
       allowedActions.push("disable");
+    
     allowedActions.push("remove");
     return allowedActions;
   }


[28/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3462: NumberFormatException with TemplateService while performing template synchronization.


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

Branch: refs/heads/sdnextensions
Commit: 08669f5de20d9bc5e40693f128d7e48393eedb37
Parents: 429e6bd
Author: Sanjay Tripathi <sa...@citrix.com>
Authored: Thu Jul 11 13:44:32 2013 +0530
Committer: Devdeep Singh <de...@gmail.com>
Committed: Thu Jul 11 14:16:57 2013 +0530

----------------------------------------------------------------------
 .../apache/cloudstack/storage/image/TemplateServiceImpl.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/08669f5d/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
index cc60c10..b972628 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
@@ -82,6 +82,7 @@ import com.cloud.storage.dao.VMTemplateZoneDao;
 import com.cloud.storage.template.TemplateConstants;
 import com.cloud.storage.template.TemplateProp;
 import com.cloud.template.TemplateManager;
+import com.cloud.user.Account;
 import com.cloud.user.AccountManager;
 import com.cloud.user.ResourceLimitService;
 import com.cloud.utils.UriUtils;
@@ -325,7 +326,9 @@ public class TemplateServiceImpl implements TemplateService {
                         tmlpt.setSize(tmpltInfo.getSize());
                         _templateDao.update(tmplt.getId(), tmlpt);
 
-                        if (tmpltInfo.getSize() > 0 && tmplt.getUrl() != null) {
+                        // Skipping limit checks for SYSTEM Account and for the templates created from volumes or snapshots
+                        // which already got checked and incremented during createTemplate API call.
+                        if (tmpltInfo.getSize() > 0 && tmplt.getAccountId() != Account.ACCOUNT_ID_SYSTEM && tmplt.getUrl() != null) {
                             long accountId = tmplt.getAccountId();
                             try {
                                 _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(accountId),


[44/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3460: UI > Infrastructure menu > clusters > add cluster dialog > when hypervisor is VMware, call listVmwareDcs API to get vCenter Host and vCenter Datacenter value if the 2 fields are not filled (the 2 fields are optional).


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

Branch: refs/heads/sdnextensions
Commit: 20bade62f1babb185aec1dca0b3cb148f3eb186e
Parents: 62823a2
Author: Jessica Wang <je...@apache.org>
Authored: Thu Jul 11 15:39:33 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Thu Jul 11 15:41:51 2013 -0700

----------------------------------------------------------------------
 ui/scripts/system.js | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20bade62/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 90ede7d..4080b6b 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -10375,7 +10375,24 @@
 
                   var hostname = args.data.vCenterHost;
                   var dcName = args.data.vCenterDatacenter;
-
+                 
+                  if(hostname.length == 0 && dcName.length == 0) {
+                    $.ajax({
+                      url: createURL('listVmwareDcs'),
+                      data: {
+                        zoneid: args.data.zoneid
+                      },
+                      async: false,
+                      success: function(json) { //e.g. json == { "listvmwaredcsresponse" { "count":1 ,"VMwareDC" [ {"id":"c3c2562d-65e9-4fc7-92e2-773c2efe8f37","zoneid":1,"name":"datacenter","vcenter":"10.10.20.20"} ] } } 
+                        var vmwaredcs = json.listvmwaredcsresponse.VMwareDC;                        
+                        if(vmwaredcs != null) {
+                          hostname = vmwaredcs[0].vcenter;
+                          dcName = vmwaredcs[0].name;
+                        }                              
+                      }                         
+                    });    
+                  }                              
+                  
                   var url;
                   if(hostname.indexOf("http://") == -1)
                     url = "http://" + hostname;


[38/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3469 [VMware] Support to make username/password optional while adding VMware cluster

For legacy zones insist on the old model of asking for credentials for each cluster being added.
For non-legacy zones check if username & password are provided. If either or both not provided, try to retrieve & use the credentials from database, which are provided earlier while adding VMware DC to zone.
This lets user to not specify credentials while adding VMware cluster to zone, if the credentials are same as that of provided while adding VMware DC to zone.

Signed-off-by: Sateesh Chodapuneedi <sa...@apache.org>


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

Branch: refs/heads/sdnextensions
Commit: a3660d8109918ddf3897411deaf4520733eabc00
Parents: 521dcbd
Author: Sateesh Chodapuneedi <sa...@apache.org>
Authored: Thu Jul 11 20:39:33 2013 +0530
Committer: Sateesh Chodapuneedi <sa...@apache.org>
Committed: Thu Jul 11 20:39:33 2013 +0530

----------------------------------------------------------------------
 .../vmware/VmwareServerDiscoverer.java          | 70 ++++++++++++++------
 1 file changed, 51 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a3660d81/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
index 2807da5..33bc3e8 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
@@ -23,20 +23,21 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
-import javax.annotation.PostConstruct;
 import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
+
+import com.vmware.vim25.ClusterDasConfigInfo;
+import com.vmware.vim25.ManagedObjectReference;
+
 import org.apache.cloudstack.api.ApiConstants;
-import org.springframework.beans.NullValueInNestedPathException;
 
 import com.cloud.agent.api.StartupCommand;
 import com.cloud.agent.api.StartupRoutingCommand;
 import com.cloud.alert.AlertManager;
 import com.cloud.configuration.Config;
-import com.cloud.configuration.dao.ConfigurationDao;
 import com.cloud.dc.ClusterDetailsDao;
 import com.cloud.dc.ClusterVO;
 import com.cloud.dc.DataCenter.NetworkType;
@@ -67,7 +68,6 @@ import com.cloud.network.PhysicalNetwork;
 import com.cloud.network.VmwareTrafficLabel;
 import com.cloud.network.dao.CiscoNexusVSMDeviceDao;
 import com.cloud.network.element.CiscoNexusVSMElement;
-import com.cloud.network.element.CiscoNexusVSMElementService;
 import com.cloud.resource.Discoverer;
 import com.cloud.resource.DiscovererBase;
 import com.cloud.resource.ResourceManager;
@@ -81,9 +81,6 @@ import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.user.Account;
 import com.cloud.utils.UriUtils;
 
-import com.vmware.vim25.ClusterDasConfigInfo;
-import com.vmware.vim25.ManagedObjectReference;
-
 
 @Local(value = Discoverer.class)
 public class VmwareServerDiscoverer extends DiscovererBase implements
@@ -150,14 +147,41 @@ public class VmwareServerDiscoverer extends DiscovererBase implements
 
         Map<String, String> clusterDetails = _clusterDetailsDao.findDetails(clusterId);
         boolean legacyZone = _vmwareMgr.isLegacyZone(dcId);
+        boolean usernameNotProvided = (username == null || username.isEmpty());
+        boolean passwordNotProvided = (password == null || password.isEmpty());
         //Check if NOT a legacy zone.
         if (!legacyZone) {
-            String updatedInventoryPath = validateCluster(dcId, url, username, password);
+            // Retrieve VMware DC associated with specified zone
+            VmwareDatacenterVO vmwareDc = fetchVmwareDatacenterByZone(dcId);
+            // Ensure username & password provided.
+            // If either or both not provided, try to retrieve & use the credentials from database, which are provided earlier while adding VMware DC to zone.
+            if (usernameNotProvided || passwordNotProvided) {
+                // Retrieve credentials associated with VMware DC
+                s_logger.info("Username and/or Password not provided while adding cluster to cloudstack zone. " +
+                        "Hence using both username & password provided while adding VMware DC to CloudStack zone.");
+                username = vmwareDc.getUser();
+                password = vmwareDc.getPassword();
+                clusterDetails.put("username", username);
+                clusterDetails.put("password", password);
+                _clusterDetailsDao.persist(clusterId, clusterDetails);
+            }
+            String updatedInventoryPath = validateCluster(url, vmwareDc);
             if (url.getPath() != updatedInventoryPath) {
-                // If url from API doesn't specifiy DC then update url in database with DC assocaited with this zone.
+                // If url from API doesn't specify DC then update url in database with DC associated with this zone.
                 clusterDetails.put("url", url.getScheme() + "://" + url.getHost() + updatedInventoryPath);
                 _clusterDetailsDao.persist(clusterId, clusterDetails);
             }
+        } else {
+            // For legacy zones insist on the old model of asking for credentials for each cluster being added.
+            if (usernameNotProvided) {
+                if (passwordNotProvided) {
+                    throw new InvalidParameterValueException("Please provide username & password to add this cluster to zone");
+                } else {
+                    throw new InvalidParameterValueException("Please provide username to add this cluster to zone");
+                }
+            } else if (passwordNotProvided) {
+                throw new InvalidParameterValueException("Please provide password to add this cluster to zone");
+            }
         }
 
         List<HostVO> hosts = _resourceMgr.listAllHostsInCluster(clusterId);
@@ -414,21 +438,17 @@ public class VmwareServerDiscoverer extends DiscovererBase implements
 		}
 	}
 
-    private String validateCluster(Long dcId, URI url, String username, String password) throws DiscoveryException {
-        String msg;
-        long vmwareDcId;
+    private VmwareDatacenterVO fetchVmwareDatacenterByZone(Long dcId) throws DiscoveryException {
         VmwareDatacenterVO vmwareDc;
-        String vmwareDcNameFromDb;
-        String vmwareDcNameFromApi;
-        String vCenterHost;
-        String updatedInventoryPath = url.getPath();
-        String clusterName = null;
+        VmwareDatacenterZoneMapVO vmwareDcZone;
+        long vmwareDcId;
+        String msg;
 
         // Check if zone is associated with DC
-        VmwareDatacenterZoneMapVO vmwareDcZone = _vmwareDcZoneMapDao.findByZoneId(dcId);
+        vmwareDcZone = _vmwareDcZoneMapDao.findByZoneId(dcId);
         if (vmwareDcZone == null) {
             msg = "Zone " + dcId + " is not associated with any VMware DC yet. "
-                        + "Please add VMware DC to this zone first and then try to add clusters.";
+                    + "Please add VMware DC to this zone first and then try to add clusters.";
             s_logger.error(msg);
             throw new DiscoveryException(msg);
         }
@@ -436,6 +456,18 @@ public class VmwareServerDiscoverer extends DiscovererBase implements
         // Retrieve DC added to this zone from database
         vmwareDcId = vmwareDcZone.getVmwareDcId();
         vmwareDc = _vmwareDcDao.findById(vmwareDcId);
+
+        return vmwareDc;
+    }
+
+    private String validateCluster(URI url, VmwareDatacenterVO vmwareDc) throws DiscoveryException {
+        String msg;
+        String vmwareDcNameFromDb;
+        String vmwareDcNameFromApi;
+        String vCenterHost;
+        String updatedInventoryPath = url.getPath();
+        String clusterName = null;
+
         vmwareDcNameFromApi = vmwareDcNameFromDb = vmwareDc.getVmwareDatacenterName();
         vCenterHost = vmwareDc.getVcenterHost();
         String inventoryPath = url.getPath();


[30/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3467: Fixing the unit tests for implicit dedication planner. When fix for bug 2662
was made the unit tests were not updated correctly. The unit tests should have been changed to
return the correct mock object (VMInstanceVO) when vmInstanceDao is queried for the vms
running on host.


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

Branch: refs/heads/sdnextensions
Commit: 51b02702f91bb084dd20540190f02232b82617f5
Parents: 1e2f99b
Author: Devdeep Singh <de...@gmail.com>
Authored: Thu Jul 11 16:01:13 2013 +0530
Committer: Devdeep Singh <de...@gmail.com>
Committed: Thu Jul 11 16:05:51 2013 +0530

----------------------------------------------------------------------
 .../implicitplanner/ImplicitPlannerTest.java    | 46 +++++++++-----------
 1 file changed, 20 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51b02702/plugins/deployment-planners/implicit-dedication/test/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java
----------------------------------------------------------------------
diff --git a/plugins/deployment-planners/implicit-dedication/test/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java b/plugins/deployment-planners/implicit-dedication/test/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java
index efbb5c2..e519668 100644
--- a/plugins/deployment-planners/implicit-dedication/test/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java
+++ b/plugins/deployment-planners/implicit-dedication/test/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java
@@ -202,11 +202,10 @@ public class ImplicitPlannerTest {
         // Validations.
         // Check cluster 2 and 3 are not in the cluster list.
         // Host 6 and 7 should also be in avoid list.
-        //System.out.println("checkStrictModeWithCurrentAccountVmsPresent:: Cluster list should not be empty but ::" + clusterList.toString());
         assertFalse("Cluster list should not be null/empty", (clusterList == null || clusterList.isEmpty()));
         boolean foundNeededCluster = false;
         for (Long cluster : clusterList) {
-            if (cluster == 4) {
+            if (cluster != 1) {
                 fail("Found a cluster that shouldn't have been present, cluster id : " + cluster);
             }else {
                 foundNeededCluster = true;
@@ -219,8 +218,7 @@ public class ImplicitPlannerTest {
         Set<Long> hostsThatShouldBeInAvoidList = new HashSet<Long>();
         hostsThatShouldBeInAvoidList.add(6L);
         hostsThatShouldBeInAvoidList.add(7L);
-        //System.out.println("checkStrictModeWithCurrentAccountVmsPresent:: Host in avoidlist :: " +  hostsThatShouldBeInAvoidList.toString()); 
-        assertFalse("Hosts 6 and 7 that should have been present were not found in avoid list" ,
+        assertTrue("Hosts 6 and 7 that should have been present were not found in avoid list" ,
                 hostsInAvoidList.containsAll(hostsThatShouldBeInAvoidList));
     }
 
@@ -244,14 +242,11 @@ public class ImplicitPlannerTest {
         // Host 5 and 7 should also be in avoid list.
         assertFalse("Cluster list should not be null/empty", (clusterList == null || clusterList.isEmpty()));
         boolean foundNeededCluster = false;
-        //System.out.println("Cluster list 2 should not be present ::" + clusterList.toString());
         for (Long cluster : clusterList) {
             if (cluster != 2) {
                 fail("Found a cluster that shouldn't have been present, cluster id : " + cluster);
-            }else {
+            } else {
                 foundNeededCluster = true;
-                //System.out.println("Cluster list 2 should not be present breaking now" + cluster);
-                break;
             }
         }
         assertTrue("Didn't find cluster 2 in the list. It should have been present", foundNeededCluster);
@@ -261,7 +256,7 @@ public class ImplicitPlannerTest {
         Set<Long> hostsThatShouldBeInAvoidList = new HashSet<Long>();
         hostsThatShouldBeInAvoidList.add(5L);
         hostsThatShouldBeInAvoidList.add(7L);
-        assertFalse("Hosts 5 and 7 that should have been present were not found in avoid list" ,
+        assertTrue("Hosts 5 and 7 that should have been present were not found in avoid list" ,
                 hostsInAvoidList.containsAll(hostsThatShouldBeInAvoidList));
     }
 
@@ -283,8 +278,7 @@ public class ImplicitPlannerTest {
 
         // Validations.
         // Check cluster list is empty.
-        //System.out.println("Cluster list should not be empty but  ::" + clusterList.toString());
-        assertFalse("Cluster list should not be null/empty", (clusterList == null || clusterList.isEmpty()));
+        assertTrue("Cluster list should not be null/empty", (clusterList == null || clusterList.isEmpty()));
     }
 
     @Test
@@ -360,7 +354,7 @@ public class ImplicitPlannerTest {
         when(vmProfile.getOwner()).thenReturn(account);
         when(vmProfile.getVirtualMachine()).thenReturn(vm);
         when(vmProfile.getId()).thenReturn(12L);
-        when( vmDao.findById(12L)).thenReturn(userVm);
+        when(vmDao.findById(12L)).thenReturn(userVm);
         when(userVm.getAccountId()).thenReturn(accountId);
 
         when(vm.getDataCenterId()).thenReturn(dataCenterId);
@@ -440,20 +434,20 @@ public class ImplicitPlannerTest {
         UserVmVO vm3 = mock(UserVmVO.class);
         when(vm3.getAccountId()).thenReturn(201L);
         when(vm3.getServiceOfferingId()).thenReturn(offeringIdForVmsOfOtherAccount);
-        List<UserVmVO> userVmsForHost1 = new ArrayList<UserVmVO>();
-        List<UserVmVO> userVmsForHost2 = new ArrayList<UserVmVO>();
-        List<UserVmVO> userVmsForHost3 = new ArrayList<UserVmVO>();
-        List<UserVmVO> stoppedVmsForHost = new ArrayList<UserVmVO>();
+        List<VMInstanceVO> vmsForHost1 = new ArrayList<VMInstanceVO>();
+        List<VMInstanceVO> vmsForHost2 = new ArrayList<VMInstanceVO>();
+        List<VMInstanceVO> vmsForHost3 = new ArrayList<VMInstanceVO>();
+        List<VMInstanceVO> stoppedVmsForHost = new ArrayList<VMInstanceVO>();
         // Host 2 is empty.
-        userVmsForHost1.add(vm1);
-        userVmsForHost1.add(vm2);
-        userVmsForHost3.add(vm3);
-        when(vmDao.listUpByHostId(5L)).thenReturn(userVmsForHost1);
-        when(vmDao.listUpByHostId(6L)).thenReturn(userVmsForHost2);
-        when(vmDao.listUpByHostId(7L)).thenReturn(userVmsForHost3);
-        when(vmDao.listByLastHostId(5L)).thenReturn(stoppedVmsForHost);
-        when(vmDao.listByLastHostId(6L)).thenReturn(stoppedVmsForHost);
-        when(vmDao.listByLastHostId(7L)).thenReturn(stoppedVmsForHost);
+        vmsForHost1.add(vm1);
+        vmsForHost1.add(vm2);
+        vmsForHost3.add(vm3);
+        when(vmInstanceDao.listUpByHostId(5L)).thenReturn(vmsForHost1);
+        when(vmInstanceDao.listUpByHostId(6L)).thenReturn(vmsForHost2);
+        when(vmInstanceDao.listUpByHostId(7L)).thenReturn(vmsForHost3);
+        when(vmInstanceDao.listByLastHostId(5L)).thenReturn(stoppedVmsForHost);
+        when(vmInstanceDao.listByLastHostId(6L)).thenReturn(stoppedVmsForHost);
+        when(vmInstanceDao.listByLastHostId(7L)).thenReturn(stoppedVmsForHost);
 
         // Mock the offering with which the vm was created.
         ServiceOfferingVO offeringForVmOfThisAccount = mock(ServiceOfferingVO.class);
@@ -589,4 +583,4 @@ public class ImplicitPlannerTest {
             }
         }
     }
-}
+}
\ No newline at end of file


[02/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-2988: API - Template Response - add isdynamicallyscalable property.


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

Branch: refs/heads/sdnextensions
Commit: ec42d7236cd35bde66c1cd0e2362e99093929f7c
Parents: da8b1ef
Author: Jessica Wang <je...@apache.org>
Authored: Wed Jul 10 13:50:23 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Wed Jul 10 13:51:54 2013 -0700

----------------------------------------------------------------------
 .../com/cloud/api/query/dao/TemplateJoinDaoImpl.java   |  1 +
 server/src/com/cloud/api/query/vo/TemplateJoinVO.java  | 13 +++++++++++++
 setup/db/db/schema-410to420.sql                        |  1 +
 3 files changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec42d723/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java
index f5b7218..d78580c 100644
--- a/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java
@@ -144,6 +144,7 @@ public class TemplateJoinDaoImpl extends GenericDaoBase<TemplateJoinVO, Long> im
         templateResponse.setFeatured(template.isFeatured());
         templateResponse.setExtractable(template.isExtractable() && !(template.getTemplateType() == TemplateType.SYSTEM));
         templateResponse.setPasswordEnabled(template.isEnablePassword());
+        templateResponse.setDynamicallyScalable(template.isDynamicallyScalable());
         templateResponse.setSshKeyEnabled(template.isEnableSshKey());
         templateResponse.setCrossZones(template.isCrossZones());
         templateResponse.setFormat(template.getFormat());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec42d723/server/src/com/cloud/api/query/vo/TemplateJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/TemplateJoinVO.java b/server/src/com/cloud/api/query/vo/TemplateJoinVO.java
index 1f2afe9..bb1cfed 100644
--- a/server/src/com/cloud/api/query/vo/TemplateJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/TemplateJoinVO.java
@@ -95,6 +95,9 @@ public class TemplateJoinVO extends BaseViewVO implements ControlledViewEntity {
     @Column(name="enable_password")
     private boolean enablePassword;
 
+    @Column(name="dynamically_scalable")
+    private boolean dynamicallyScalable;
+    
     @Column(name="guest_os_id")
     private long guestOSId;
 
@@ -748,7 +751,17 @@ public class TemplateJoinVO extends BaseViewVO implements ControlledViewEntity {
         this.enablePassword = enablePassword;
     }
 
+    
+    
+    public boolean isDynamicallyScalable() {
+        return dynamicallyScalable;
+    }
 
+    public void setDynamicallyScalable(boolean dynamicallyScalable) {
+        this.dynamicallyScalable = dynamicallyScalable;
+    }
+       
+    
 
     public long getGuestOSId() {
         return guestOSId;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec42d723/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index c7787f3..2c49cb9 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -1882,6 +1882,7 @@ CREATE VIEW `cloud`.`template_view` AS
         vm_template.checksum,
         vm_template.display_text,
         vm_template.enable_password,
+        vm_template.dynamically_scalable,
         vm_template.guest_os_id,
         guest_os.uuid guest_os_uuid,
         guest_os.display_name guest_os_name,


[16/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3423. Publish 'VM.UPGRADE' usage event every time the service offering of a VM is upgraded.


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

Branch: refs/heads/sdnextensions
Commit: 873e4e0e585f36491b8e2ab7b5983e843283c2be
Parents: 3f5c1c6
Author: Likitha Shetty <li...@citrix.com>
Authored: Thu Jul 11 10:03:57 2013 +0530
Committer: Likitha Shetty <li...@citrix.com>
Committed: Thu Jul 11 10:06:10 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/vm/UserVmManagerImpl.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/873e4e0e/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 0486071..53b4b6e 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -818,6 +818,10 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use
             _resourceLimitMgr.decrementResourceCount(caller.getAccountId(), ResourceType.memory, new Long (currentMemory - newMemory));
         }
 
+        // Generate usage event for VM upgrade
+        UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VM_UPGRADE, vmInstance.getAccountId(), vmInstance.getDataCenterId(), vmInstance.getId(), vmInstance.getHostName(),
+                vmInstance.getServiceOfferingId(), vmInstance.getTemplateId(), vmInstance.getHypervisorType().toString(), VirtualMachine.class.getName(), vmInstance.getUuid());
+
         return _vmDao.findById(vmInstance.getId());
 
     }


[17/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-1815


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

Branch: refs/heads/sdnextensions
Commit: f56d9d7c63b03516382c85290d202eff191c57aa
Parents: 873e4e0
Author: radhikap <ra...@citrix.com>
Authored: Thu Jul 11 10:25:40 2013 +0530
Committer: radhikap <ra...@citrix.com>
Committed: Thu Jul 11 10:27:28 2013 +0530

----------------------------------------------------------------------
 docs/en-US/password-storage-engine.xml | 54 +++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f56d9d7c/docs/en-US/password-storage-engine.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/password-storage-engine.xml b/docs/en-US/password-storage-engine.xml
new file mode 100644
index 0000000..b1d5340
--- /dev/null
+++ b/docs/en-US/password-storage-engine.xml
@@ -0,0 +1,54 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
+%BOOK_ENTITIES;
+]>
+
+<!-- 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.
+-->
+<section id="password-storage-engine">
+  <title>Changing the Default Password Encryption</title>
+  <para>&PRODUCT; allows you to determine the default encoding and authentication mechanism for
+    admin and user logins. Plain text user authenticator has been changed to do a simple string
+    comparison between retrieved and supplied login passwords instead of comparing the retrieved md5
+    hash of the stored password against the supplied md5 hash of the password because clients no
+    longer hash the password. The following method determines what encoding scheme is used to encode
+    the password supplied during user creation or modification.</para>
+  <para>When a new user is created, the user password is encoded by using the first valid encoder
+    loaded as per the sequence specified in the <code>UserPasswordEncoders</code> property in the
+      <filename>ComponentContext.xml</filename> or <filename>nonossComponentContext.xml</filename>
+    files. The order of authentication schemes is determined by the <code>UserAuthenticators</code>
+    property in the same files. The administrator can change the ordering of both these properties
+    as preferred. When a new authenticator or encoder is added, you can add them to this list. While
+    doing so, ensure that the new authenticator or encoder is specified as a bean in both these
+    files if they are required for both oss and non-oss components. The two properties are listed
+    below:</para>
+  <programlisting>&lt;property name="UserAuthenticators"&gt;
+         &lt;list&gt;
+            &lt;ref bean="SHA256SaltedUserAuthenticator"/&gt;
+            &lt;ref bean="MD5UserAuthenticator"/&gt;
+            &lt;ref bean="LDAPUserAuthenticator"/&gt;
+            &lt;ref bean="PlainTextUserAuthenticator"/&gt;
+        &lt;/list&gt;
+    &lt;/property&gt;
+    &lt;property name="UserPasswordEncoders"&gt;
+        &lt;list&gt;
+            &lt;ref bean="SHA256SaltedUserAuthenticator"/&gt;
+             &lt;ref bean="MD5UserAuthenticator"/&gt;
+             &lt;ref bean="LDAPUserAuthenticator"/&gt;
+            &lt;ref bean="PlainTextUserAuthenticator"/&gt;
+         &lt;/list&gt;</programlisting>
+</section>


[07/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-1510: NPE when primary storage is added with wrong path

Description:

	a) Fixing NPE when wrong path is provided for primary datastore.
	b) No error dialog shows up in GUI when wrong path is provided,
	   after NPE fix - propagating exception upward.
	c) If the KVM agent is down, an invalid datastore gets logged in
	   storage_pool table and doesn't get removed, so it shows up
	   in the GUI in the list of datastores - fixing this as well.


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

Branch: refs/heads/sdnextensions
Commit: 7ea8c5fd9a19b9f34158e2ab8db840967db6663d
Parents: 7089e1c
Author: Vijayendra Bhamidipati <vi...@citrix.com>
Authored: Wed Jun 19 13:01:18 2013 -0700
Committer: Edison Su <su...@gmail.com>
Committed: Wed Jul 10 14:55:57 2013 -0700

----------------------------------------------------------------------
 .../command/admin/storage/CreateStoragePoolCmd.java    |  2 ++
 .../hypervisor/kvm/storage/LibvirtStorageAdaptor.java  | 13 +++++++++++--
 .../CloudStackPrimaryDataStoreLifeCycleImpl.java       |  7 ++++++-
 server/src/com/cloud/storage/StorageManagerImpl.java   |  6 +++++-
 4 files changed, 24 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7ea8c5fd/api/src/org/apache/cloudstack/api/command/admin/storage/CreateStoragePoolCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/CreateStoragePoolCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/CreateStoragePoolCmd.java
index f5750b9..c26d199 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/CreateStoragePoolCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/CreateStoragePoolCmd.java
@@ -182,6 +182,8 @@ public class CreateStoragePoolCmd extends BaseCmd {
         } catch (UnknownHostException ex3) {
             s_logger.warn("Exception: ", ex3);
             throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, ex3.getMessage());
+        } catch (Exception ex4) {
+            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, ex4.getMessage());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7ea8c5fd/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
index 89e22c8..db1811e 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
@@ -128,7 +128,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
     }
 
     private StoragePool createNfsStoragePool(Connect conn, String uuid,
-            String host, String path) {
+            String host, String path) throws LibvirtException {
         String targetPath = _mountPoint + File.separator + uuid;
         LibvirtStoragePoolDef spd = new LibvirtStoragePoolDef(poolType.NETFS,
                 uuid, uuid, host, path, targetPath);
@@ -156,6 +156,9 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
                 } else {
                     s_logger.error("Failed in unmounting and redefining storage");
                 }
+            } else {
+                s_logger.error("Internal error occurred when attempting to mount: specified path may be invalid");
+                throw e;
             }
             if (sp != null) {
                 try {
@@ -496,7 +499,13 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
             s_logger.debug("Attempting to create storage pool " + name);
 
             if (type == StoragePoolType.NetworkFilesystem) {
-                sp = createNfsStoragePool(conn, name, host, path);
+                try {
+                        sp = createNfsStoragePool(conn, name, host, path);
+                } catch (LibvirtException e) {
+                        s_logger.error("Failed to create mount");
+                        s_logger.error(e.getStackTrace());
+                        throw new CloudRuntimeException(e.toString());
+                }
             } else if (type == StoragePoolType.SharedMountPoint
                     || type == StoragePoolType.Filesystem) {
                 sp = createSharedStoragePool(conn, name, host, path);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7ea8c5fd/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java
index 2e0ff66..26733d4 100644
--- a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java
+++ b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java
@@ -60,6 +60,7 @@ import com.cloud.storage.StoragePool;
 import com.cloud.storage.StoragePoolAutomation;
 import com.cloud.storage.StoragePoolDiscoverer;
 import com.cloud.storage.StoragePoolHostVO;
+import com.cloud.storage.StoragePoolStatus;
 import com.cloud.storage.dao.StoragePoolHostDao;
 import com.cloud.storage.dao.StoragePoolWorkDao;
 import com.cloud.storage.dao.VolumeDao;
@@ -396,7 +397,7 @@ public class CloudStackPrimaryDataStoreLifeCycleImpl implements PrimaryDataStore
             s_logger.warn("No host can access storage pool " + primarystore + " on cluster "
                     + primarystore.getClusterId());
             primaryDataStoreDao.expunge(primarystore.getId());
-            return false;
+            throw new CloudRuntimeException("Failed to access storage pool");
         }
 
         this.dataStoreHelper.attachCluster(store);
@@ -437,6 +438,10 @@ public class CloudStackPrimaryDataStoreLifeCycleImpl implements PrimaryDataStore
         List<StoragePoolHostVO> hostPoolRecords = this._storagePoolHostDao.listByPoolId(store.getId());
         StoragePool pool = (StoragePool) store;
         boolean deleteFlag = false;
+        // If datastore is not in ready state, simply delete its db entry.
+        if (pool.getStatus() != StoragePoolStatus.Up) {
+            return this.dataStoreHelper.deletePrimaryDataStore(store);
+        }
         // Remove the SR associated with the Xenserver
         for (StoragePoolHostVO host : hostPoolRecords) {
             DeleteStoragePoolCommand deleteCmd = new DeleteStoragePoolCommand(pool);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7ea8c5fd/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java
index 7378708..830fd36 100755
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@ -717,7 +717,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
         params.put("capacityIops", cmd.getCapacityIops());
 
         DataStoreLifeCycle lifeCycle = storeProvider.getDataStoreLifeCycle();
-        DataStore store;
+        DataStore store = null;
         try {
             store = lifeCycle.initialize(params);
             if (scopeType == ScopeType.CLUSTER) {
@@ -729,6 +729,10 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
             }
         } catch (Exception e) {
             s_logger.debug("Failed to add data store", e);
+            // clean up the db
+            if (store != null) {
+                lifeCycle.deleteDataStore(store);
+            }
             throw new CloudRuntimeException("Failed to add data store", e);
         }
 


[19/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-1047: tracking in logs using job id.


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

Branch: refs/heads/sdnextensions
Commit: 2e8d16b36549d6364ed0b4e54b095c7101d64e7c
Parents: 3e8edd7
Author: Sanjay Tripathi <sa...@citrix.com>
Authored: Mon Jun 17 17:01:39 2013 +0530
Committer: Devdeep Singh <de...@gmail.com>
Committed: Thu Jul 11 10:41:39 2013 +0530

----------------------------------------------------------------------
 .../com/cloud/async/AsyncJobManagerImpl.java    | 134 +++++++++++--------
 .../com/cloud/storage/VolumeManagerImpl.java    |   8 +-
 2 files changed, 81 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e8d16b3/server/src/com/cloud/async/AsyncJobManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/AsyncJobManagerImpl.java b/server/src/com/cloud/async/AsyncJobManagerImpl.java
index 37b9727..d3efdee 100644
--- a/server/src/com/cloud/async/AsyncJobManagerImpl.java
+++ b/server/src/com/cloud/async/AsyncJobManagerImpl.java
@@ -213,7 +213,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
             job.setSyncSource(null);
             scheduleExecution(job, scheduleJobExecutionInContext);
             if(s_logger.isDebugEnabled()) {
-                s_logger.debug("submit async job-" + job.getId() + ", details: " + job.toString());
+                s_logger.debug("submit async job-" + job.getId() + " = [ " + job.getUuid() + " ], details: " + job.toString());
             }
             publishOnEventBus(job, "submit");
             return job.getId();
@@ -227,25 +227,25 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
 
     @Override @DB
     public void completeAsyncJob(long jobId, int jobStatus, int resultCode, Object resultObject) {
-        if(s_logger.isDebugEnabled()) {
-            s_logger.debug("Complete async job-" + jobId + ", jobStatus: " + jobStatus +
-                    ", resultCode: " + resultCode + ", result: " + resultObject);
+        AsyncJobVO job = _jobDao.findById(jobId);
+        String jobUuid = null;
+        if (job != null) {
+            jobUuid = job.getUuid();
+            if(s_logger.isDebugEnabled()) {
+                s_logger.debug("Complete async job-" + jobId + " = [ " + jobUuid + " ], jobStatus: " + jobStatus +
+                        ", resultCode: " + resultCode + ", result: " + resultObject);
+            }
+        } else {
+            if(s_logger.isDebugEnabled()) {
+                s_logger.debug("job-" + jobId + " no longer exists, we just log completion info here. " + jobStatus +
+                        ", resultCode: " + resultCode + ", result: " + resultObject);
+            }
+            return;
         }
 
         Transaction txt = Transaction.currentTxn();
         try {
             txt.start();
-            AsyncJobVO job = _jobDao.findById(jobId);
-            if(job == null) {
-                if(s_logger.isDebugEnabled()) {
-                    s_logger.debug("job-" + jobId + " no longer exists, we just log completion info here. " + jobStatus +
-                            ", resultCode: " + resultCode + ", result: " + resultObject);
-                }
-
-                txt.rollback();
-                return;
-            }
-
             job.setCompleteMsid(getMsid());
             job.setStatus(jobStatus);
             job.setResultCode(resultCode);
@@ -264,31 +264,31 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
             _jobDao.update(jobId, job);
             txt.commit();
         } catch(Exception e) {
-            s_logger.error("Unexpected exception while completing async job-" + jobId, e);
+            s_logger.error("Unexpected exception while completing async job-" + jobId + " = [ " + jobUuid + " ]", e);
             txt.rollback();
         }
     }
 
     @Override @DB
     public void updateAsyncJobStatus(long jobId, int processStatus, Object resultObject) {
-        if(s_logger.isDebugEnabled()) {
-            s_logger.debug("Update async-job progress, job-" + jobId + ", processStatus: " + processStatus +
-                    ", result: " + resultObject);
+        AsyncJobVO job = _jobDao.findById(jobId);
+        String jobUuid = null;
+        if (job != null) {
+            jobUuid = job.getUuid();
+            if(s_logger.isDebugEnabled()) {
+                s_logger.debug("Update async-job progress, job-" + jobId + " = [ " + jobUuid + " ], processStatus: " + processStatus +
+                        ", result: " + resultObject);
+            }
+        } else {
+            if(s_logger.isDebugEnabled()) {
+                s_logger.debug("job-" + jobId + " no longer exists, we just log progress info here. progress status: " + processStatus);
+            }
+            return;
         }
 
         Transaction txt = Transaction.currentTxn();
         try {
             txt.start();
-            AsyncJobVO job = _jobDao.findById(jobId);
-            if(job == null) {
-                if(s_logger.isDebugEnabled()) {
-                    s_logger.debug("job-" + jobId + " no longer exists, we just log progress info here. progress status: " + processStatus);
-                }
-
-                txt.rollback();
-                return;
-            }
-
             job.setProcessStatus(processStatus);
             if(resultObject != null) {
                 job.setResult(ApiSerializerHelper.toSerializedStringOld(resultObject));
@@ -298,23 +298,32 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
             publishOnEventBus(job, "update");
             txt.commit();
         } catch(Exception e) {
-            s_logger.error("Unexpected exception while updating async job-" + jobId + " status: ", e);
+            s_logger.error("Unexpected exception while updating async job-" + jobId + " = [ " + jobUuid + " ] status: ", e);
             txt.rollback();
         }
     }
 
     @Override @DB
     public void updateAsyncJobAttachment(long jobId, String instanceType, Long instanceId) {
-        if(s_logger.isDebugEnabled()) {
-            s_logger.debug("Update async-job attachment, job-" + jobId + ", instanceType: " + instanceType +
-                    ", instanceId: " + instanceId);
+        AsyncJobVO job = _jobDao.findById(jobId);
+        String jobUuid = null;
+        if (job != null) {
+            jobUuid = job.getUuid();
+            if(s_logger.isDebugEnabled()) {
+                s_logger.debug("Update async-job attachment, job-" + jobId + " = [ " + jobUuid + " ], instanceType: "
+                        + instanceType + ", instanceId: " + instanceId);
+            }
+        } else {
+            if(s_logger.isDebugEnabled()) {
+                s_logger.debug("job-" + jobId + " no longer exists, instanceType: " + instanceType + ", instanceId: "
+                        + instanceId);
+            }
+            return;
         }
 
         Transaction txt = Transaction.currentTxn();
         try {
             txt.start();
-
-            AsyncJobVO job = _jobDao.createForUpdate();
             //job.setInstanceType(instanceType);
             job.setInstanceId(instanceId);
             job.setLastUpdated(DateUtil.currentGMTTime());
@@ -322,7 +331,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
 
             txt.commit();
         } catch(Exception e) {
-            s_logger.error("Unexpected exception while updating async job-" + jobId + " attachment: ", e);
+            s_logger.error("Unexpected exception while updating async job-" + jobId + " = [ " + jobUuid + " ] attachment: ", e);
             txt.rollback();
         }
     }
@@ -339,7 +348,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
         }
 
         if(s_logger.isDebugEnabled()) {
-            s_logger.debug("Sync job-" + job.getId() + " execution on object " + syncObjType + "." + syncObjId);
+            s_logger.debug("Sync job-" + job.getId() + " = [ " + job.getUuid() + " ] execution on object " + syncObjType + "." + syncObjId);
         }
 
         SyncQueueVO queue = null;
@@ -363,7 +372,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
         if (queue == null) {
             throw new CloudRuntimeException("Unable to insert queue item into database, DB is full?");
         } else {
-            throw new AsyncCommandQueued(queue, "job-" + job.getId() + " queued");
+            throw new AsyncCommandQueued(queue, "job-" + job.getId() + " = [ " + job.getUuid() + " ] queued");
         }
     }
 
@@ -383,7 +392,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
         if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL) {
             //regular user can see only jobs he owns
             if (caller.getId() != jobOwner.getId()) {
-                throw new PermissionDeniedException("Account " + caller + " is not authorized to see job id=" + job.getId());
+                throw new PermissionDeniedException("Account " + caller + " is not authorized to see job-" + job.getId() + " = [ " + job.getUuid() + " ]");
             }
         } else if (caller.getType() == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) {
             _accountMgr.checkAccess(caller, null, true, jobOwner);
@@ -396,8 +405,17 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
 
     @Override @DB
     public AsyncJobResult queryAsyncJobResult(long jobId) {
-        if(s_logger.isTraceEnabled()) {
-            s_logger.trace("Query async-job status, job-" + jobId);
+        AsyncJobVO job = _jobDao.findById(jobId);
+        String jobUuid = null;
+        if (job != null) {
+            jobUuid = job.getUuid();
+            if(s_logger.isTraceEnabled()) {
+                s_logger.trace("Query async-job status, job-" + jobId + " = [ " + jobUuid + " ]");
+            }
+        } else {
+            if(s_logger.isDebugEnabled()) {
+                s_logger.debug("Async job-" + jobId + " does not exist, invalid job id?");
+            }
         }
 
         Transaction txt = Transaction.currentTxn();
@@ -405,7 +423,6 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
 
         try {
             txt.start();
-            AsyncJobVO job = _jobDao.findById(jobId);
             if(job != null) {
                 jobResult.setCmdOriginator(job.getCmdOriginator());
                 jobResult.setJobStatus(job.getStatus());
@@ -418,23 +435,23 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
                         job.getStatus() == AsyncJobResult.STATUS_FAILED) {
 
                     if(s_logger.isDebugEnabled()) {
-                        s_logger.debug("Async job-" + jobId + " completed");
+                        s_logger.debug("Async job-" + jobId + " = [ " + jobUuid + " ] completed");
                     }
                 } else {
                     job.setLastPolled(DateUtil.currentGMTTime());
                     _jobDao.update(jobId, job);
                 }
             } else {
-                if(s_logger.isDebugEnabled()) {
-                    s_logger.debug("Async job-" + jobId + " does not exist, invalid job id?");
-                }
-
                 jobResult.setJobStatus(AsyncJobResult.STATUS_FAILED);
                 jobResult.setResult("job-" + jobId + " does not exist");
             }
             txt.commit();
         } catch(Exception e) {
-            s_logger.error("Unexpected exception while querying async job-" + jobId + " status: ", e);
+            if (jobUuid == null) {
+                s_logger.error("Unexpected exception while querying async job-" + jobId + " status: ", e);
+            } else {
+                s_logger.error("Unexpected exception while querying async job-" + jobId + " = [ " + jobUuid + " ] status: ", e);
+            }
 
             jobResult.setJobStatus(AsyncJobResult.STATUS_FAILED);
             jobResult.setResult("Exception: " + e.toString());
@@ -471,17 +488,18 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
                     try {
                         JmxUtil.registerMBean("AsyncJobManager", "Active Job " + job.getId(), new AsyncJobMBeanImpl(job));
                     } catch(Exception e) {
-                        s_logger.warn("Unable to register active job " + job.getId() + " to JMX monitoring due to exception " + ExceptionUtil.toString(e));
+                        s_logger.warn("Unable to register active job [ " + job.getId() + " ] = [ " + job.getUuid() + " ] to JMX monitoring due to exception " + ExceptionUtil.toString(e));
                     }
 
                     BaseAsyncCmd cmdObj = null;
                     Transaction txn = Transaction.open(Transaction.CLOUD_DB);
                     try {
                         jobId = job.getId();
-                        NDC.push("job-" + jobId);
+                        String jobUuid = job.getUuid();
+                        NDC.push("job-" + jobId + " = [ " + jobUuid + " ]");
 
                         if(s_logger.isDebugEnabled()) {
-                            s_logger.debug("Executing " + job.getCmd() + " for job-" + jobId);
+                            s_logger.debug("Executing " + job.getCmd() + " for job-" + jobId + " = [ " + jobUuid + " ]");
                         }
 
                         Class<?> cmdClass = Class.forName(job.getCmd());
@@ -526,13 +544,13 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
                         }
 
                         if (s_logger.isDebugEnabled()) {
-                            s_logger.debug("Done executing " + job.getCmd() + " for job-" + jobId);
+                            s_logger.debug("Done executing " + job.getCmd() + " for job-" + job.getId() + " = [ " + jobUuid + " ]");
                         }
 
                     } catch(Throwable e) {
                         if (e instanceof AsyncCommandQueued) {
                             if (s_logger.isDebugEnabled()) {
-                                s_logger.debug("job " + job.getCmd() + " for job-" + jobId + " was queued, processing the queue.");
+                                s_logger.debug("job " + job.getCmd() + " for job-" + jobId + " = [ " + job.getUuid() + " ] was queued, processing the queue.");
                             }
                             checkQueue(((AsyncCommandQueued)e).getQueue().getId());
                         } else {
@@ -571,7 +589,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
                         try {
                             JmxUtil.unregisterMBean("AsyncJobManager", "Active Job " + job.getId());
                         } catch(Exception e) {
-                            s_logger.warn("Unable to unregister active job " + job.getId() + " from JMX monitoring");
+                            s_logger.warn("Unable to unregister active job [ " + job.getId() + " ] = [ " + job.getUuid() + " ] from JMX monitoring");
                         }
 
                         txn.close();
@@ -588,10 +606,12 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
     }
 
     private void executeQueueItem(SyncQueueItemVO item, boolean fromPreviousSession) {
+        long jobId = item.getContentId();
         AsyncJobVO job = _jobDao.findById(item.getContentId());
         if (job != null) {
+            String jobUuid = job.getUuid();
             if(s_logger.isDebugEnabled()) {
-                s_logger.debug("Schedule queued job-" + job.getId());
+                s_logger.debug("Schedule queued job-" + jobId + " = [ " + jobUuid + " ]");
             }
 
             job.setFromPreviousSession(fromPreviousSession);
@@ -603,7 +623,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
             try {
                 scheduleExecution(job);
             } catch(RejectedExecutionException e) {
-                s_logger.warn("Execution for job-" + job.getId() + " is rejected, return it to the queue for next turn");
+                s_logger.warn("Execution for job-" + jobId + " = [ " + jobUuid + " ] is rejected, return it to the queue for next turn");
                 _queueMgr.returnItem(item.getId());
             }
 
@@ -620,7 +640,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
     public void releaseSyncSource(AsyncJobExecutor executor) {
         if(executor.getSyncSource() != null) {
             if(s_logger.isDebugEnabled()) {
-                s_logger.debug("Release sync source for job-" + executor.getJob().getId() + " sync source: "
+                s_logger.debug("Release sync source for job-" + executor.getJob().getId() + " = [ " + executor.getJob().getUuid() + " ] sync source: "
                         + executor.getSyncSource().getContentType() + "-"
                         + executor.getSyncSource().getContentId());
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e8d16b3/server/src/com/cloud/storage/VolumeManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeManagerImpl.java b/server/src/com/cloud/storage/VolumeManagerImpl.java
index c2678fc..1618574 100644
--- a/server/src/com/cloud/storage/VolumeManagerImpl.java
+++ b/server/src/com/cloud/storage/VolumeManagerImpl.java
@@ -1869,8 +1869,8 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
             if (s_logger.isInfoEnabled()) {
                 s_logger.info("Trying to attaching volume " + volumeId
                         + " to vm instance:" + vm.getId()
-                        + ", update async job-" + job.getId()
-                        + " progress status");
+                        + ", update async job-" + job.getId() + " = [ " + job.getUuid()
+                        + " ] progress status");
             }
 
             _asyncMgr.updateAsyncJobAttachment(job.getId(), "volume", volumeId);
@@ -1976,8 +1976,8 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
             if (s_logger.isInfoEnabled()) {
                 s_logger.info("Trying to attaching volume " + volumeId
                         + "to vm instance:" + vm.getId()
-                        + ", update async job-" + job.getId()
-                        + " progress status");
+                        + ", update async job-" + job.getId() + " = [ " + job.getUuid()
+                        + " ] progress status");
             }
 
             _asyncMgr.updateAsyncJobAttachment(job.getId(), "volume", volumeId);


[27/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-1768: Ability to delete Events and Alerts: Delete by a time period is required.
User should be able to delete/archive alerts and events by selecting a time period or by
choosing the alerts and events older than a date. Added the ability to choose a time period
too.


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

Branch: refs/heads/sdnextensions
Commit: 429e6bd4bb084a568c74d5412729e5e8c09d4c9a
Parents: 47de56d
Author: Sanjay Tripathi <sa...@citrix.com>
Authored: Tue Jun 4 16:03:53 2013 +0530
Committer: Devdeep Singh <de...@gmail.com>
Committed: Thu Jul 11 14:12:17 2013 +0530

----------------------------------------------------------------------
 .../org/apache/cloudstack/api/ApiConstants.java |  1 -
 .../admin/resource/ArchiveAlertsCmd.java        | 24 +++++++++----
 .../command/admin/resource/DeleteAlertsCmd.java | 23 ++++++++----
 .../command/user/event/ArchiveEventsCmd.java    | 24 +++++++++----
 .../api/command/user/event/DeleteEventsCmd.java | 21 ++++++++---
 .../src/com/cloud/alert/dao/AlertDao.java       |  4 +--
 .../src/com/cloud/alert/dao/AlertDaoImpl.java   | 37 ++++++++++++--------
 .../src/com/cloud/event/dao/EventDao.java       |  2 +-
 .../src/com/cloud/event/dao/EventDaoImpl.java   | 11 +++---
 server/src/com/cloud/api/ApiDispatcher.java     | 11 ++++--
 .../com/cloud/server/ManagementServerImpl.java  |  8 ++---
 .../com/cloud/alert/AlertControlsUnitTest.java  |  8 ++---
 .../com/cloud/event/EventControlsUnitTest.java  |  2 +-
 13 files changed, 116 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/429e6bd4/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 e2857b8..83999b6 100755
--- a/api/src/org/apache/cloudstack/api/ApiConstants.java
+++ b/api/src/org/apache/cloudstack/api/ApiConstants.java
@@ -498,7 +498,6 @@ public class ApiConstants {
     public static final String UCS_BLADE_DN = "bladedn";
     public static final String UCS_BLADE_ID = "bladeid";
     public static final String VM_GUEST_IP = "vmguestip";
-    public static final String OLDER_THAN = "olderthan";
     public static final String HEALTHCHECK_RESPONSE_TIMEOUT = "responsetimeout";
     public static final String HEALTHCHECK_INTERVAL_TIME = "intervaltime";
     public static final String HEALTHCHECK_HEALTHY_THRESHOLD = "healthythreshold";

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/429e6bd4/api/src/org/apache/cloudstack/api/command/admin/resource/ArchiveAlertsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/resource/ArchiveAlertsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/resource/ArchiveAlertsCmd.java
index 2a1a47a..eed914e 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/resource/ArchiveAlertsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/resource/ArchiveAlertsCmd.java
@@ -26,7 +26,6 @@ import org.apache.cloudstack.api.BaseCmd;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.AlertResponse;
-import org.apache.cloudstack.api.response.ConditionResponse;
 import org.apache.cloudstack.api.response.SuccessResponse;
 import org.apache.log4j.Logger;
 
@@ -48,8 +47,13 @@ public class ArchiveAlertsCmd extends BaseCmd {
             description = "the IDs of the alerts")
     private List<Long> ids;
 
-    @Parameter(name=ApiConstants.OLDER_THAN, type=CommandType.DATE, description="archive alerts older than this date (use format \"yyyy-MM-dd\")")
-    private Date olderThan;
+    @Parameter(name=ApiConstants.END_DATE, type=CommandType.DATE, description="end date range to archive alerts" +
+            " (including) this date (use format \"yyyy-MM-dd\" or the new format \"yyyy-MM-ddThh:mm:ss\")")
+    private Date endDate;
+
+    @Parameter(name=ApiConstants.START_DATE, type=CommandType.DATE, description="start date range to archive alerts" +
+            " (including) this date (use format \"yyyy-MM-dd\" or the new format \"yyyy-MM-ddThh:mm:ss\")")
+    private Date startDate;
 
     @Parameter(name = ApiConstants.TYPE, type = CommandType.STRING, description = "archive by alert type")
     private String type;
@@ -62,8 +66,12 @@ public class ArchiveAlertsCmd extends BaseCmd {
         return ids;
     }
 
-    public Date getOlderThan() {
-        return olderThan;
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public Date getStartDate() {
+        return startDate;
     }
 
     public String getType() {
@@ -86,8 +94,10 @@ public class ArchiveAlertsCmd extends BaseCmd {
 
     @Override
     public void execute() {
-        if(ids == null && type == null && olderThan == null) {
-            throw new InvalidParameterValueException("either ids, type or olderthan must be specified");
+        if(ids == null && type == null && endDate == null) {
+            throw new InvalidParameterValueException("either ids, type, startdate or enddate must be specified");
+        } else if (startDate != null && endDate == null) {
+            throw new InvalidParameterValueException("enddate must be specified with startdate parameter");
         }
         boolean result = _mgr.archiveAlerts(this);
         if (result) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/429e6bd4/api/src/org/apache/cloudstack/api/command/admin/resource/DeleteAlertsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/resource/DeleteAlertsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/resource/DeleteAlertsCmd.java
index f03793c..b0deaa9 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/resource/DeleteAlertsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/resource/DeleteAlertsCmd.java
@@ -47,8 +47,13 @@ public class DeleteAlertsCmd extends BaseCmd {
             description = "the IDs of the alerts")
     private List<Long> ids;
 
-    @Parameter(name=ApiConstants.OLDER_THAN, type=CommandType.DATE, description="delete alerts older than (including) this date (use format \"yyyy-MM-dd\")")
-    private Date olderThan;
+    @Parameter(name=ApiConstants.END_DATE, type=CommandType.DATE, description="end date range to delete alerts" +
+            " (including) this date (use format \"yyyy-MM-dd\" or the new format \"yyyy-MM-ddThh:mm:ss\")")
+    private Date endDate;
+
+    @Parameter(name=ApiConstants.START_DATE, type=CommandType.DATE, description="start date range to delete alerts" +
+            " (including) this date (use format \"yyyy-MM-dd\" or the new format \"yyyy-MM-ddThh:mm:ss\")")
+    private Date startDate;
 
     @Parameter(name = ApiConstants.TYPE, type = CommandType.STRING, description = "delete by alert type")
     private String type;
@@ -61,8 +66,12 @@ public class DeleteAlertsCmd extends BaseCmd {
         return ids;
     }
 
-    public Date getOlderThan() {
-        return olderThan;
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public Date getStartDate() {
+        return startDate;
     }
 
     public String getType() {
@@ -85,8 +94,10 @@ public class DeleteAlertsCmd extends BaseCmd {
 
     @Override
     public void execute() {
-        if(ids == null && type == null && olderThan == null) {
-            throw new InvalidParameterValueException("either ids, type or olderthan must be specified");
+        if(ids == null && type == null && endDate == null) {
+            throw new InvalidParameterValueException("either ids, type or enddate must be specified");
+        } else if (startDate != null && endDate == null) {
+            throw new InvalidParameterValueException("enddate must be specified with startdate parameter");
         }
         boolean result = _mgr.deleteAlerts(this);
         if (result) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/429e6bd4/api/src/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java b/api/src/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java
index 481607c..c5594e2 100644
--- a/api/src/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java
@@ -25,7 +25,6 @@ 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.AlertResponse;
 import org.apache.cloudstack.api.response.EventResponse;
 import org.apache.cloudstack.api.response.SuccessResponse;
 import org.apache.log4j.Logger;
@@ -49,8 +48,13 @@ public class ArchiveEventsCmd extends BaseCmd {
             description = "the IDs of the events")
     private List<Long> ids;
 
-    @Parameter(name=ApiConstants.OLDER_THAN, type=CommandType.DATE, description="archive events older than (including) this date (use format \"yyyy-MM-dd\" or the new format \"yyyy-MM-dd HH:mm:ss\")")
-    private Date olderThan;
+    @Parameter(name=ApiConstants.END_DATE, type=CommandType.DATE, description="end date range to archive events" +
+            " (including) this date (use format \"yyyy-MM-dd\" or the new format \"yyyy-MM-ddThh:mm:ss\")")
+    private Date endDate;
+
+    @Parameter(name=ApiConstants.START_DATE, type=CommandType.DATE, description="start date range to archive events" +
+            " (including) this date (use format \"yyyy-MM-dd\" or the new format \"yyyy-MM-ddThh:mm:ss\")")
+    private Date startDate;
 
     @Parameter(name = ApiConstants.TYPE, type = CommandType.STRING, description = "archive by event type")
     private String type;
@@ -63,8 +67,12 @@ public class ArchiveEventsCmd extends BaseCmd {
         return ids;
     }
 
-    public Date getOlderThan() {
-        return olderThan;
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public Date getStartDate() {
+        return startDate;
     }
 
     public String getType() {
@@ -91,8 +99,10 @@ public class ArchiveEventsCmd extends BaseCmd {
 
     @Override
     public void execute() {
-        if(ids == null && type == null && olderThan == null) {
-            throw new InvalidParameterValueException("either ids, type or olderthan must be specified");
+        if(ids == null && type == null && endDate == null) {
+            throw new InvalidParameterValueException("either ids, type or enddate must be specified");
+        } else if (startDate != null && endDate == null) {
+            throw new InvalidParameterValueException("enddate must be specified with startdate parameter");
         }
         boolean result = _mgr.archiveEvents(this);
         if (result) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/429e6bd4/api/src/org/apache/cloudstack/api/command/user/event/DeleteEventsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/event/DeleteEventsCmd.java b/api/src/org/apache/cloudstack/api/command/user/event/DeleteEventsCmd.java
index a03e6d9..548c2f3 100644
--- a/api/src/org/apache/cloudstack/api/command/user/event/DeleteEventsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/event/DeleteEventsCmd.java
@@ -48,8 +48,13 @@ public class DeleteEventsCmd extends BaseCmd {
             description = "the IDs of the events")
     private List<Long> ids;
 
-    @Parameter(name=ApiConstants.OLDER_THAN, type=CommandType.DATE, description="delete events older than (including) this date (use format \"yyyy-MM-dd\" or the new format \"yyyy-MM-dd HH:mm:ss\")")
-    private Date olderThan;
+    @Parameter(name=ApiConstants.END_DATE, type=CommandType.DATE, description="end date range to delete events" +
+            " (including) this date (use format \"yyyy-MM-dd\" or the new format \"yyyy-MM-ddThh:mm:ss\")")
+    private Date endDate;
+
+    @Parameter(name=ApiConstants.START_DATE, type=CommandType.DATE, description="start date range to delete events" +
+            " (including) this date (use format \"yyyy-MM-dd\" or the new format \"yyyy-MM-ddThh:mm:ss\")")
+    private Date startDate;
 
     @Parameter(name = ApiConstants.TYPE, type = CommandType.STRING, description = "delete by event type")
     private String type;
@@ -62,8 +67,12 @@ public class DeleteEventsCmd extends BaseCmd {
         return ids;
     }
 
-    public Date getOlderThan() {
-        return olderThan;
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public Date getStartDate() {
+        return startDate;
     }
 
     public String getType() {
@@ -90,8 +99,10 @@ public class DeleteEventsCmd extends BaseCmd {
 
     @Override
     public void execute() {
-        if(ids == null && type == null && olderThan == null) {
+        if(ids == null && type == null && endDate == null) {
             throw new InvalidParameterValueException("either ids, type or enddate must be specified");
+        } else if (startDate != null && endDate == null) {
+            throw new InvalidParameterValueException("enddate must be specified with startdate parameter");
         }
         boolean result = _mgr.deleteEvents(this);
         if (result) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/429e6bd4/engine/schema/src/com/cloud/alert/dao/AlertDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/alert/dao/AlertDao.java b/engine/schema/src/com/cloud/alert/dao/AlertDao.java
index fda814d..1aa1fe0 100755
--- a/engine/schema/src/com/cloud/alert/dao/AlertDao.java
+++ b/engine/schema/src/com/cloud/alert/dao/AlertDao.java
@@ -27,7 +27,7 @@ public interface AlertDao extends GenericDao<AlertVO, Long> {
     // This is for backward compatibility
     AlertVO getLastAlert(short type, long dataCenterId, Long podId);
 
-    public boolean deleteAlert(List<Long> Ids, String type, Date olderThan, Long zoneId);
-    public boolean archiveAlert(List<Long> Ids, String type, Date olderThan, Long zoneId);
+    public boolean deleteAlert(List<Long> Ids, String type, Date startDate, Date endDate, Long zoneId);
+    public boolean archiveAlert(List<Long> Ids, String type, Date startDate, Date endDate, Long zoneId);
     public List<AlertVO> listOlderAlerts(Date oldTime);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/429e6bd4/engine/schema/src/com/cloud/alert/dao/AlertDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/alert/dao/AlertDaoImpl.java b/engine/schema/src/com/cloud/alert/dao/AlertDaoImpl.java
index 18115a5..7c0a562 100755
--- a/engine/schema/src/com/cloud/alert/dao/AlertDaoImpl.java
+++ b/engine/schema/src/com/cloud/alert/dao/AlertDaoImpl.java
@@ -41,7 +41,8 @@ public class AlertDaoImpl extends GenericDaoBase<AlertVO, Long> implements Alert
         AlertSearchByIdsAndType = createSearchBuilder();
         AlertSearchByIdsAndType.and("id", AlertSearchByIdsAndType.entity().getId(), Op.IN);
         AlertSearchByIdsAndType.and("type", AlertSearchByIdsAndType.entity().getType(), Op.EQ);
-        AlertSearchByIdsAndType.and("createdDateL", AlertSearchByIdsAndType.entity().getCreatedDate(), Op.LT);
+        AlertSearchByIdsAndType.and("createdDateB", AlertSearchByIdsAndType.entity().getCreatedDate(), Op.BETWEEN);
+        AlertSearchByIdsAndType.and("createdDateL", AlertSearchByIdsAndType.entity().getCreatedDate(), Op.LTEQ);
         AlertSearchByIdsAndType.and("data_center_id", AlertSearchByIdsAndType.entity().getDataCenterId(), Op.EQ);
         AlertSearchByIdsAndType.and("archived", AlertSearchByIdsAndType.entity().getArchived(), Op.EQ);
         AlertSearchByIdsAndType.done();
@@ -89,7 +90,7 @@ public class AlertDaoImpl extends GenericDaoBase<AlertVO, Long> implements Alert
     }
 
     @Override
-    public boolean archiveAlert(List<Long> Ids, String type, Date olderThan, Long zoneId) {
+    public boolean archiveAlert(List<Long> Ids, String type, Date startDate, Date endDate, Long zoneId) {
         SearchCriteria<AlertVO> sc = AlertSearchByIdsAndType.create();
 
         if (Ids != null) {
@@ -101,8 +102,10 @@ public class AlertDaoImpl extends GenericDaoBase<AlertVO, Long> implements Alert
         if(zoneId != null) {
             sc.setParameters("data_center_id", zoneId);
         }
-        if(olderThan != null) {
-            sc.setParameters("createdDateL", olderThan);
+        if (startDate != null && endDate != null) {
+            sc.setParameters("createdDateB", startDate, endDate);
+        } else if (endDate != null) {
+            sc.setParameters("createdDateL", endDate);
         }
         sc.setParameters("archived", false);
 
@@ -112,20 +115,22 @@ public class AlertDaoImpl extends GenericDaoBase<AlertVO, Long> implements Alert
             result = false;
             return result;
         }
-        Transaction txn = Transaction.currentTxn();
-        txn.start();
-        for (AlertVO alert : alerts) {
-            alert = lockRow(alert.getId(), true);
-            alert.setArchived(true);
-            update(alert.getId(), alert);
-            txn.commit();
+        if (alerts != null && !alerts.isEmpty()) {
+            Transaction txn = Transaction.currentTxn();
+            txn.start();
+            for (AlertVO alert : alerts) {
+                alert = lockRow(alert.getId(), true);
+                alert.setArchived(true);
+                update(alert.getId(), alert);
+                txn.commit();
+            }
+            txn.close();
         }
-        txn.close();
         return result;
     }
 
     @Override
-    public boolean deleteAlert(List<Long> ids, String type, Date olderThan, Long zoneId) {
+    public boolean deleteAlert(List<Long> ids, String type, Date startDate, Date endDate, Long zoneId) {
         SearchCriteria<AlertVO> sc = AlertSearchByIdsAndType.create();
 
         if (ids != null) {
@@ -137,8 +142,10 @@ public class AlertDaoImpl extends GenericDaoBase<AlertVO, Long> implements Alert
         if(zoneId != null) {
             sc.setParameters("data_center_id", zoneId);
         }
-        if(olderThan != null) {
-            sc.setParameters("createdDateL", olderThan);
+        if (startDate != null && endDate != null) {
+            sc.setParameters("createdDateB", startDate, endDate);
+        } else if (endDate != null) {
+            sc.setParameters("createdDateL", endDate);
         }
         sc.setParameters("archived", false);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/429e6bd4/engine/schema/src/com/cloud/event/dao/EventDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/event/dao/EventDao.java b/engine/schema/src/com/cloud/event/dao/EventDao.java
index 9454ce7..c50451b 100644
--- a/engine/schema/src/com/cloud/event/dao/EventDao.java
+++ b/engine/schema/src/com/cloud/event/dao/EventDao.java
@@ -31,7 +31,7 @@ public interface EventDao extends GenericDao<EventVO, Long> {
 
     EventVO findCompletedEvent(long startId);
 
-    public List<EventVO> listToArchiveOrDeleteEvents(List<Long> ids, String type, Date olderThan, List<Long> accountIds);
+    public List<EventVO> listToArchiveOrDeleteEvents(List<Long> ids, String type, Date startDate, Date endDate, List<Long> accountIds);
 
     public void archiveEvents(List<EventVO> events);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/429e6bd4/engine/schema/src/com/cloud/event/dao/EventDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/event/dao/EventDaoImpl.java b/engine/schema/src/com/cloud/event/dao/EventDaoImpl.java
index cefe107..e5615db 100644
--- a/engine/schema/src/com/cloud/event/dao/EventDaoImpl.java
+++ b/engine/schema/src/com/cloud/event/dao/EventDaoImpl.java
@@ -51,7 +51,8 @@ public class EventDaoImpl extends GenericDaoBase<EventVO, Long> implements Event
         ToArchiveOrDeleteEventSearch.and("id", ToArchiveOrDeleteEventSearch.entity().getId(), Op.IN);
         ToArchiveOrDeleteEventSearch.and("type", ToArchiveOrDeleteEventSearch.entity().getType(), Op.EQ);
         ToArchiveOrDeleteEventSearch.and("accountIds", ToArchiveOrDeleteEventSearch.entity().getAccountId(), Op.IN);
-        ToArchiveOrDeleteEventSearch.and("createDateL", ToArchiveOrDeleteEventSearch.entity().getCreateDate(), Op.LT);
+        ToArchiveOrDeleteEventSearch.and("createdDateB", ToArchiveOrDeleteEventSearch.entity().getCreateDate(), Op.BETWEEN);
+        ToArchiveOrDeleteEventSearch.and("createdDateL", ToArchiveOrDeleteEventSearch.entity().getCreateDate(), Op.LTEQ);
         ToArchiveOrDeleteEventSearch.and("archived", ToArchiveOrDeleteEventSearch.entity().getArchived(), Op.EQ);
         ToArchiveOrDeleteEventSearch.done();
     }
@@ -80,7 +81,7 @@ public class EventDaoImpl extends GenericDaoBase<EventVO, Long> implements Event
     }
 
     @Override
-    public List<EventVO> listToArchiveOrDeleteEvents(List<Long> ids, String type, Date olderThan, List<Long> accountIds) {
+    public List<EventVO> listToArchiveOrDeleteEvents(List<Long> ids, String type, Date startDate, Date endDate, List<Long> accountIds) {
         SearchCriteria<EventVO> sc = ToArchiveOrDeleteEventSearch.create();
         if (ids != null) {
             sc.setParameters("id", ids.toArray(new Object[ids.size()]));
@@ -88,8 +89,10 @@ public class EventDaoImpl extends GenericDaoBase<EventVO, Long> implements Event
         if (type != null) {
             sc.setParameters("type", type);
         }
-        if (olderThan != null) {
-            sc.setParameters("createDateL", olderThan);
+        if (startDate != null && endDate != null) {
+            sc.setParameters("createdDateB", startDate, endDate);
+        } else if (endDate != null) {
+            sc.setParameters("createdDateL", endDate);
         }
         if (accountIds != null && !accountIds.isEmpty()) {
             sc.setParameters("accountIds", accountIds.toArray(new Object[accountIds.size()]));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/429e6bd4/server/src/com/cloud/api/ApiDispatcher.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java
index b7d08e2..b886256 100755
--- a/server/src/com/cloud/api/ApiDispatcher.java
+++ b/server/src/com/cloud/api/ApiDispatcher.java
@@ -49,6 +49,9 @@ import org.apache.cloudstack.api.InternalIdentity;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.Validate;
+import org.apache.cloudstack.api.command.admin.resource.ArchiveAlertsCmd;
+import org.apache.cloudstack.api.command.admin.resource.DeleteAlertsCmd;
+import org.apache.cloudstack.api.command.admin.resource.ListAlertsCmd;
 import org.apache.cloudstack.api.command.user.event.ArchiveEventsCmd;
 import org.apache.cloudstack.api.command.user.event.DeleteEventsCmd;
 import org.apache.cloudstack.api.command.user.event.ListEventsCmd;
@@ -381,7 +384,11 @@ public class ApiDispatcher {
                 // This piece of code is for maintaining backward compatibility
                 // and support both the date formats(Bug 9724)
                 // Do the date messaging for ListEventsCmd only
-                if (cmdObj instanceof ListEventsCmd || cmdObj instanceof DeleteEventsCmd || cmdObj instanceof ArchiveEventsCmd) {
+                if (cmdObj instanceof ListEventsCmd || cmdObj instanceof DeleteEventsCmd
+                        || cmdObj instanceof ArchiveEventsCmd
+                        || cmdObj instanceof ArchiveAlertsCmd
+                        || cmdObj instanceof DeleteAlertsCmd
+                        ) {
                     boolean isObjInNewDateFormat = isObjInNewDateFormat(paramObj.toString());
                     if (isObjInNewDateFormat) {
                         DateFormat newFormat = BaseCmd.NEW_INPUT_FORMAT;
@@ -396,8 +403,6 @@ public class ApiDispatcher {
                                 date = messageDate(date, 0, 0, 0);
                             } else if (field.getName().equals("endDate")) {
                                 date = messageDate(date, 23, 59, 59);
-                            } else if (field.getName().equals("olderThan")) {
-                                date = messageDate(date, 0, 0, 0);
                             }
                             field.set(cmdObj, date);
                         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/429e6bd4/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 7795bb3..a0b9daa 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -848,7 +848,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
             permittedAccountIds = _accountDao.getAccountIdsForDomains(permittedDomainIds);
         }
 
-        List<EventVO> events = _eventDao.listToArchiveOrDeleteEvents(ids, cmd.getType(), cmd.getOlderThan(), permittedAccountIds);
+        List<EventVO> events = _eventDao.listToArchiveOrDeleteEvents(ids, cmd.getType(), cmd.getStartDate(), cmd.getEndDate(), permittedAccountIds);
         ControlledEntity[] sameOwnerEvents = events.toArray(new ControlledEntity[events.size()]);
         _accountMgr.checkAccess(UserContext.current().getCaller(), null, true, sameOwnerEvents);
 
@@ -875,7 +875,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
             permittedAccountIds = _accountDao.getAccountIdsForDomains(permittedDomainIds);
         }
 
-        List<EventVO> events = _eventDao.listToArchiveOrDeleteEvents(ids, cmd.getType(), cmd.getOlderThan(), permittedAccountIds);
+        List<EventVO> events = _eventDao.listToArchiveOrDeleteEvents(ids, cmd.getType(), cmd.getStartDate(), cmd.getEndDate(), permittedAccountIds);
         ControlledEntity[] sameOwnerEvents = events.toArray(new ControlledEntity[events.size()]);
         _accountMgr.checkAccess(UserContext.current().getCaller(), null, true, sameOwnerEvents);
 
@@ -2236,14 +2236,14 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
     @Override
     public boolean archiveAlerts(ArchiveAlertsCmd cmd) {
         Long zoneId = _accountMgr.checkAccessAndSpecifyAuthority(UserContext.current().getCaller(), null);
-        boolean result = _alertDao.archiveAlert(cmd.getIds(), cmd.getType(), cmd.getOlderThan(), zoneId);
+        boolean result = _alertDao.archiveAlert(cmd.getIds(), cmd.getType(), cmd.getStartDate(), cmd.getEndDate(), zoneId);
         return result;
     }
 
     @Override
     public boolean deleteAlerts(DeleteAlertsCmd cmd) {
         Long zoneId = _accountMgr.checkAccessAndSpecifyAuthority(UserContext.current().getCaller(), null);
-        boolean result = _alertDao.deleteAlert(cmd.getIds(), cmd.getType(), cmd.getOlderThan(), zoneId);
+        boolean result = _alertDao.deleteAlert(cmd.getIds(), cmd.getType(), cmd.getStartDate(), cmd.getEndDate(), zoneId);
         return result;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/429e6bd4/server/test/com/cloud/alert/AlertControlsUnitTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/alert/AlertControlsUnitTest.java b/server/test/com/cloud/alert/AlertControlsUnitTest.java
index c1e4c54..2b30246 100644
--- a/server/test/com/cloud/alert/AlertControlsUnitTest.java
+++ b/server/test/com/cloud/alert/AlertControlsUnitTest.java
@@ -53,8 +53,8 @@ public class AlertControlsUnitTest extends TestCase {
         _mgmtServer._alertDao = _alertDao;
         _mgmtServer._accountMgr = _accountMgr;
         doReturn(3L).when(_accountMgr).checkAccessAndSpecifyAuthority(any(Account.class), anyLong());
-        when(_alertDao.archiveAlert(anyList(), anyString(), any(Date.class), anyLong())).thenReturn(true);
-        when(_alertDao.deleteAlert(anyList(), anyString(), any(Date.class), anyLong())).thenReturn(true);
+        when(_alertDao.archiveAlert(anyList(), anyString(), any(Date.class), any(Date.class), anyLong())).thenReturn(true);
+        when(_alertDao.deleteAlert(anyList(), anyString(), any(Date.class), any(Date.class), anyLong())).thenReturn(true);
     }
 
     @After
@@ -72,12 +72,12 @@ public class AlertControlsUnitTest extends TestCase {
     protected void archiveAlerts() {
         // archive alerts
         String msg = "Archive Alerts: TEST FAILED";
-        assertNotNull(msg, _mgmtServer._alertDao.archiveAlert(null, "system alert",null, 2L));
+        assertNotNull(msg, _mgmtServer._alertDao.archiveAlert(null, "system alert",null, null, 2L));
     }
 
     protected void deleteAlerts() {
         // delete alerts
         String msg = "Delete Alerts: TEST FAILED";
-        assertNotNull(msg, _mgmtServer._alertDao.deleteAlert(null, "system alert",null, 2L));
+        assertNotNull(msg, _mgmtServer._alertDao.deleteAlert(null, "system alert",null, null, 2L));
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/429e6bd4/server/test/com/cloud/event/EventControlsUnitTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/event/EventControlsUnitTest.java b/server/test/com/cloud/event/EventControlsUnitTest.java
index e2a86cd..f9003a9 100644
--- a/server/test/com/cloud/event/EventControlsUnitTest.java
+++ b/server/test/com/cloud/event/EventControlsUnitTest.java
@@ -57,7 +57,7 @@ public class EventControlsUnitTest extends TestCase{
         _mgmtServer._eventDao = _eventDao;
         _mgmtServer._accountMgr = _accountMgr;
         doNothing().when(_accountMgr).checkAccess(any(Account.class), any(AccessType.class), any(Boolean.class), any(ControlledEntity.class));
-        when(_eventDao.listToArchiveOrDeleteEvents(anyList(), anyString(), any(Date.class), anyList())).thenReturn(_events);
+        when(_eventDao.listToArchiveOrDeleteEvents(anyList(), anyString(), any(Date.class), any(Date.class), anyList())).thenReturn(_events);
     }
 
     @After


[11/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3436: Fix inconsistent ip routing table between redundant virtual routers


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

Branch: refs/heads/sdnextensions
Commit: 9de2034832586afc0eef0fa82032d9d74620e9b8
Parents: 56da71e
Author: Sheng Yang <sh...@citrix.com>
Authored: Wed Jul 10 15:53:31 2013 -0700
Committer: Sheng Yang <sh...@citrix.com>
Committed: Wed Jul 10 15:54:39 2013 -0700

----------------------------------------------------------------------
 .../debian/config/opt/cloud/bin/ipassoc.sh      |  8 +++----
 patches/systemvm/debian/config/root/func.sh     | 23 ++++++++++++++++++++
 2 files changed, 27 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9de20348/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh
----------------------------------------------------------------------
diff --git a/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh b/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh
index d23ec00..9efae26 100755
--- a/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh
+++ b/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh
@@ -106,8 +106,8 @@ remove_routing() {
   local tableNo=$(echo $ethDev | awk -F'eth' '{print $2}')
 
   local tableName="Table_$ethDev"
-  local ethMask=$(ip route list scope link dev $ethDev | awk '{print $1}')
-  if [ "$ethMask" == "" ]
+  local remainip=`ip addr show $ethDev | grep "inet "`
+  if [ "$remainip" == "" ]
   then
 # rules and routes will be deleted for the last ip of the interface.
      sudo ip rule delete fwmark $tableNo table $tableName
@@ -125,7 +125,7 @@ copy_routes_from_main() {
 #get the network masks from the main table
   local eth0Mask=$(ip route list scope link dev eth0 | awk '{print $1}')
   local eth1Mask=$(ip route list scope link dev eth1 | awk '{print $1}')
-  local ethMask=$(ip route list scope link dev $ethDev  | awk '{print $1}')
+  local ethMask=$(getcidr $ethDev)
 
 # eth0,eth1 and other know routes will be skipped, so as main routing table will decide the route. This will be useful if the interface is down and up.  
   sudo ip route add throw $eth0Mask table $tableName proto static 
@@ -164,7 +164,7 @@ add_routing() {
   sudo ip route add default via $defaultGwIP table $tableName proto static
   sudo ip route flush cache
 
-  local ethMask=$(ip route list scope link dev $ethDev  | awk '{print $1}')
+  local ethMask=$(getcidr $ethDev)
   local rulePresent=$(ip rule show | grep $ethMask)
   if [ "$rulePresent" == "" ]
   then

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9de20348/patches/systemvm/debian/config/root/func.sh
----------------------------------------------------------------------
diff --git a/patches/systemvm/debian/config/root/func.sh b/patches/systemvm/debian/config/root/func.sh
index 8cc9608..9c7c494 100644
--- a/patches/systemvm/debian/config/root/func.sh
+++ b/patches/systemvm/debian/config/root/func.sh
@@ -95,3 +95,26 @@ unlock_exit() {
     exit $1
 }
 
+# calcuate the ip & network mask
+rangecalc(){
+    local IFS='.'
+    local -a oct mask ip
+
+    read -ra oct <<<"$1"
+    read -ra mask <<<"$2"
+    for i in {0..3}
+    do
+        ip+=( "$(( oct[i] & mask[i] ))" )
+    done
+    echo "${ip[*]}"
+}
+
+#get cidr of the nic
+getcidr(){
+    local dev=$1
+    local mask=`ifconfig $dev|grep "Mask"|cut -d ":" -f 4`
+    local cidrsize=`ip addr show $dev|grep inet|head -n 1|awk '{print $2}'|cut -d '/' -f 2`
+    local ipaddr=`ip addr show $dev|grep inet|head -n 1|awk '{print $2}'|cut -d '/' -f 1`
+    local base=$(rangecalc $ipaddr $mask)
+    echo $base/$cidrsize
+}


[22/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-1815


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

Branch: refs/heads/sdnextensions
Commit: 9b294ad0d76352801b30fcb13e68c0e19d40bc71
Parents: 9dd4caf
Author: radhikap <ra...@citrix.com>
Authored: Thu Jul 11 11:19:54 2013 +0530
Committer: radhikap <ra...@citrix.com>
Committed: Thu Jul 11 11:19:54 2013 +0530

----------------------------------------------------------------------
 docs/en-US/management-server-install-flow.xml | 28 +++++++++++++---------
 1 file changed, 17 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9b294ad0/docs/en-US/management-server-install-flow.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/management-server-install-flow.xml b/docs/en-US/management-server-install-flow.xml
index cf14857..cd73c69 100644
--- a/docs/en-US/management-server-install-flow.xml
+++ b/docs/en-US/management-server-install-flow.xml
@@ -21,16 +21,22 @@
  specific language governing permissions and limitations
  under the License.
 -->
-
 <section id="management-server-install-flow">
-    <title>Management Server Installation</title>
-    <xi:include href="management-server-install-overview.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-    <xi:include href="management-server-install-prepare-os.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-    <xi:include href="management-server-install-client.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-    <xi:include href="management-server-install-db.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-    <xi:include href="about-password-encryption.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-    <xi:include href="management-server-install-nfs-shares.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-    <xi:include href="management-server-install-multi-node.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-    <xi:include href="management-server-install-systemvm.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-    <xi:include href="management-server-install-complete.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+  <title>Management Server Installation</title>
+  <xi:include href="management-server-install-overview.xml"
+    xmlns:xi="http://www.w3.org/2001/XInclude"/>
+  <xi:include href="management-server-install-prepare-os.xml"
+    xmlns:xi="http://www.w3.org/2001/XInclude"/>
+  <xi:include href="management-server-install-client.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+  <xi:include href="management-server-install-db.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+  <xi:include href="about-password-encryption.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+  <xi:include href="password-storage-engine.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+  <xi:include href="management-server-install-nfs-shares.xml"
+    xmlns:xi="http://www.w3.org/2001/XInclude"/>
+  <xi:include href="management-server-install-multi-node.xml"
+    xmlns:xi="http://www.w3.org/2001/XInclude"/>
+  <xi:include href="management-server-install-systemvm.xml"
+    xmlns:xi="http://www.w3.org/2001/XInclude"/>
+  <xi:include href="management-server-install-complete.xml"
+    xmlns:xi="http://www.w3.org/2001/XInclude"/>
 </section>


[15/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3384: Fix the vlan range < 4096

VLAN ranges beyond 4095 are properly handled. Fix the test to accomdate
this change

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/3f5c1c6d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3f5c1c6d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3f5c1c6d

Branch: refs/heads/sdnextensions
Commit: 3f5c1c6da3d2152fdc966603f929c3ea880d8b60
Parents: 742bc8d
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Thu Jul 11 09:41:17 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Thu Jul 11 09:41:17 2013 +0530

----------------------------------------------------------------------
 test/integration/smoke/test_non_contigiousvlan.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3f5c1c6d/test/integration/smoke/test_non_contigiousvlan.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_non_contigiousvlan.py b/test/integration/smoke/test_non_contigiousvlan.py
index 4e130d9..5fdc034 100644
--- a/test/integration/smoke/test_non_contigiousvlan.py
+++ b/test/integration/smoke/test_non_contigiousvlan.py
@@ -26,8 +26,8 @@ class Services():
     def __init__(self):
         self.services = {
             "vlan": {
-                "part": ["4090-4091", "4092-4096"],
-                "full": "4090-4096",
+                "part": ["4090-4091", "4092-4095"],
+                "full": "4090-4095",
             }
         }
 


[43/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3395: Fix typo in 'revert to VM snapshot' response


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

Branch: refs/heads/sdnextensions
Commit: 62823a292edda1d85681206f9359c87715a37843
Parents: 6eeea70
Author: Brian Federle <br...@citrix.com>
Authored: Thu Jul 11 14:44:52 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Thu Jul 11 14:44:52 2013 -0700

----------------------------------------------------------------------
 ui/scripts/vm_snapshots.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/62823a29/ui/scripts/vm_snapshots.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vm_snapshots.js b/ui/scripts/vm_snapshots.js
index 190bf75..c50c7e1 100644
--- a/ui/scripts/vm_snapshots.js
+++ b/ui/scripts/vm_snapshots.js
@@ -174,7 +174,7 @@
                 dataType: "json",
                 async: true,
                 success: function(json) {
-                  var jid = json.reverttosnapshotresponse.jobid;
+                  var jid = json.reverttovmsnapshotresponse.jobid;
                   args.response.success({
                     _custom: {
                       jobId: jid
@@ -193,4 +193,4 @@
       //detailview end
     }
   }
-})(jQuery, cloudStack);
\ No newline at end of file
+})(jQuery, cloudStack);


[09/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-2988: UI > instances menu > Update Instance action - add Dynamically Scalable field.


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

Branch: refs/heads/sdnextensions
Commit: 18b17fc54daeab2b94818f537a887ea17ae44695
Parents: ef7d274
Author: Jessica Wang <je...@apache.org>
Authored: Wed Jul 10 15:31:25 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Wed Jul 10 15:33:58 2013 -0700

----------------------------------------------------------------------
 ui/scripts/instances.js | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/18b17fc5/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index f905fa4..7928c68 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -726,6 +726,7 @@
 						  var data = {
 							  id: args.context.instances[0].id,
 							  group: args.data.group,
+							  isdynamicallyscalable: (args.data.isdynamicallyscalable=="on"),
 								ostypeid: args.data.guestosid
 							};
 						  
@@ -1366,9 +1367,16 @@
 										});	
                     return toClearInterval;										
 									}								
-								},                       
-                hypervisor: { label: 'label.hypervisor' },
+								},        
                 templatename: { label: 'label.template' },
+                
+                isdynamicallyscalable: {
+                  label: 'Dynamically Scalable',
+                  isBoolean: true,
+                  isEditable: true,
+                  converter:cloudStack.converters.toBooleanText
+                },    
+                
                 guestosid: {
                   label: 'label.os.type',
                   isEditable: true,
@@ -1388,7 +1396,9 @@
                     });
                   }
                 },              
-                                
+                 
+                hypervisor: { label: 'label.hypervisor' },
+                
                 /*
 								isoid: {
                   label: 'label.attached.iso',


[13/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
[DOC]Change cloud- to cloudstack- for the service and fix script path issue
CLOUDSTACK-3179,CLOUDSTACK-3180

Conflicts:

	docs/en-US/Release_Notes.xml
	docs/en-US/citrix-xenserver-installation.xml


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

Branch: refs/heads/sdnextensions
Commit: 63206d601af9afc0f1001eb23e14ff75e0db62b9
Parents: 73cd064
Author: Gavin Lee <ga...@gmail.com>
Authored: Tue Jul 9 18:02:32 2013 +0800
Committer: Gavin Lee <ga...@gmail.com>
Committed: Thu Jul 11 10:51:46 2013 +0800

----------------------------------------------------------------------
 docs/en-US/citrix-xenserver-installation.xml        | 12 ++++++------
 docs/en-US/first_ms_node_install.xml                |  4 ++--
 docs/en-US/host-add-xenserver-kvm-ovm.xml           |  2 +-
 docs/en-US/management-server-install-client.xml     |  2 +-
 docs/en-US/management-server-install-multi-node.xml |  6 ++----
 docs/en-US/management-server-install-systemvm.xml   |  2 +-
 6 files changed, 13 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63206d60/docs/en-US/citrix-xenserver-installation.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/citrix-xenserver-installation.xml b/docs/en-US/citrix-xenserver-installation.xml
index 9ea632a..a50b9bc 100644
--- a/docs/en-US/citrix-xenserver-installation.xml
+++ b/docs/en-US/citrix-xenserver-installation.xml
@@ -555,7 +555,7 @@ master-password=[your password]</programlisting>
         <orderedlist>
           <listitem>
             <para>Copy the script from the Management Server in
-              /usr/lib64/cloud/common/scripts/vm/hypervisor/xenserver/cloud-setup-bonding.sh to the
+              /usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver/cloud-setup-bonding.sh to the
               master host and ensure it is executable.</para>
           </listitem>
           <listitem>
@@ -614,7 +614,7 @@ master-password=[your password]</programlisting>
             <para>Restart the Management Server and Usage Server. You only need to do this once for
               all clusters.</para>
             <programlisting># service cloudstack-management start
-# service cloud-usage start</programlisting>
+# service cloudstack-usage start</programlisting>
           </listitem>
         </orderedlist>
       </listitem>
@@ -679,19 +679,19 @@ vm: b6cf79c8-02ee-050b-922f-49583d9f1a14 (i-2-8-VM)</programlisting>
                 </thead>
                 <tbody>
                   <row>
-                    <entry><para>/usr/lib64/cloud/common/scripts/vm/hypervisor/xenserver/xenserver60/NFSSR.py</para></entry>
+                    <entry><para>/usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver/xenserver60/NFSSR.py</para></entry>
                     <entry><para>/opt/xensource/sm/NFSSR.py</para></entry>
                   </row>
                   <row>
-                    <entry><para>/usr/lib64/cloud/common/scripts/vm/hypervisor/xenserver/setupxenserver.sh</para></entry>
+                    <entry><para>/usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver/setupxenserver.sh</para></entry>
                     <entry><para>/opt/xensource/bin/setupxenserver.sh</para></entry>
                   </row>
                   <row>
-                    <entry><para>/usr/lib64/cloud/common/scripts/vm/hypervisor/xenserver/make_migratable.sh</para></entry>
+                    <entry><para>/usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver/make_migratable.sh</para></entry>
                     <entry><para>/opt/xensource/bin/make_migratable.sh</para></entry>
                   </row>
                   <row>
-                    <entry><para>/usr/lib64/cloud/common/scripts/vm/hypervisor/xenserver/cloud-clean-vlan.sh</para></entry>
+                    <entry><para>/usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver/cloud-clean-vlan.sh</para></entry>
                     <entry><para>/opt/xensource/bin/cloud-clean-vlan.sh</para></entry>
                   </row>
                 </tbody>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63206d60/docs/en-US/first_ms_node_install.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/first_ms_node_install.xml b/docs/en-US/first_ms_node_install.xml
index 3c3e51a..af6b35b 100644
--- a/docs/en-US/first_ms_node_install.xml
+++ b/docs/en-US/first_ms_node_install.xml
@@ -38,8 +38,8 @@
                     <para>
                         Install the &PRODUCT; management server packages by
                         issuing one of the following commands as appropriate: 
-                        <programlisting><prompt>#</prompt> <command>yum</command> install cloud-client</programlisting>
-                        <programlisting><prompt>#</prompt> <command>apt-get</command> install cloud-client</programlisting>
+                        <programlisting><prompt>#</prompt> <command>yum</command> install cloudstack-management</programlisting>
+                        <programlisting><prompt>#</prompt> <command>apt-get</command> install cloudstack-management</programlisting>
                     </para>
                 </listitem>          
                 <listitem>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63206d60/docs/en-US/host-add-xenserver-kvm-ovm.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/host-add-xenserver-kvm-ovm.xml b/docs/en-US/host-add-xenserver-kvm-ovm.xml
index 6973dbd..91c36ab 100644
--- a/docs/en-US/host-add-xenserver-kvm-ovm.xml
+++ b/docs/en-US/host-add-xenserver-kvm-ovm.xml
@@ -62,7 +62,7 @@
       <orderedlist>
         <listitem>
           <para>Copy the script from the Management Server in
-            /usr/lib64/cloud/common/scripts/vm/hypervisor/xenserver/cloud-setup-bonding.sh to the
+            /usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver/cloud-setup-bonding.sh to the
             master host and ensure it is executable.</para>
         </listitem>
         <listitem>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63206d60/docs/en-US/management-server-install-client.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/management-server-install-client.xml b/docs/en-US/management-server-install-client.xml
index 1796142..2c5ded7 100644
--- a/docs/en-US/management-server-install-client.xml
+++ b/docs/en-US/management-server-install-client.xml
@@ -48,6 +48,6 @@
     <para>If the Management Server is RHEL or CentOS, copy vhd-util to
       /usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver.</para>
     <para>If the Management Server is Ubuntu, copy vhd-util to
-      /usr/lib/cloud/common/scripts/vm/hypervisor/xenserver.</para>
+      /usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver.</para>
   </section>
 </section>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63206d60/docs/en-US/management-server-install-multi-node.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/management-server-install-multi-node.xml b/docs/en-US/management-server-install-multi-node.xml
index ae925bf..480d84e 100644
--- a/docs/en-US/management-server-install-multi-node.xml
+++ b/docs/en-US/management-server-install-multi-node.xml
@@ -35,10 +35,8 @@ linkend="sect-source-buildrpm"/> or <xref linkend="sect-source-builddebs"/> as
       <para>This step is required only for installations where XenServer is installed on the hypervisor hosts.</para>
       <para>Download vhd-util from <ulink
           url="http://download.cloud.com.s3.amazonaws.com/tools/vhd-util">vhd-util</ulink></para>
-      <para>If the Management Server is RHEL or CentOS, copy vhd-util to
-        /usr/lib64/cloud/common/scripts/vm/hypervisor/xenserver.</para>
-      <para>If the Management Server is Ubuntu, copy vhd-util to
-        /usr/lib/cloud/common/scripts/vm/hypervisor/xenserver/vhd-util.</para>
+      <para>Copy vhd-util to
+        /usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver.</para>
     </listitem>
     <listitem>
       <para> Ensure that necessary services are started and set to start on boot.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63206d60/docs/en-US/management-server-install-systemvm.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/management-server-install-systemvm.xml b/docs/en-US/management-server-install-systemvm.xml
index 928b956..0d930ad 100644
--- a/docs/en-US/management-server-install-systemvm.xml
+++ b/docs/en-US/management-server-install-systemvm.xml
@@ -59,7 +59,7 @@
         </listitem>
       </itemizedlist>
       <para>On Ubuntu, use the following path instead:</para>
-      <programlisting># /usr/lib/cloud/common/scripts/storage/secondary/cloud-install-sys-tmplt</programlisting>
+      <programlisting># /usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt</programlisting>
     </listitem>
     <listitem>
       <para>If you are using a separate NFS server, perform this step. If you are using the


[21/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-1815


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

Branch: refs/heads/sdnextensions
Commit: 9dd4caf806967b8adbcc89ae262ce85425445272
Parents: 8bd1d27
Author: radhikap <ra...@citrix.com>
Authored: Thu Jul 11 11:05:44 2013 +0530
Committer: radhikap <ra...@citrix.com>
Committed: Thu Jul 11 11:06:11 2013 +0530

----------------------------------------------------------------------
 docs/en-US/password-storage-engine.xml | 38 ++++++++++++++++++++---------
 1 file changed, 26 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9dd4caf8/docs/en-US/password-storage-engine.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/password-storage-engine.xml b/docs/en-US/password-storage-engine.xml
index b1d5340..0566105 100644
--- a/docs/en-US/password-storage-engine.xml
+++ b/docs/en-US/password-storage-engine.xml
@@ -21,21 +21,27 @@
 -->
 <section id="password-storage-engine">
   <title>Changing the Default Password Encryption</title>
-  <para>&PRODUCT; allows you to determine the default encoding and authentication mechanism for
-    admin and user logins. Plain text user authenticator has been changed to do a simple string
-    comparison between retrieved and supplied login passwords instead of comparing the retrieved md5
-    hash of the stored password against the supplied md5 hash of the password because clients no
-    longer hash the password. The following method determines what encoding scheme is used to encode
-    the password supplied during user creation or modification.</para>
+  <para>Passwords are encoded when creating or updating users. &PRODUCT; allows you to determine the
+    default encoding and authentication mechanism for admin and user logins. A new configurable list
+    called <code>UserPasswordEncoders</code> to allow you to separately configure the order of
+    preference for encoding and authentication schemes. </para>
+  <para>Additionally, plain text user authenticator has been changed to use SHA256SALT as the
+    default encoding algorithm because it is more secure compared to MD5 hashing. It does a simple
+    string comparison between retrieved and supplied login passwords instead of comparing the
+    retrieved md5 hash of the stored password against the supplied md5 hash of the password because
+    clients no longer hash the password. The following method determines what encoding scheme is
+    used to encode the password supplied during user creation or modification. </para>
   <para>When a new user is created, the user password is encoded by using the first valid encoder
     loaded as per the sequence specified in the <code>UserPasswordEncoders</code> property in the
       <filename>ComponentContext.xml</filename> or <filename>nonossComponentContext.xml</filename>
     files. The order of authentication schemes is determined by the <code>UserAuthenticators</code>
-    property in the same files. The administrator can change the ordering of both these properties
-    as preferred. When a new authenticator or encoder is added, you can add them to this list. While
-    doing so, ensure that the new authenticator or encoder is specified as a bean in both these
-    files if they are required for both oss and non-oss components. The two properties are listed
-    below:</para>
+    property in the same files. When a new authenticator or encoder is added, you can add them to
+    this list. While doing so, ensure that the new authenticator or encoder is specified as a bean
+    in both these files. The administrator can change the ordering of both these properties as
+    preferred to change the order of schemes. Modify the following list properties available in
+      <filename>client/tomcatconf/nonossComponentContext.xml.in</filename> or
+      <filename>client/tomcatconf/componentContext.xml.in</filename> as applicable, to the desired
+    order:</para>
   <programlisting>&lt;property name="UserAuthenticators"&gt;
          &lt;list&gt;
             &lt;ref bean="SHA256SaltedUserAuthenticator"/&gt;
@@ -50,5 +56,13 @@
              &lt;ref bean="MD5UserAuthenticator"/&gt;
              &lt;ref bean="LDAPUserAuthenticator"/&gt;
             &lt;ref bean="PlainTextUserAuthenticator"/&gt;
-         &lt;/list&gt;</programlisting>
+            &lt;/list&gt;</programlisting>
+  <para>In the above default ordering, SHA256Salt is used first for
+      <code>UserPasswordEncoders</code>. If the module is found and encoding returns a valid value,
+    the encoded password is stored in the user table's password column. If it fails for any reason,
+    the MD5UserAuthenticator will be tried next, and the order continues. For
+      <code>UserAuthenticators</code>, SHA256Salt authentication is tried first. If it succeeds, the
+    user is logged into the Management server. If it fails, MD5 is tried next, and attempts
+    continues until any of them succeeds and the user logs in . If none of them works,  the user is
+    returned an invalid credential message. </para>
 </section>


[35/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3362: use POST instead of GET and encode/decode cert/key in uploadCustomCertificate


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

Branch: refs/heads/sdnextensions
Commit: d2a751fb1e619aa58412a4d22d97d11b6812f0fa
Parents: b903262
Author: Wei Zhou <w....@leaseweb.com>
Authored: Thu Jul 11 16:06:21 2013 +0200
Committer: Wei Zhou <w....@leaseweb.com>
Committed: Thu Jul 11 16:06:21 2013 +0200

----------------------------------------------------------------------
 .../com/cloud/server/ManagementServerImpl.java  | 24 ++++++++++++++++----
 ui/scripts/ui-custom/physicalResources.js       |  5 ++--
 2 files changed, 23 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d2a751fb/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 a0b9daa..36b3879 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -16,7 +16,9 @@
 // under the License.
 package com.cloud.server;
 
+import java.io.UnsupportedEncodingException;
 import java.lang.reflect.Field;
+import java.net.URLDecoder;
 import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
 import java.util.ArrayList;
@@ -3301,18 +3303,32 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
             }
         }
 
-        if (cmd.getPrivateKey() != null && !_ksMgr.validateCertificate(cmd.getCertificate(), cmd.getPrivateKey(), cmd.getDomainSuffix())) {
+        String certificate = cmd.getCertificate();
+        String key = cmd.getPrivateKey();
+        try {
+            if (certificate != null)
+                certificate = URLDecoder.decode(certificate, "UTF-8");
+            if (key != null)
+                key = URLDecoder.decode(key, "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+        } finally {
+        }
+
+        if (cmd.getPrivateKey() != null && !_ksMgr.validateCertificate(certificate, key, cmd.getDomainSuffix())) {
             throw new InvalidParameterValueException("Failed to pass certificate validation check");
         }
 
         if (cmd.getPrivateKey() != null) {
-            _ksMgr.saveCertificate(ConsoleProxyManager.CERTIFICATE_NAME, cmd.getCertificate(), cmd.getPrivateKey(), cmd.getDomainSuffix());
+            _ksMgr.saveCertificate(ConsoleProxyManager.CERTIFICATE_NAME, certificate, key, cmd.getDomainSuffix());
         } else {
-            _ksMgr.saveCertificate(cmd.getAlias(), cmd.getCertificate(), cmd.getCertIndex(), cmd.getDomainSuffix());
+            _ksMgr.saveCertificate(cmd.getAlias(), certificate, cmd.getCertIndex(), cmd.getDomainSuffix());
         }
 
         _consoleProxyMgr.setManagementState(ConsoleProxyManagementState.ResetSuspending);
-        return "Certificate has been updated, we will stop all running console proxy VMs to propagate the new certificate, please give a few minutes for console access service to be up again";
+        List<SecondaryStorageVmVO> alreadyRunning = _secStorageVmDao.getSecStorageVmListInStates(null, State.Running, State.Migrating, State.Starting);
+        for (SecondaryStorageVmVO ssVmVm : alreadyRunning)
+            _secStorageVmMgr.rebootSecStorageVm(ssVmVm.getId());
+        return "Certificate has been updated, we will stop all running console proxy VMs and secondary storage VMs to propagate the new certificate, please give a few minutes for console access service to be up again";
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d2a751fb/ui/scripts/ui-custom/physicalResources.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/physicalResources.js b/ui/scripts/ui-custom/physicalResources.js
index 529adcf..5173172 100644
--- a/ui/scripts/ui-custom/physicalResources.js
+++ b/ui/scripts/ui-custom/physicalResources.js
@@ -80,10 +80,11 @@
             var $loading = $('<div>').addClass('loading-overlay');
             $('.system-dashboard-view:visible').prepend($loading);
             $.ajax({
+              type: "POST",
               url: createURL('uploadCustomCertificate'),
               data: {
-                certificate: args.data.certificate,
-                privatekey: args.data.privatekey,
+                certificate: encodeURIComponent(args.data.certificate),
+                privatekey: encodeURIComponent(args.data.privatekey),
                 domainsuffix: args.data.domainsuffix
               },
               dataType: 'json',


[48/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-2843: added CopyCommand to the list of the commands controlled by execute.in.sequence.hypervisor.commands global config. This command was introduced by the Storage refactoring, and used for volume creation on the primary storage


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

Branch: refs/heads/sdnextensions
Commit: dd91974920c8a8c6b10010aaa95e5ac6987d4c35
Parents: 96d29c7
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Thu Jul 11 17:17:51 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Thu Jul 11 17:44:12 2013 -0700

----------------------------------------------------------------------
 api/src/com/cloud/server/ManagementService.java  |  2 ++
 .../cloudstack/storage/command/CopyCommand.java  |  7 +++++--
 .../motion/AncientDataMotionStrategy.java        | 19 +++++++++++--------
 server/src/com/cloud/configuration/Config.java   |  2 +-
 .../src/com/cloud/server/ManagementServer.java   |  2 --
 setup/db/db/schema-410to420.sql                  |  2 +-
 6 files changed, 20 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dd919749/api/src/com/cloud/server/ManagementService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/server/ManagementService.java b/api/src/com/cloud/server/ManagementService.java
index 8d00ef2..e943a8c 100755
--- a/api/src/com/cloud/server/ManagementService.java
+++ b/api/src/com/cloud/server/ManagementService.java
@@ -371,4 +371,6 @@ public interface ManagementService {
     List<String> listDeploymentPlanners();
 
     VirtualMachine upgradeSystemVM(ScaleSystemVMCmd cmd) throws ResourceUnavailableException, ManagementServerException, VirtualMachineMigrationException, ConcurrentOperationException;
+    
+    boolean getExecuteInSequence();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dd919749/engine/api/src/org/apache/cloudstack/storage/command/CopyCommand.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/command/CopyCommand.java b/engine/api/src/org/apache/cloudstack/storage/command/CopyCommand.java
index 852d801..f14f37e 100644
--- a/engine/api/src/org/apache/cloudstack/storage/command/CopyCommand.java
+++ b/engine/api/src/org/apache/cloudstack/storage/command/CopyCommand.java
@@ -23,12 +23,15 @@ public final class CopyCommand extends Command implements StorageSubSystemComman
     private DataTO srcTO;
     private DataTO destTO;
     private DataTO cacheTO;
+    boolean executeInSequence = false;
 
-    public CopyCommand(DataTO srcData, DataTO destData, int timeout) {
+
+    public CopyCommand(DataTO srcData, DataTO destData, int timeout, boolean executeInSequence) {
         super();
         this.srcTO = srcData;
         this.destTO = destData;
         this.setWait(timeout);
+        this.executeInSequence = executeInSequence;
     }
 
     public DataTO getDestTO() {
@@ -41,7 +44,7 @@ public final class CopyCommand extends Command implements StorageSubSystemComman
 
     @Override
     public boolean executeInSequence() {
-        return true;
+        return executeInSequence;
     }
 
     public DataTO getCacheTO() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dd919749/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
----------------------------------------------------------------------
diff --git a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
index 04d0436..00c693f 100644
--- a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
+++ b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
@@ -59,6 +59,7 @@ import com.cloud.configuration.dao.ConfigurationDao;
 import com.cloud.host.Host;
 import com.cloud.host.dao.HostDao;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.server.ManagementService;
 import com.cloud.storage.DataStoreRole;
 import com.cloud.storage.StorageManager;
 import com.cloud.storage.StoragePool;
@@ -113,6 +114,8 @@ public class AncientDataMotionStrategy implements DataMotionStrategy {
     VolumeManager volumeMgr;
     @Inject
     StorageCacheManager cacheMgr;
+    @Inject
+    ManagementService _mgmtServer;
 
     @Override
     public boolean canHandle(DataObject srcData, DataObject destData) {
@@ -184,7 +187,7 @@ public class AncientDataMotionStrategy implements DataMotionStrategy {
                 srcForCopy = cacheData = cacheMgr.createCacheObject(srcData, destScope);
             }
 
-            CopyCommand cmd = new CopyCommand(srcForCopy.getTO(), destData.getTO(), _primaryStorageDownloadWait);
+            CopyCommand cmd = new CopyCommand(srcForCopy.getTO(), destData.getTO(), _primaryStorageDownloadWait, _mgmtServer.getExecuteInSequence());
             EndPoint ep = selector.select(srcForCopy, destData);
             answer = ep.sendMessage(cmd);
 
@@ -242,7 +245,7 @@ public class AncientDataMotionStrategy implements DataMotionStrategy {
             int _createVolumeFromSnapshotWait = NumbersUtil.parseInt(value,
                     Integer.parseInt(Config.CreateVolumeFromSnapshotWait.getDefaultValue()));
 
-            CopyCommand cmd = new CopyCommand(srcData.getTO(), volObj.getTO(), _createVolumeFromSnapshotWait);
+            CopyCommand cmd = new CopyCommand(srcData.getTO(), volObj.getTO(), _createVolumeFromSnapshotWait, _mgmtServer.getExecuteInSequence());
             EndPoint ep = selector.select(snapObj, volObj);
             Answer answer = ep.sendMessage(cmd);
 
@@ -258,7 +261,7 @@ public class AncientDataMotionStrategy implements DataMotionStrategy {
     }
 
     protected Answer cloneVolume(DataObject template, DataObject volume) {
-        CopyCommand cmd = new CopyCommand(template.getTO(), volume.getTO(), 0);
+        CopyCommand cmd = new CopyCommand(template.getTO(), volume.getTO(), 0, _mgmtServer.getExecuteInSequence());
         try {
             EndPoint ep = selector.select(volume.getDataStore());
             Answer answer = ep.sendMessage(cmd);
@@ -301,7 +304,7 @@ public class AncientDataMotionStrategy implements DataMotionStrategy {
 
             objOnImageStore.processEvent(Event.CopyingRequested);
 
-            CopyCommand cmd = new CopyCommand(objOnImageStore.getTO(), destData.getTO(), _copyvolumewait);
+            CopyCommand cmd = new CopyCommand(objOnImageStore.getTO(), destData.getTO(), _copyvolumewait, _mgmtServer.getExecuteInSequence());
             EndPoint ep = selector.select(objOnImageStore, destData);
             answer = ep.sendMessage(cmd);
 
@@ -319,7 +322,7 @@ public class AncientDataMotionStrategy implements DataMotionStrategy {
             return answer;
         } else {
             DataObject cacheData = cacheMgr.createCacheObject(srcData, destScope);
-            CopyCommand cmd = new CopyCommand(cacheData.getTO(), destData.getTO(), _copyvolumewait);
+            CopyCommand cmd = new CopyCommand(cacheData.getTO(), destData.getTO(), _copyvolumewait, _mgmtServer.getExecuteInSequence());
             EndPoint ep = selector.select(cacheData, destData);
             Answer answer = ep.sendMessage(cmd);
             return answer;
@@ -376,7 +379,7 @@ public class AncientDataMotionStrategy implements DataMotionStrategy {
             srcData = cacheSnapshotChain(snapshot);
         }
 
-        CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _createprivatetemplatefromsnapshotwait);
+        CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _createprivatetemplatefromsnapshotwait, _mgmtServer.getExecuteInSequence());
         EndPoint ep = selector.select(srcData, destData);
         Answer answer = ep.sendMessage(cmd);
         return answer;
@@ -393,12 +396,12 @@ public class AncientDataMotionStrategy implements DataMotionStrategy {
             if (needCacheStorage(srcData, destData)) {
                 cacheData = cacheMgr.getCacheObject(srcData, destData.getDataStore().getScope());
 
-                CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _backupsnapshotwait);
+                CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _backupsnapshotwait, _mgmtServer.getExecuteInSequence());
                 cmd.setCacheTO(cacheData.getTO());
                 EndPoint ep = selector.select(srcData, destData);
                 answer = ep.sendMessage(cmd);
             } else {
-                CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _backupsnapshotwait);
+                CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _backupsnapshotwait, _mgmtServer.getExecuteInSequence());
                 EndPoint ep = selector.select(srcData, destData);
                 answer = ep.sendMessage(cmd);
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dd919749/server/src/com/cloud/configuration/Config.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java
index d3ed718..e77f6ce 100755
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java
@@ -432,7 +432,7 @@ public enum Config {
 	           "routes", ConfigurationParameterScope.zone.toString()),
 	
     InternalLbVmServiceOfferingId("Advanced", ManagementServer.class, String.class, "internallbvm.service.offering", null, "Uuid of the service offering used by internal lb vm; if NULL - default system internal lb offering will be used", null),
-    ExecuteInSequence("Advanced", ManagementServer.class, Boolean.class, "execute.in.sequence.hypervisor.commands", "false", "If set to true, StartCommand, StopCommand, CopyVolumeCommand, CreateCommand will be synchronized on the agent side." +
+    ExecuteInSequence("Advanced", ManagementServer.class, Boolean.class, "execute.in.sequence.hypervisor.commands", "false", "If set to true, StartCommand, StopCommand, CopyCommand will be synchronized on the agent side." +
     		" If set to false, these commands become asynchronous. Default value is false.", null),
     ExecuteInSequenceNetworkElementCommands("Advanced", NetworkManager.class, Boolean.class, "execute.in.sequence.network.element.commands", "false", "If set to true, DhcpEntryCommand, SavePasswordCommand, UserDataCommand, VmDataCommand will be synchronized on the agent side." + 
             " If set to false, these commands become asynchronous. Default value is false.", null);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dd919749/server/src/com/cloud/server/ManagementServer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServer.java b/server/src/com/cloud/server/ManagementServer.java
index aec1be7..f60ce48 100755
--- a/server/src/com/cloud/server/ManagementServer.java
+++ b/server/src/com/cloud/server/ManagementServer.java
@@ -72,6 +72,4 @@ public interface ManagementServer extends ManagementService, PluggableService  {
     String getEncryptionIV();
     void resetEncryptionKeyIV();
 
-    boolean getExecuteInSequence();
-
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dd919749/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 1e9c201..b48ae6a 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -2153,7 +2153,7 @@ UPDATE `cloud`.`networks` set name='Shared SG enabled network', display_text='Sh
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'use.system.public.ips', 'true', 'If true, when account has dedicated public ip range(s), once the ips dedicated to the account have been consumed ips will be acquired from the system pool');
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'use.system.guest.vlans', 'true', 'If true, when account has dedicated guest vlan range(s), once the vlans dedicated to the account have been consumed vlans will be allocated from the system pool');
 
-INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'execute.in.sequence.hypervisor.commands', 'false', 'If set to true, StartCommand, StopCommand, CopyVolumeCommand, CreateCommand will be synchronized on the agent side. If set to false, these commands become asynchronous. Default value is false.');
+INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'execute.in.sequence.hypervisor.commands', 'false', 'If set to true, StartCommand, StopCommand, CopyCommand will be synchronized on the agent side. If set to false, these commands become asynchronous. Default value is false.');
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'execute.in.sequence.network.element.commands', 'false', 'If set to true, DhcpEntryCommand, SavePasswordCommand, UserDataCommand, VmDataCommand will be synchronized on the agent side. If set to false, these commands become asynchronous. Default value is false.');
 
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'direct.agent.scan.interval', 90, 'Time interval (in seconds) to run the direct agent scan task.');


[47/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
Added the git commit and branch to war file


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

Branch: refs/heads/sdnextensions
Commit: 96d29c7f3de5b6ad52aaecd633f9b0ef80aae7a0
Parents: e93ef73
Author: ahuang <al...@citrix.com>
Authored: Thu Jul 11 17:33:12 2013 -0700
Committer: ahuang <al...@citrix.com>
Committed: Thu Jul 11 17:33:31 2013 -0700

----------------------------------------------------------------------
 client/pom.xml | 220 +++++++++++++++++++++++++++++-----------------------
 pom.xml        |  14 ----
 server/pom.xml |   4 +-
 3 files changed, 123 insertions(+), 115 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96d29c7f/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index aa67f7f..32ab94a 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -1,13 +1,12 @@
 <!-- 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. -->
+  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>
@@ -44,7 +43,7 @@
       <groupId>org.apache.cloudstack</groupId>
       <artifactId>cloud-plugin-api-limit-account-based</artifactId>
       <version>${project.version}</version>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>org.apache.cloudstack</groupId>
       <artifactId>cloud-plugin-api-discovery</artifactId>
@@ -121,9 +120,9 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
-       <groupId>org.apache.cloudstack</groupId>
-       <artifactId>cloud-plugin-hypervisor-ovm</artifactId>
-       <version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-plugin-hypervisor-ovm</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.cloudstack</groupId>
@@ -178,96 +177,96 @@
       <scope>runtime</scope>
     </dependency>
     <dependency>
-    	<groupId>org.apache.cloudstack</groupId>
-    	<artifactId>cloud-framework-ipc</artifactId>
-        <version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-framework-ipc</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
-        <groupId>org.apache.cloudstack</groupId>
-        <artifactId>cloud-framework-rest</artifactId>
-        <version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-framework-rest</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
-        <groupId>org.apache.cloudstack</groupId>
-        <artifactId>cloud-engine-api</artifactId>
-        <version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-engine-api</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
-        <groupId>org.apache.cloudstack</groupId>
-    	<artifactId>cloud-engine-components-api</artifactId>
-    	<version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-engine-components-api</artifactId>
+      <version>${project.version}</version>
     </dependency>
 
     <dependency>
-        <groupId>org.apache.cloudstack</groupId>
-        <artifactId>cloud-engine-compute</artifactId>
-        <version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-engine-compute</artifactId>
+      <version>${project.version}</version>
     </dependency>
 
     <dependency>
-        <groupId>org.apache.cloudstack</groupId>
-        <artifactId>cloud-engine-network</artifactId>
-        <version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-engine-network</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
-        <groupId>org.apache.cloudstack</groupId>
-        <artifactId>cloud-engine-orchestration</artifactId>
-        <version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-engine-orchestration</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
-        <groupId>org.apache.cloudstack</groupId>
-        <artifactId>cloud-engine-schema</artifactId>
-        <version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-engine-schema</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
-        <groupId>org.apache.cloudstack</groupId>
-        <artifactId>cloud-engine-storage</artifactId>
-        <version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-engine-storage</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
-        <groupId>org.apache.cloudstack</groupId>
-        <artifactId>cloud-engine-storage-cache</artifactId>
-        <version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-engine-storage-cache</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
-        <groupId>org.apache.cloudstack</groupId>
-        <artifactId>cloud-engine-storage-image</artifactId>
-        <version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-engine-storage-image</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
-        <groupId>org.apache.cloudstack</groupId>
-        <artifactId>cloud-engine-storage-datamotion</artifactId>
-        <version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-engine-storage-datamotion</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
-        <groupId>org.apache.cloudstack</groupId>
-        <artifactId>cloud-engine-storage-snapshot</artifactId>
-        <version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-engine-storage-snapshot</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
-        <groupId>org.apache.cloudstack</groupId>
-        <artifactId>cloud-engine-storage-volume</artifactId>
-        <version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-engine-storage-volume</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
-        <groupId>org.apache.cloudstack</groupId>
-        <artifactId>cloud-plugin-storage-volume-default</artifactId>
-        <version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-plugin-storage-volume-default</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
-        <groupId>org.apache.cloudstack</groupId>
-        <artifactId>cloud-plugin-storage-image-default</artifactId>
-        <version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-plugin-storage-image-default</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
-        <groupId>org.apache.cloudstack</groupId>
-        <artifactId>cloud-plugin-storage-image-s3</artifactId>
-        <version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-plugin-storage-image-s3</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
-        <groupId>org.apache.cloudstack</groupId>
-        <artifactId>cloud-plugin-storage-image-swift</artifactId>
-        <version>${project.version}</version>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-plugin-storage-image-swift</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.cloudstack</groupId>
@@ -294,12 +293,35 @@
     <defaultGoal>install</defaultGoal>
     <plugins>
       <plugin>
+        <groupId>ru.concerteza.buildnumber</groupId>
+        <artifactId>maven-jgit-buildnumber-plugin</artifactId>
+        <version>1.2.6</version>
+        <executions>
+          <execution>
+            <id>git-buildnumber</id>
+            <goals>
+              <goal>extract-buildnumber</goal>
+            </goals>
+            <phase>prepare-package</phase>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-war-plugin</artifactId>
         <version>2.3</version>
         <configuration>
           <webXml>./target/generated-webapp/WEB-INF/web.xml</webXml>
           <warSourceDirectory>./target/generated-webapp</warSourceDirectory>
+          <archive>
+            <manifest>
+              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+            </manifest>
+            <manifestEntries>
+              <Implementation-Revision>${git.revision}</Implementation-Revision>
+              <Implementation-Branch>${git.branch}</Implementation-Branch>
+            </manifestEntries>
+          </archive>
         </configuration>
       </plugin>
       <plugin>
@@ -336,9 +358,8 @@
         <artifactId>maven-antrun-plugin</artifactId>
         <version>1.7</version>
         <executions>
-          <!-- Copy the systemvm in the package phase as it is generated 
-               by console-proxy in the package phase. 
-          -->
+          <!-- Copy the systemvm in the package phase as it is generated by console-proxy 
+            in the package phase. -->
           <execution>
             <id>copy-systemvm</id>
             <phase>process-resources</phase>
@@ -364,21 +385,21 @@
             </goals>
             <configuration>
               <target>
-                <copy todir="${basedir}/target/generated-webapp/WEB-INF/classes/scripts">
+                <copy
+                  todir="${basedir}/target/generated-webapp/WEB-INF/classes/scripts">
                   <fileset dir="${basedir}/../scripts" />
                 </copy>
-                <!--  CLOUDSTACK-1304 -->
-                <chmod perm="755" >
-                    <fileset dir="${basedir}/target/generated-webapp/WEB-INF/classes/scripts" />
+                <!-- CLOUDSTACK-1304 -->
+                <chmod perm="755">
+                  <fileset
+                    dir="${basedir}/target/generated-webapp/WEB-INF/classes/scripts" />
                 </chmod>
-                <copy
-                  todir="${basedir}/target/generated-webapp/WEB-INF/">
+                <copy todir="${basedir}/target/generated-webapp/WEB-INF/">
                   <fileset dir="${basedir}/WEB-INF/">
                     <include name="web.xml" />
                   </fileset>
                 </copy>
-                <copy
-                  todir="${basedir}/target/generated-webapp/WEB-INF/classes">
+                <copy todir="${basedir}/target/generated-webapp/WEB-INF/classes">
                   <fileset dir="${basedir}/WEB-INF/classes">
                     <include name="resources/**/*" />
                   </fileset>
@@ -393,14 +414,13 @@
                   </fileset>
                   <globmapper from="*.in" to="*" />
                   <filterchain>
-                    <filterreader
-                      classname="org.apache.tools.ant.filters.ReplaceTokens">
-                      <param type="propertiesfile"
-                        value="${cs.replace.properties}" />
+                    <filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
+                      <param type="propertiesfile" value="${cs.replace.properties}" />
                     </filterreader>
                   </filterchain>
                 </copy>
-                <copy overwrite="true" todir="${basedir}/target/generated-webapp/WEB-INF/classes">
+                <copy overwrite="true"
+                  todir="${basedir}/target/generated-webapp/WEB-INF/classes">
                   <fileset dir="${basedir}/tomcatconf">
                     <include name="*.in" />
                   </fileset>
@@ -472,9 +492,10 @@
               <target if="${nonoss}">
                 <echo>test</echo>
                 <replaceregexp
-                    file="${basedir}/target/generated-webapp/WEB-INF/classes/environment.properties"
-                    match="cloud-stack-components-specification=.*"
-                    replace="cloud-stack-components-specification=components-nonoss.xml" byline="true"/>
+                  file="${basedir}/target/generated-webapp/WEB-INF/classes/environment.properties"
+                  match="cloud-stack-components-specification=.*"
+                  replace="cloud-stack-components-specification=components-nonoss.xml"
+                  byline="true" />
               </target>
             </configuration>
           </execution>
@@ -488,9 +509,9 @@
               <target if="${simulator}">
                 <echo>test</echo>
                 <replaceregexp
-                    file="${basedir}/target/generated-webapp/WEB-INF/web.xml"
-                    match="classpath:componentContext.xml"
-                    replace="classpath:simulatorComponentContext.xml" byline="true" />
+                  file="${basedir}/target/generated-webapp/WEB-INF/web.xml"
+                  match="classpath:componentContext.xml" replace="classpath:simulatorComponentContext.xml"
+                  byline="true" />
               </target>
             </configuration>
           </execution>
@@ -504,12 +525,14 @@
               <target if="${nonoss}">
                 <replaceregexp
                   file="${basedir}/target/generated-webapp/WEB-INF/web.xml"
-                  match="classpath:componentContext.xml"
-                  replace="classpath:nonossComponentContext.xml" byline="true" />
-                <copy overwrite="true" todir="${basedir}/target/generated-webapp/WEB-INF/classes/scripts">
-                    <fileset dir="${basedir}/../plugins/network-elements/cisco-vnmc/scripts">
-                        <include name="**/*" />
-                    </fileset>
+                  match="classpath:componentContext.xml" replace="classpath:nonossComponentContext.xml"
+                  byline="true" />
+                <copy overwrite="true"
+                  todir="${basedir}/target/generated-webapp/WEB-INF/classes/scripts">
+                  <fileset
+                    dir="${basedir}/../plugins/network-elements/cisco-vnmc/scripts">
+                    <include name="**/*" />
+                  </fileset>
                 </copy>
               </target>
             </configuration>
@@ -524,9 +547,10 @@
               <target if="${quickcloud}">
                 <echo>quickcloud</echo>
                 <replaceregexp
-                    file="${basedir}/target/generated-webapp/WEB-INF/classes/applicationContext.xml"
+                  file="${basedir}/target/generated-webapp/WEB-INF/classes/applicationContext.xml"
                   match="com.cloud.consoleproxy.ConsoleProxyManagerImpl"
-                  replace="com.cloud.consoleproxy.StaticConsoleProxyManager" byline="true" />
+                  replace="com.cloud.consoleproxy.StaticConsoleProxyManager"
+                  byline="true" />
               </target>
             </configuration>
           </execution>
@@ -568,8 +592,8 @@
     </plugins>
     <pluginManagement>
       <plugins>
-        <!--This plugin's configuration is used to store Eclipse m2e settings
-          only. It has no influence on the Maven build itself. -->
+        <!--This plugin's configuration is used to store Eclipse m2e settings only. 
+          It has no influence on the Maven build itself. -->
         <plugin>
           <groupId>org.eclipse.m2e</groupId>
           <artifactId>lifecycle-mapping</artifactId>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96d29c7f/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a268b50..ff1d3c0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -207,20 +207,6 @@
       <artifactId>spring-web</artifactId>
       <version>${org.springframework.version}</version>
     </dependency>
-    <!-- <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> 
-      <version>${org.springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> 
-      <artifactId>spring-beans</artifactId> <version>${org.springframework.version}</version> 
-      </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> 
-      <version>${org.springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> 
-      <artifactId>spring-context-support</artifactId> <version>${org.springframework.version}</version> 
-      </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> 
-      <version>${org.springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> 
-      <artifactId>spring-jdbc</artifactId> <version>${org.springframework.version}</version> 
-      </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> 
-      <version>${org.springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> 
-      <artifactId>spring-oxm</artifactId> <version>${org.springframework.version}</version> 
-      </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> 
-      <version>${org.springframework.version}</version> </dependency> -->
     <dependency>
       <groupId>org.mockito</groupId>
       <artifactId>mockito-all</artifactId>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96d29c7f/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index 8fe1e2d..497e4c9 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -99,7 +99,7 @@
       <groupId>org.apache.cloudstack</groupId>
       <artifactId>cloud-framework-ipc</artifactId>
       <version>${project.version}</version>
-    </dependency>	
+    </dependency>
     <dependency>
       <groupId>org.apache.cloudstack</groupId>
       <artifactId>cloud-framework-events</artifactId>
@@ -108,8 +108,6 @@
   </dependencies>
   <build>
     <defaultGoal>install</defaultGoal>
-    <sourceDirectory>src</sourceDirectory>
-    <testSourceDirectory>test</testSourceDirectory>
     <resources>
       <resource>
         <directory>resources</directory>


[33/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-1673: AWS Regions - Events - User disable / Domain Delete event does not
include the UUID of the user/domain that was disabled.

- added enity type and enity UUID details to UserContext
- publish the entity type and UUID details for the action events
  generated  for accout/user/domain


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

Branch: refs/heads/sdnextensions
Commit: 7f2c659630821b41c84637b5f9cabbb8995db8df
Parents: 5c3013a
Author: Murali Reddy <mu...@gmail.com>
Authored: Thu Jul 11 17:48:07 2013 +0530
Committer: Murali Reddy <mu...@gmail.com>
Committed: Thu Jul 11 18:01:43 2013 +0530

----------------------------------------------------------------------
 api/src/com/cloud/user/UserContext.java         | 23 +++++++++++++++++
 .../src/com/cloud/event/ActionEventUtils.java   | 12 +++++++++
 .../src/com/cloud/user/AccountManagerImpl.java  | 26 +++++++++++++++++++-
 .../src/com/cloud/user/DomainManagerImpl.java   |  4 ++-
 4 files changed, 63 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7f2c6596/api/src/com/cloud/user/UserContext.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/user/UserContext.java b/api/src/com/cloud/user/UserContext.java
index bcb33b5..fdd19d4 100644
--- a/api/src/com/cloud/user/UserContext.java
+++ b/api/src/com/cloud/user/UserContext.java
@@ -29,6 +29,8 @@ public class UserContext {
     private long accountId;
     private String eventDetails;
     private boolean apiServer;
+    private Class entityType;
+    private String entityUUID;
 
     @Inject private AccountService _accountMgr = null;
 
@@ -137,4 +139,25 @@ public class UserContext {
     public String getEventDetails() {
         return eventDetails;
     }
+
+    public void setEntityDetails(Class entityType, String uuid) {
+        this.entityType = entityType;
+        this.entityUUID = uuid;
+    }
+
+    public String getEntityType() {
+        return (entityType != null) ? entityType.getName() : null;
+    }
+
+    public void setEntityType(Class entityType) {
+        this.entityType = entityType;
+    }
+
+    public String getEntityUUID() {
+        return entityUUID;
+    }
+
+    public void setEntityUUID(String entityUUID) {
+        this.entityUUID = entityUUID;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7f2c6596/server/src/com/cloud/event/ActionEventUtils.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/event/ActionEventUtils.java b/server/src/com/cloud/event/ActionEventUtils.java
index eb3efed..906689f 100755
--- a/server/src/com/cloud/event/ActionEventUtils.java
+++ b/server/src/com/cloud/event/ActionEventUtils.java
@@ -24,6 +24,7 @@ import com.cloud.user.AccountVO;
 import com.cloud.user.User;
 import com.cloud.user.dao.AccountDao;
 import com.cloud.user.dao.UserDao;
+import com.cloud.user.UserContext;
 import com.cloud.utils.component.ComponentContext;
 import org.apache.cloudstack.framework.events.EventBus;
 import org.apache.cloudstack.framework.events.EventBusException;
@@ -152,6 +153,15 @@ public class ActionEventUtils {
             return; // no provider is configured to provide events bus, so just return
         }
 
+        // get the entity details for which ActionEvent is generated
+        String entityType = null;
+        String entityUuid = null;
+        UserContext context = UserContext.current();
+        if (context != null) {
+            entityType = context.getEntityType();
+            entityUuid = context.getEntityUUID();
+        }
+
         org.apache.cloudstack.framework.events.Event event = new org.apache.cloudstack.framework.events.Event(
                 ManagementServer.Name,
                 eventCategory,
@@ -170,6 +180,8 @@ public class ActionEventUtils {
         eventDescription.put("account", account.getUuid());
         eventDescription.put("event", eventType);
         eventDescription.put("status", state.toString());
+        eventDescription.put("entity", entityType);
+        eventDescription.put("entityuuid", entityUuid);
         event.setDescription(eventDescription);
 
         try {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7f2c6596/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 6b4bf0e..283e832 100755
--- a/server/src/com/cloud/user/AccountManagerImpl.java
+++ b/server/src/com/cloud/user/AccountManagerImpl.java
@@ -910,6 +910,8 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
         }
         txn.commit();
 
+        UserContext.current().setEntityDetails(Account.class, account.getUuid());
+
         //check success
         return _userAccountDao.findById(user.getId());
     }
@@ -1070,6 +1072,9 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
             s_logger.error("error updating user", th);
             throw new CloudRuntimeException("Unable to update user " + id);
         }
+
+        UserContext.current().setEntityDetails(User.class, user.getUuid());
+
         return _userAccountDao.findById(id);
     }
 
@@ -1100,6 +1105,9 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
 
         boolean success = doSetUserStatus(userId, State.disabled);
         if (success) {
+
+            UserContext.current().setEntityDetails(User.class, user.getUuid());
+
             // user successfully disabled
             return _userAccountDao.findById(userId);
         } else {
@@ -1146,6 +1154,9 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
         if (success) {
             // whenever the user is successfully enabled, reset the login attempts to zero
             updateLoginAttempts(userId, 0, false);
+
+            UserContext.current().setEntityDetails(User.class, user.getUuid());
+
             return _userAccountDao.findById(userId);
         } else {
             throw new CloudRuntimeException("Unable to enable user " + userId);
@@ -1207,6 +1218,9 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
         }
 
         if (success) {
+
+            UserContext.current().setEntityDetails(User.class, user.getUuid());
+
             return _userAccountDao.findById(userId);
         } else {
             throw new CloudRuntimeException("Unable to lock user " + userId);
@@ -1252,6 +1266,9 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
 
             throw new InvalidParameterValueException("The account id=" + accountId + " manages project(s) with ids " + projectIds + "and can't be removed");
         }
+
+        UserContext.current().setEntityDetails(Account.class, account.getUuid());
+
         return deleteAccount(account, callerUserId, caller);
     }
 
@@ -1281,6 +1298,9 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
 
         boolean success = enableAccount(account.getId());
         if (success) {
+
+            UserContext.current().setEntityDetails(Account.class, account.getUuid());
+
             return _accountDao.findById(account.getId());
         } else {
             throw new CloudRuntimeException("Unable to enable account by accountId: " + accountId + " OR by name: " + accountName + " in domain " + domainId);
@@ -1310,6 +1330,7 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
         checkAccess(caller, null, true, account);
 
         if (lockAccount(account.getId())) {
+            UserContext.current().setEntityDetails(Account.class, account.getUuid());
             return _accountDao.findById(account.getId());
         } else {
             throw new CloudRuntimeException("Unable to lock account by accountId: " + accountId + " OR by name: " + accountName + " in domain " + domainId);
@@ -1339,6 +1360,7 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
         checkAccess(caller, null, true, account);
 
         if (disableAccount(account.getId())) {
+            UserContext.current().setEntityDetails(Account.class, account.getUuid());
             return _accountDao.findById(account.getId());
         } else {
             throw new CloudRuntimeException("Unable to update account by accountId: " + accountId + " OR by name: " + accountName + " in domain " + domainId);
@@ -1421,6 +1443,7 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
         txn.commit();
 
         if (success) {
+            UserContext.current().setEntityDetails(Account.class, account.getUuid());
             return _accountDao.findById(account.getId());
         } else {
             throw new CloudRuntimeException("Unable to update account by accountId: " + accountId + " OR by name: " + accountName + " in domain " + domainId);
@@ -1451,6 +1474,7 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
         }
 
         checkAccess(UserContext.current().getCaller(), null, true, account);
+        UserContext.current().setEntityDetails(User.class, user.getUuid());
         return _userDao.remove(id);
     }
 
@@ -1769,7 +1793,7 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
             userUUID =  UUID.randomUUID().toString();
         }
         UserVO user = _userDao.persist(new UserVO(accountId, userName, encodedPassword, firstName, lastName, email, timezone, userUUID));
-
+        UserContext.current().setEntityDetails(User.class, user.getUuid());
         return user;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7f2c6596/server/src/com/cloud/user/DomainManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/user/DomainManagerImpl.java b/server/src/com/cloud/user/DomainManagerImpl.java
index 562a0d8..aad5787 100644
--- a/server/src/com/cloud/user/DomainManagerImpl.java
+++ b/server/src/com/cloud/user/DomainManagerImpl.java
@@ -184,6 +184,7 @@ public class DomainManagerImpl extends ManagerBase implements DomainManager, Dom
         DomainVO domain = _domainDao.create(new DomainVO(name, ownerId, parentId, networkDomain, domainUUID));
         _resourceCountDao.createResourceCounts(domain.getId(), ResourceLimit.ResourceOwnerType.Domain);
         txn.commit();
+        UserContext.current().setEntityDetails(Domain.class, domain.getUuid());
         return domain;
     }
 
@@ -280,6 +281,7 @@ public class DomainManagerImpl extends ManagerBase implements DomainManager, Dom
             }
 
             cleanupDomainOfferings(domain.getId());
+            UserContext.current().setEntityDetails(Domain.class, domain.getUuid());
             return true;
         } catch (Exception ex) {
             s_logger.error("Exception deleting domain with id " + domain.getId(), ex);
@@ -604,7 +606,7 @@ public class DomainManagerImpl extends ManagerBase implements DomainManager, Dom
             }
         }
         _domainDao.update(domainId, domain);
-
+        UserContext.current().setEntityDetails(Domain.class, domain.getUuid());
         txn.commit();
 
         return _domainDao.findById(domainId);


[31/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
ostypeid references removed

Signed-off-by: Prasanna Santhanam <ts...@apache.org>
(cherry picked from commit 088c1e2a46b2758e2a0cb2ab107a6fa83a3c7c73)


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

Branch: refs/heads/sdnextensions
Commit: 535903f928f55e570dec7597b66c2c97f5e86c32
Parents: 51b0270
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Thu Jul 11 16:43:18 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Thu Jul 11 16:45:53 2013 +0530

----------------------------------------------------------------------
 test/integration/component/test_netscaler_nw_off.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/535903f9/test/integration/component/test_netscaler_nw_off.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_netscaler_nw_off.py b/test/integration/component/test_netscaler_nw_off.py
index 256d1be..a5fe5b1 100644
--- a/test/integration/component/test_netscaler_nw_off.py
+++ b/test/integration/component/test_netscaler_nw_off.py
@@ -529,7 +529,7 @@ class TestNetScalerSharedMode(cloudstackTestCase):
         cls.template = get_template(
                             cls.api_client,
                             cls.zone.id,
-                            cls.services["ostypeid"]
+                            cls.services["ostype"]
                             )
 
         physical_networks = PhysicalNetwork.list(
@@ -1086,7 +1086,7 @@ class TestNwOffDedicatedNetscaler(cloudstackTestCase):
         cls.template = get_template(
                             cls.api_client,
                             cls.zone.id,
-                            cls.services["ostypeid"]
+                            cls.services["ostype"]
                             )
 
         physical_networks = PhysicalNetwork.list(
@@ -1253,7 +1253,7 @@ class TestNwOffNetscaler(cloudstackTestCase):
         cls.template = get_template(
                             cls.api_client,
                             cls.zone.id,
-                            cls.services["ostypeid"]
+                            cls.services["ostype"]
                             )
 
         physical_networks = PhysicalNetwork.list(
@@ -1563,7 +1563,7 @@ class TestNwOffSToDUpgrade(cloudstackTestCase):
         cls.template = get_template(
                             cls.api_client,
                             cls.zone.id,
-                            cls.services["ostypeid"]
+                            cls.services["ostype"]
                             )
 
         physical_networks = PhysicalNetwork.list(
@@ -1980,7 +1980,7 @@ class TestNwOffDToSUpgrade(cloudstackTestCase):
         cls.template = get_template(
                             cls.api_client,
                             cls.zone.id,
-                            cls.services["ostypeid"]
+                            cls.services["ostype"]
                             )
 
         physical_networks = PhysicalNetwork.list(


[29/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
Updated logger initalization in classes ListVmwareDcsCmd, RemoveVmwareDcCmd & minor cleanup of comments.


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

Branch: refs/heads/sdnextensions
Commit: 1e2f99be686d3e6938c95387fe80be31ede54888
Parents: 08669f5
Author: Sateesh Chodapuneedi <sa...@apache.org>
Authored: Thu Jul 11 15:59:25 2013 +0530
Committer: Sateesh Chodapuneedi <sa...@apache.org>
Committed: Thu Jul 11 15:59:25 2013 +0530

----------------------------------------------------------------------
 .../cloud/hypervisor/vmware/dao/LegacyZoneDao.java   |  4 ++--
 .../api/command/admin/zone/ListVmwareDcsCmd.java     |  2 +-
 .../api/command/admin/zone/RemoveVmwareDcCmd.java    | 15 ++++-----------
 3 files changed, 7 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1e2f99be/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/dao/LegacyZoneDao.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/dao/LegacyZoneDao.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/dao/LegacyZoneDao.java
index 4a858f8..290f1af 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/dao/LegacyZoneDao.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/dao/LegacyZoneDao.java
@@ -24,8 +24,8 @@ import com.cloud.utils.db.GenericDao;
 
 public interface LegacyZoneDao extends GenericDao<LegacyZoneVO, Long> {
     /**
-     * @param id of zone
-     * @return zone id of legacy zone
+     * @param zoneId - id of zone
+     * @return Object of legacy zone (LegacyZoneVO) identified by zoneId
      */
     LegacyZoneVO findByZoneId(String zoneId);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1e2f99be/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/ListVmwareDcsCmd.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/ListVmwareDcsCmd.java b/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/ListVmwareDcsCmd.java
index 15c23fa..b7b0f9e 100644
--- a/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/ListVmwareDcsCmd.java
+++ b/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/ListVmwareDcsCmd.java
@@ -48,7 +48,7 @@ public class ListVmwareDcsCmd extends BaseListCmd {
 
     @Inject public VmwareDatacenterService _vmwareDatacenterService;
 
-    public static final Logger s_logger = Logger.getLogger(AddVmwareDcCmd.class.getName());
+    public static final Logger s_logger = Logger.getLogger(ListVmwareDcsCmd.class.getName());
 
     private static final String s_name = "listvmwaredcsresponse";
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1e2f99be/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/RemoveVmwareDcCmd.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/RemoveVmwareDcCmd.java b/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/RemoveVmwareDcCmd.java
index a74c91b..6fde15c 100644
--- a/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/RemoveVmwareDcCmd.java
+++ b/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/RemoveVmwareDcCmd.java
@@ -19,26 +19,19 @@ package org.apache.cloudstack.api.command.admin.zone;
 
 import javax.inject.Inject;
 
+import org.apache.log4j.Logger;
+
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.BaseCmd;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.ServerApiException;
-import org.apache.cloudstack.api.BaseCmd.CommandType;
 import org.apache.cloudstack.api.response.SuccessResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
 
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.DiscoveryException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.NetworkRuleConflictException;
-import com.cloud.exception.ResourceAllocationException;
 import com.cloud.exception.ResourceInUseException;
-import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.hypervisor.vmware.VmwareDatacenterService;
-import com.cloud.network.element.CiscoNexusVSMElementService;
 import com.cloud.user.Account;
 import com.cloud.utils.exception.CloudRuntimeException;
 
@@ -47,7 +40,7 @@ public class RemoveVmwareDcCmd extends BaseCmd {
 
     @Inject public VmwareDatacenterService _vmwareDatacenterService;
 
-    public static final Logger s_logger = Logger.getLogger(AddVmwareDcCmd.class.getName());
+    public static final Logger s_logger = Logger.getLogger(RemoveVmwareDcCmd.class.getName());
 
     private static final String s_name = "removevmwaredcresponse";
 
@@ -67,7 +60,7 @@ public class RemoveVmwareDcCmd extends BaseCmd {
             boolean result = _vmwareDatacenterService.removeVmwareDatacenter(this);
             if (result) {
                 response.setResponseName(getCommandName());
-                this.setResponseObject(response);
+                setResponseObject(response);
             } else {
                 throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to remove VMware datacenter from zone");
             }


[12/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-2779: Fix ACL rule protocol number field

-Fix protocol number field not passing start/end port

-Fix protocol number for ACL rule 'edit' form


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

Branch: refs/heads/sdnextensions
Commit: 73cd064e517bf3a3e3d1d8b34e4f1aaf6599adcc
Parents: 9de2034
Author: Brian Federle <br...@citrix.com>
Authored: Wed Jul 10 16:47:40 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Wed Jul 10 16:47:47 2013 -0700

----------------------------------------------------------------------
 ui/scripts/vpc.js | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/73cd064e/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index 17ea65e..ab4d730 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -367,8 +367,12 @@
             });
           } else if (data.protocol === 'protocolnumber') {
             $.extend(data, {
-              protocolnumber: args.data.protocolnumber
+              protocol: args.data.protocolnumber,
+              startport: args.data.startport,
+              endport: args.data.endport
             });
+
+            delete args.data.protocolnumber;
           }
 
           $.ajax({
@@ -1149,10 +1153,17 @@
                         success:function(json){
                           var items = json.listnetworkaclsresponse.networkacl.sort(function(a, b) {
                             return a.number >= b.number;
+                          }).map(function(acl) {
+                            if (parseInt(acl.protocol)) { // protocol number
+                              acl.protocolnumber = acl.protocol;
+                              acl.protocol = "protocolnumber";
+                            }
+                            
+                            return acl;
                           });
 
                           args.response.success({
-                            data:items
+                            data: items
                             /* {
                                cidrlist: '10.1.1.0/24',
                                protocol: 'TCP',


[49/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3094: Adding a shared network to already deployed VM is failing.

Signed-off-by: Mice Xia <mi...@tcloudcomputing.com>


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

Branch: refs/heads/sdnextensions
Commit: bdc7e4ce337f2f7cba8320808755119a835de07c
Parents: dd91974
Author: Saksham Srivastava <sa...@citrix.com>
Authored: Mon Jul 8 19:50:03 2013 +0530
Committer: Mice Xia <mi...@tcloudcomputing.com>
Committed: Fri Jul 12 14:30:10 2013 +0800

----------------------------------------------------------------------
 .../src/com/cloud/vm/dao/VMInstanceDao.java      |  2 ++
 .../src/com/cloud/vm/dao/VMInstanceDaoImpl.java  | 12 ++++++++++++
 server/src/com/cloud/vm/UserVmManagerImpl.java   | 19 +++++++++++--------
 3 files changed, 25 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdc7e4ce/engine/schema/src/com/cloud/vm/dao/VMInstanceDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/dao/VMInstanceDao.java b/engine/schema/src/com/cloud/vm/dao/VMInstanceDao.java
index 830e464..e564052 100644
--- a/engine/schema/src/com/cloud/vm/dao/VMInstanceDao.java
+++ b/engine/schema/src/com/cloud/vm/dao/VMInstanceDao.java
@@ -76,6 +76,8 @@ public interface VMInstanceDao extends GenericDao<VMInstanceVO, Long>, StateDao<
 
     VMInstanceVO findVMByInstanceName(String name);
 
+    VMInstanceVO findVMByHostName(String hostName);
+
     void updateProxyId(long id, Long proxyId, Date time);
 
     List<VMInstanceVO> listByHostIdTypes(long hostid, VirtualMachine.Type... types);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdc7e4ce/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
index ffb1a0b..ec04085 100644
--- a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
@@ -78,6 +78,7 @@ public class VMInstanceDaoImpl extends GenericDaoBase<VMInstanceVO, Long> implem
     protected SearchBuilder<VMInstanceVO> HostIdUpTypesSearch;
     protected SearchBuilder<VMInstanceVO> HostUpSearch;
     protected SearchBuilder<VMInstanceVO> InstanceNameSearch;
+    protected SearchBuilder<VMInstanceVO> HostNameSearch;
     protected GenericSearchBuilder<VMInstanceVO, Long> CountVirtualRoutersByAccount;
     protected GenericSearchBuilder<VMInstanceVO, Long> CountRunningByHost;
     protected GenericSearchBuilder<VMInstanceVO, Long> CountRunningByAccount;
@@ -192,6 +193,10 @@ public class VMInstanceDaoImpl extends GenericDaoBase<VMInstanceVO, Long> implem
         InstanceNameSearch.and("instanceName", InstanceNameSearch.entity().getInstanceName(), Op.EQ);
         InstanceNameSearch.done();
 
+        HostNameSearch = createSearchBuilder();
+        HostNameSearch.and("hostName", HostNameSearch.entity().getHostName(), Op.EQ);
+        HostNameSearch.done();
+
         CountVirtualRoutersByAccount = createSearchBuilder(Long.class);
         CountVirtualRoutersByAccount.select(null, Func.COUNT, null);
         CountVirtualRoutersByAccount.and("account", CountVirtualRoutersByAccount.entity().getAccountId(), SearchCriteria.Op.EQ);
@@ -362,6 +367,13 @@ public class VMInstanceDaoImpl extends GenericDaoBase<VMInstanceVO, Long> implem
     }
 
     @Override
+    public VMInstanceVO findVMByHostName(String hostName) {
+        SearchCriteria<VMInstanceVO> sc = HostNameSearch.create();
+        sc.setParameters("hostName", hostName);
+        return findOneBy(sc);
+    }
+
+    @Override
     public void updateProxyId(long id, Long proxyId, Date time) {
         VMInstanceVO vo = createForUpdate();
         vo.setProxyId(proxyId);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bdc7e4ce/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index f95123e..79e7f5a 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -870,14 +870,17 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use
             throw new CloudRuntimeException(vmInstance + " is in zone:" + vmInstance.getDataCenterId() + " but " + network + " is in zone:" + network.getDataCenterId());
         }
 
-        if(_networkModel.getNicInNetwork(vmInstance.getId(),network.getId()) != null){
-            s_logger.debug(vmInstance + " already in " + network + " going to add another NIC");
-        } else {
-            //* get all vms hostNames in the network
-            List<String> hostNames = _vmInstanceDao.listDistinctHostNames(network.getId());
-            //* verify that there are no duplicates
-            if (hostNames.contains(vmInstance.getHostName())) {
-                throw new CloudRuntimeException(network + " already has a vm with host name: '" + vmInstance.getHostName());
+        // Get all vms hostNames in the network
+        List<String> hostNames = _vmInstanceDao.listDistinctHostNames(network.getId());
+        // verify that there are no duplicates, listDistictHostNames could return hostNames even if the NIC
+        //in the network is removed, so also check if the NIC is present and then throw an exception.
+        //This will also check if there are multiple nics of same vm in the network
+        if (hostNames.contains(vmInstance.getHostName())) {
+            for (String hostName : hostNames) {
+                VMInstanceVO vm = _vmInstanceDao.findVMByHostName(hostName);
+                if(_networkModel.getNicInNetwork(vm.getId(),network.getId())!=null && vm.getHostName().equals(vmInstance.getHostName())) {
+                    throw new CloudRuntimeException(network + " already has a vm with host name: " + vmInstance.getHostName());
+                }
             }
         }
 


[18/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-770


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

Branch: refs/heads/sdnextensions
Commit: 3e8edd74b9095ac6fde6beaf8a7a3a480c0f95c5
Parents: f56d9d7
Author: radhikap <ra...@citrix.com>
Authored: Thu Jul 11 10:26:42 2013 +0530
Committer: radhikap <ra...@citrix.com>
Committed: Thu Jul 11 10:27:31 2013 +0530

----------------------------------------------------------------------
 docs/en-US/configure-acl.xml      |  2 +-
 docs/en-US/inter-vlan-routing.xml | 28 ++++++++++++++--------------
 docs/en-US/vpc.xml                |  6 ++++++
 3 files changed, 21 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3e8edd74/docs/en-US/configure-acl.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/configure-acl.xml b/docs/en-US/configure-acl.xml
index e4d5dad..c89210b 100644
--- a/docs/en-US/configure-acl.xml
+++ b/docs/en-US/configure-acl.xml
@@ -19,7 +19,7 @@
     under the License.
 -->
 <section id="configure-acl">
-  <title>Configuring Access Control List</title>
+  <title>Configuring Network Access Control List</title>
   <para>Define Network Access Control List (ACL) on the VPC virtual router to control incoming
     (ingress) and outgoing (egress) traffic between the VPC tiers, and the tiers and Internet. By
     default, all incoming and outgoing traffic to the guest networks is blocked. To open the ports,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3e8edd74/docs/en-US/inter-vlan-routing.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/inter-vlan-routing.xml b/docs/en-US/inter-vlan-routing.xml
index c39d567..59115de 100644
--- a/docs/en-US/inter-vlan-routing.xml
+++ b/docs/en-US/inter-vlan-routing.xml
@@ -19,16 +19,16 @@
     under the License.
 -->
 <section id="inter-vlan-routing">
-  <title>About Inter-VLAN Routing</title>
-  <para>Inter-VLAN Routing is the capability to route network traffic between VLANs. This feature
-    enables you to build Virtual Private Clouds (VPC), an isolated segment of your cloud, that can
-    hold multi-tier applications. These tiers are deployed on different VLANs that can communicate
-    with each other. You provision VLANs to the tiers your create, and VMs can be deployed on
-    different tiers. The VLANs are connected to a virtual router, which facilitates communication
-    between the VMs. In effect, you can segment VMs by means of VLANs into different networks that
-    can host multi-tier applications, such as Web, Application, or Database. Such segmentation by
-    means of VLANs logically separate application VMs for higher security and lower broadcasts,
-    while remaining physically connected to the same device.</para>
+  <title>About Inter-VLAN Routing (nTier Apps)</title>
+  <para>Inter-VLAN Routing (nTier Apps) is the capability to route network traffic between VLANs.
+    This feature enables you to build Virtual Private Clouds (VPC), an isolated segment of your
+    cloud, that can hold multi-tier applications. These tiers are deployed on different VLANs that
+    can communicate with each other. You provision VLANs to the tiers your create, and VMs can be
+    deployed on different tiers. The VLANs are connected to a virtual router, which facilitates
+    communication between the VMs. In effect, you can segment VMs by means of VLANs into different
+    networks that can host multi-tier applications, such as Web, Application, or Database. Such
+    segmentation by means of VLANs logically separate application VMs for higher security and lower
+    broadcasts, while remaining physically connected to the same device.</para>
   <para>This feature is supported on XenServer, KVM, and VMware hypervisors.</para>
   <para>The major advantages are:</para>
   <itemizedlist>
@@ -88,10 +88,10 @@
       </itemizedlist>
     </listitem>
     <listitem>
-      <para>The administrator can define Access Control List (ACL) on the virtual router to filter
-        the traffic among the VLANs or between the Internet and a VLAN. You can define ACL based on
-        CIDR, port range, protocol, type code (if ICMP protocol is selected) and Ingress/Egress
-        type.</para>
+      <para>The administrator can define Network Access Control List (ACL) on the virtual router to
+        filter the traffic among the VLANs or between the Internet and a VLAN. You can define ACL
+        based on CIDR, port range, protocol, type code (if ICMP protocol is selected) and
+        Ingress/Egress type.</para>
     </listitem>
   </itemizedlist>
   <para>The following figure shows the possible deployment scenarios of a Inter-VLAN setup:</para>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3e8edd74/docs/en-US/vpc.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/vpc.xml b/docs/en-US/vpc.xml
index 7c94f0d..d1f0c52 100644
--- a/docs/en-US/vpc.xml
+++ b/docs/en-US/vpc.xml
@@ -75,6 +75,12 @@
         Translation for instances to access the Internet via the public gateway. For more
         information, see <xref linkend="enable-disable-static-nat-vpc"/>.</para>
     </listitem>
+    <listitem>
+      <para><emphasis role="bold">Network ACL</emphasis>:  Network ACL is a group of Network ACL
+        items. Network ACL items are nothing but numbered rules that are evaluated in order,
+        starting with the lowest numbered rule. These rules determine whether traffic is allowed in
+        or out of any tier associated with the network ACL. For more information, see <xref linkend="configure-acl"/>.</para>
+    </listitem>
   </itemizedlist>
   <formalpara>
     <title>Network Architecture in a VPC</title>


[24/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3441: [Load Test] High delays between VM being allocated to Pod and network implementation causing delays in VM deployment
This is a regresion caused due to fix for CLOUDSTACK-70. In order to fix network restart scenario, delays got introduced in the user VM deployment scenario.
Fixed it by separating out the network restart and new VM deployment scenario such that the latter is not affected due to the fix for CLOUDSTACK-70.


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

Branch: refs/heads/sdnextensions
Commit: e3e8bfce16f36c1aca1e706725aafab53f1c795c
Parents: 873377c
Author: Koushik Das <ko...@citrix.com>
Authored: Thu Jul 11 12:03:09 2013 +0530
Committer: Koushik Das <ko...@citrix.com>
Committed: Thu Jul 11 12:03:09 2013 +0530

----------------------------------------------------------------------
 .../cloud/network/router/VirtualNetworkApplianceManagerImpl.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e3e8bfce/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index ddfa998..8d73941 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -1446,7 +1446,8 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
             // dest has pod=null, for Basic Zone findOrDeployVRs for all Pods
             List<DeployDestination> destinations = new ArrayList<DeployDestination>();
 
-            if (dest.getDataCenter().getNetworkType() == NetworkType.Basic) {
+            // for basic zone, if 'dest' has pod set to null then this is network restart scenario otherwise it is a vm deployment scenario
+            if (dest.getDataCenter().getNetworkType() == NetworkType.Basic && dest.getPod() == null) {
                 // Find all pods in the data center with running or starting user vms
                 long dcId = dest.getDataCenter().getId();
                 List<HostPodVO> pods = listByDataCenterIdVMTypeAndStates(dcId, VirtualMachine.Type.User, VirtualMachine.State.Starting, VirtualMachine.State.Running);


[37/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-1475: fix RegisterISO error after Update SSL Certificate


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

Branch: refs/heads/sdnextensions
Commit: 521dcbdcc087515a67ad467f6c4b39f63c9390bc
Parents: 1a03024
Author: Wei Zhou <w....@leaseweb.com>
Authored: Thu Jul 11 16:08:26 2013 +0200
Committer: Wei Zhou <w....@leaseweb.com>
Committed: Thu Jul 11 16:08:26 2013 +0200

----------------------------------------------------------------------
 services/console-proxy/server/scripts/config_ssl.sh | 9 +++++++++
 services/secondary-storage/scripts/config_ssl.sh    | 9 +++++++++
 2 files changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/521dcbdc/services/console-proxy/server/scripts/config_ssl.sh
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/scripts/config_ssl.sh b/services/console-proxy/server/scripts/config_ssl.sh
index 8d80c47..e474787 100755
--- a/services/console-proxy/server/scripts/config_ssl.sh
+++ b/services/console-proxy/server/scripts/config_ssl.sh
@@ -90,6 +90,9 @@ customPrivCert=$(dirname $0)/certs/realhostip.crt
 customCertChain=
 publicIp=
 hostName=
+keyStore=$(dirname $0)/certs/realhostip.keystore
+aliasName="CPVMCertificate"
+storepass="vmops.com"
 while getopts 'i:h:k:p:t:c' OPTION
 do
   case $OPTION in
@@ -162,6 +165,12 @@ then
   exit 2
 fi
 
+if [ -f "$customPrivCert" ]
+then
+  keytool -delete -alias $aliasName -keystore $keyStore -storepass $storepass -noprompt
+  keytool -import -alias $aliasName -keystore $keyStore -storepass $storepass -noprompt -file $customPrivCert
+fi
+
 if [ -d /etc/apache2 ]
 then
   config_apache2_conf $publicIp $hostName

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/521dcbdc/services/secondary-storage/scripts/config_ssl.sh
----------------------------------------------------------------------
diff --git a/services/secondary-storage/scripts/config_ssl.sh b/services/secondary-storage/scripts/config_ssl.sh
index 8d80c47..e474787 100755
--- a/services/secondary-storage/scripts/config_ssl.sh
+++ b/services/secondary-storage/scripts/config_ssl.sh
@@ -90,6 +90,9 @@ customPrivCert=$(dirname $0)/certs/realhostip.crt
 customCertChain=
 publicIp=
 hostName=
+keyStore=$(dirname $0)/certs/realhostip.keystore
+aliasName="CPVMCertificate"
+storepass="vmops.com"
 while getopts 'i:h:k:p:t:c' OPTION
 do
   case $OPTION in
@@ -162,6 +165,12 @@ then
   exit 2
 fi
 
+if [ -f "$customPrivCert" ]
+then
+  keytool -delete -alias $aliasName -keystore $keyStore -storepass $storepass -noprompt
+  keytool -import -alias $aliasName -keystore $keyStore -storepass $storepass -noprompt -file $customPrivCert
+fi
+
 if [ -d /etc/apache2 ]
 then
   config_apache2_conf $publicIp $hostName


[46/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3427: UI > UCS manager > implement associatesUcsProfileToBlade API.


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

Branch: refs/heads/sdnextensions
Commit: e93ef73e9f9b880e8311eef365940151a1e56a2b
Parents: 0331b8f
Author: Jessica Wang <je...@apache.org>
Authored: Thu Jul 11 17:18:44 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Thu Jul 11 17:19:21 2013 -0700

----------------------------------------------------------------------
 ui/scripts/system.js | 101 +++++++++++++++++++++++-----------------------
 1 file changed, 51 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e93ef73e/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 4080b6b..18c3df4 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -13104,6 +13104,7 @@
               blades: {
                 title: 'Blades',
                 listView: {
+                  id: 'blades',
                   fields: {
                     //dn: { label: 'Distinguished Name' },
                     chassis: { label: 'Chassis' }, 
@@ -13125,37 +13126,35 @@
                           data[i].bladeid = array1[2];
                         }
 
+                        
+                        //for testing only (begin)   
+                        /*
+                        var data = [
+                          {
+                            "id": "58c84a1d-6e46-44e3-b7ec-abaa876d1be3",
+                            "ucsmanagerid": "0c96f848-4306-47e5-a9ac-b76aad3557fb",
+                            "bladedn": "sys/chassis-1/blade-1"
+                          },
+                          {
+                            "id": "de5abadf-f294-4014-9fed-7ee37a9b8724",
+                            "ucsmanagerid": "0c96f848-4306-47e5-a9ac-b76aad3557fb",
+                            "bladedn": "sys/chassis-1/blade-2"
+                          }
+                        ];         
+                        for(var i = 0; i < data.length; i++) {
+                          var array1 = data[i].bladedn.split('/');                      
+                          data[i].chassis = array1[1];
+                          data[i].bladeid = array1[2];
+                        }  
+                        */
+                        //for testing only (end)
+                        
+                        
                         args.response.success({
                           data: data
                         });      
                       }                      
-                    });                           
-
-                    /*
-                    var data = [
-                      {
-                        "id": "58c84a1d-6e46-44e3-b7ec-abaa876d1be3",
-                        "ucsmanagerid": "0c96f848-4306-47e5-a9ac-b76aad3557fb",
-                        "bladedn": "sys/chassis-1/blade-1"
-                      },
-                      {
-                        "id": "de5abadf-f294-4014-9fed-7ee37a9b8724",
-                        "ucsmanagerid": "0c96f848-4306-47e5-a9ac-b76aad3557fb",
-                        "bladedn": "sys/chassis-1/blade-2"
-                      }
-                    ];                    
-                               
-                    for(var i = 0; i < data.length; i++) {
-                      var array1 = data[i].bladedn.split('/');                      
-                      data[i].chassis = array1[1];
-                      data[i].bladeid = array1[2];
-                    }
-
-                    args.response.success({
-                      data: data
-                    });      
-                    */
-                    
+                    });  
                   },                  
                   actions: {                      
                     associateProfileToBlade: {
@@ -13179,49 +13178,51 @@
                                 data: {
                                   ucsmanagerid: args.context.ucsManagers[0].id
                                 },
+                                async: false,
                                 success: function(json) { //e.g. json == { "listucsprofileresponse" : { "count":1 ,"ucsprofile" : [  {"ucsdn":"org-root/ls-testProfile"} ] } }
                                   var ucsprofiles = json.listucsprofileresponse.ucsprofile;
                                   if(ucsprofiles != null) {
                                     for(var i = 0; i < ucsprofiles.length; i++) {
                                       items.push({ id: ucsprofiles[i].ucsdn, description: ucsprofiles[i].ucsdn });                                      
                                     }
-                                  }
-                                  
-                                  //for testing only (begin)
-                                  /*
-                                  items.push({id: 'Service_Profile_Demo1', description: 'Service_Profile_Demo1'});
-                                  items.push({id: 'Service_Profile_Demo2', description: 'Service_Profile_Demo2'});
-                                  items.push({id: 'Service_Profile_Demo3', description: 'Service_Profile_Demo3'});
-                                  items.push({id: 'Service_Profile_Demo4', description: 'Service_Profile_Demo4'});
-                                  items.push({id: 'Service_Profile_Demo5', description: 'Service_Profile_Demo5'});
-                                  items.push({id: 'Service_Profile_Demo6', description: 'Service_Profile_Demo6'});
-                                  items.push({id: 'Service_Profile_Demo7', description: 'Service_Profile_Demo7'});
-                                  */
-                                  //for testing only (end)
-                                  
-                                  args.response.success({ data: items });
+                                  }                                  
                                 }
-                              });
+                              });                              
+
+                              //for testing only (begin)     
+                              /*
+                              items.push({id: 'org-root/ls-testProfile1', description: 'org-root/ls-testProfile1'});
+                              items.push({id: 'org-root/ls-testProfile2', description: 'org-root/ls-testProfile2'});
+                              items.push({id: 'org-root/ls-testProfile3', description: 'org-root/ls-testProfile3'});
+                              items.push({id: 'org-root/ls-testProfile4', description: 'org-root/ls-testProfile4'});
+                              items.push({id: 'org-root/ls-testProfile5', description: 'org-root/ls-testProfile5'});
+                              items.push({id: 'org-root/ls-testProfile6', description: 'org-root/ls-testProfile6'});
+                              items.push({id: 'org-root/ls-testProfile7', description: 'org-root/ls-testProfile7'});    
+                              */                             
+                              //for testing only (end)                              
+                              
+                              args.response.success({ data: items });
+                              
                             },
                             validation: { required: true }
                           }
                         }
                       },
-                      action: function(args) {
-                        /*
+                      action: function(args) {                        
                         $.ajax({
-                          url: createURL('associatesUscProfileToBlade'),
+                          url: createURL('associatesUcsProfileToBlade'),
                           data: {
                             ucsmanagerid: args.context.ucsManagers[0].id,
                             profiledn: args.data.profiledn, 
-                            bladeid: '1234567890' //to change later
+                            bladeid: args.context.blades[0].id
                           },
                           success: function(json) {
-                            
+                            //json.associateucsprofiletobladeresponse.ucsblade
+                            args.response.success({data: { associatedProfileDn: args.data.profiledn }});
                           }
                         });
-                        */
-                        args.response.success({data: { associatedProfileDn: args.data.profiledn }});
+                        
+                        //args.response.success({data: { associatedProfileDn: args.data.profiledn }}); //for testing only
                       },
                       notification: {
                         poll: function(args) {


[04/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
turn on simulator code, only when -Psimulator is used


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

Branch: refs/heads/sdnextensions
Commit: 58f0007f751643c7eb9e6a75a4b32209b2608771
Parents: 8236e7b
Author: Edison Su <su...@gmail.com>
Authored: Wed Jul 10 14:10:54 2013 -0700
Committer: Edison Su <su...@gmail.com>
Committed: Wed Jul 10 14:31:47 2013 -0700

----------------------------------------------------------------------
 client/pom.xml    | 12 +-----------
 developer/pom.xml | 12 ------------
 plugins/pom.xml   |  1 -
 3 files changed, 1 insertion(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/58f0007f/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index 222c520..aa67f7f 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -250,11 +250,6 @@
         <version>${project.version}</version>
     </dependency>
     <dependency>
-      <groupId>org.apache.cloudstack</groupId>
-      <artifactId>cloud-plugin-hypervisor-simulator</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
         <groupId>org.apache.cloudstack</groupId>
         <artifactId>cloud-plugin-storage-volume-default</artifactId>
         <version>${project.version}</version>
@@ -276,11 +271,6 @@
     </dependency>
     <dependency>
       <groupId>org.apache.cloudstack</groupId>
-      <artifactId>cloud-plugin-storage-image-simulator</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.cloudstack</groupId>
       <artifactId>cloud-plugin-syslog-alerts</artifactId>
       <version>${project.version}</version>
     </dependency>
@@ -613,7 +603,7 @@
   </build>
   <profiles>
     <profile>
-      <id>developer</id>
+      <id>simulator</id>
       <activation>
         <property>
           <name>simulator</name>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/58f0007f/developer/pom.xml
----------------------------------------------------------------------
diff --git a/developer/pom.xml b/developer/pom.xml
index e9284f4..b86969f 100644
--- a/developer/pom.xml
+++ b/developer/pom.xml
@@ -52,18 +52,6 @@
       <artifactId>cloud-server</artifactId>
       <version>${project.version}</version>
     </dependency>
-    <dependency>
-      <groupId>org.apache.cloudstack</groupId>
-      <artifactId>cloud-plugin-hypervisor-simulator</artifactId>
-      <version>${project.version}</version>
-      <scope>compile</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.cloudstack</groupId>
-      <artifactId>cloud-plugin-storage-image-simulator</artifactId>
-      <version>${project.version}</version>
-      <scope>compile</scope>
-    </dependency>
   </dependencies>
   <build>
     <defaultGoal>install</defaultGoal>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/58f0007f/plugins/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/pom.xml b/plugins/pom.xml
index 5bc324d..261e8e8 100755
--- a/plugins/pom.xml
+++ b/plugins/pom.xml
@@ -46,7 +46,6 @@
     <module>hypervisors/xen</module>
     <module>hypervisors/kvm</module>
     <module>event-bus/rabbitmq</module>
-    <module>hypervisors/simulator</module>
     <module>hypervisors/baremetal</module>
     <module>hypervisors/ucs</module>
     <module>network-elements/elastic-loadbalancer</module>


[42/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3461: Make vCenter user/password fields optional


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

Branch: refs/heads/sdnextensions
Commit: 6eeea70dad1350b6fa27527e810a521893f956cb
Parents: 8d7a216
Author: Brian Federle <br...@citrix.com>
Authored: Thu Jul 11 11:13:35 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Thu Jul 11 11:14:06 2013 -0700

----------------------------------------------------------------------
 ui/scripts/system.js     | 4 +---
 ui/scripts/zoneWizard.js | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6eeea70d/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index db0689c..90ede7d 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -10168,13 +10168,11 @@
                   },
                   vCenterUsername: {
                     label: 'label.vcenter.username',
-                    docID: 'helpClustervCenterUsername',
-                    validation: { required: true }
+                    docID: 'helpClustervCenterUsername'
                   },
                   vCenterPassword: {
                     label: 'label.vcenter.password',
                     docID: 'helpClustervCenterPassword',
-                    validation: { required: true },
                     isPassword: true
                   },
                   vCenterDatacenter: {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6eeea70d/ui/scripts/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js
index eea0888..e2ad910 100755
--- a/ui/scripts/zoneWizard.js
+++ b/ui/scripts/zoneWizard.js
@@ -886,12 +886,10 @@
             validation: { required: true }
           },
           vCenterUsername: {
-            label: 'label.vcenter.username',
-            validation: { required: true }
+            label: 'label.vcenter.username'
           },
           vCenterPassword: {
             label: 'label.vcenter.password',
-            validation: { required: true },
             isPassword: true
           },
           vCenterDatacenter: {


[14/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
fix CLOUDSTACK-1852, use findHostsForMigration to list available hosts for migration


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

Branch: refs/heads/sdnextensions
Commit: 742bc8dc835f7aea6dee8f14afbe32637f578c72
Parents: 63206d6
Author: Mice Xia <mi...@tcloudcomputing.com>
Authored: Thu Jul 11 10:39:30 2013 +0800
Committer: Mice Xia <mi...@tcloudcomputing.com>
Committed: Thu Jul 11 11:01:07 2013 +0800

----------------------------------------------------------------------
 ui/scripts/system.js | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/742bc8dc/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 1d7a59b..868d212d 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -2628,11 +2628,11 @@
                               validation: { required: true },
                               select: function(args) {
                                 $.ajax({
-                                  url: createURL("listHosts&VirtualMachineId=" + args.context.routers[0].id),
+                                  url: createURL("findHostsForMigration&VirtualMachineId=" + args.context.routers[0].id),
                                   dataType: "json",
                                   async: true,
                                   success: function(json) {
-                                    var hostObjs = json.listhostsresponse.host;
+                                    var hostObjs = json.findhostsformigrationresponse.host;
                                     var items = [];
                                     $(hostObjs).each(function() {
                                       items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")});
@@ -3072,11 +3072,11 @@
                               validation: { required: true },
                               select: function(args) {
                                 $.ajax({
-                                  url: createURL("listHosts&VirtualMachineId=" + args.context.internallbinstances[0].id),
+                                  url: createURL("findHostsForMigration&VirtualMachineId=" + args.context.internallbinstances[0].id),
                                   dataType: "json",
                                   async: true,
                                   success: function(json) {
-                                    var hostObjs = json.listhostsresponse.host;
+                                    var hostObjs = json.findhostsformigrationresponse.host;
                                     var items = [];
                                     $(hostObjs).each(function() {
                                       items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")});
@@ -3645,11 +3645,11 @@
                               validation: { required: true },
                               select: function(args) {
                                 $.ajax({
-                                  url: createURL("listHosts&VirtualMachineId=" + args.context.routers[0].id),
+                                  url: createURL("findHostsForMigration&VirtualMachineId=" + args.context.routers[0].id),
                                   dataType: "json",
                                   async: true,
                                   success: function(json) {
-                                    var hostObjs = json.listhostsresponse.host;
+                                    var hostObjs = json.findhostsformigrationresponse.host;
                                     var items = [];
                                     $(hostObjs).each(function() {
                                       items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")});
@@ -6497,12 +6497,12 @@
                                       dataType: "json",
                                       async: true,
                                       success: function(json) {
-                                        var hostObjs = json.listhostsresponse.host;
+                                        var hostObjs = json.findhostsformigrationresponse.host;
                                         var items = [];
                                         $(hostObjs).each(function() {
                                           if(this.requiresStorageMotion == false){
-                                          items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")});
-                                           }
+                                            items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")});
+                                          }
                                         });
                                         args.response.success({data: items});
                                       }
@@ -7437,11 +7437,11 @@
                       validation: { required: true },
                       select: function(args) {
                         $.ajax({
-                          url: createURL("listHosts&VirtualMachineId=" + args.context.routers[0].id),
+                          url: createURL("findHostsForMigration&VirtualMachineId=" + args.context.routers[0].id),
                           dataType: "json",
                           async: true,
                           success: function(json) {
-                            var hostObjs = json.listhostsresponse.host;
+                            var hostObjs = json.findhostsformigrationresponse.host;
                             var items = [];
                             $(hostObjs).each(function() {
                               items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")});
@@ -7985,11 +7985,11 @@
                           dataType: "json",
                           async: true,
                           success: function(json) {
-                            var hostObjs = json.listhostsresponse.host;
+                            var hostObjs = json.findhostsformigrationresponse.host;
                             var items = [];
                             $(hostObjs).each(function() {
                               if(this.requiresStorageMotion == false){
-                              items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")});
+                                items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")});
                               }
                             });
                             args.response.success({data: items});


[40/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3196: Add missing 'dedicate host' icon


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

Branch: refs/heads/sdnextensions
Commit: d912839e21f33e7b7fd7dc24e6e82deca1321db0
Parents: 3984287
Author: Brian Federle <br...@citrix.com>
Authored: Thu Jul 11 10:49:30 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Thu Jul 11 10:50:16 2013 -0700

----------------------------------------------------------------------
 ui/css/cloudstack3.css | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d912839e/ui/css/cloudstack3.css
----------------------------------------------------------------------
diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css
index 1b255c9..4545e96 100644
--- a/ui/css/cloudstack3.css
+++ b/ui/css/cloudstack3.css
@@ -11992,7 +11992,8 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
 .createTemplate .icon,
 .enableSwift .icon,
 .addVM .icon,
-.dedicateZone .icon {
+.dedicateZone .icon,
+.dedicate .icon {
   background-position: -69px -63px;
 }
 


[45/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3234: Adding cookie to associate profile blade API

	Signed-off by: Animesh Chaturvedi <an...@apache.org>


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

Branch: refs/heads/sdnextensions
Commit: 0331b8fe5d2c89f91597bc7033565e1bf66bc57c
Parents: 20bade6
Author: Amogh Vasekar <am...@Amoghs-MacBook-Pro.local>
Authored: Tue Jul 9 17:18:55 2013 -0700
Committer: Animesh Chaturvedi <an...@citrix.com>
Committed: Thu Jul 11 16:27:11 2013 -0700

----------------------------------------------------------------------
 plugins/hypervisors/ucs/src/com/cloud/ucs/manager/UcsCommands.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0331b8fe/plugins/hypervisors/ucs/src/com/cloud/ucs/manager/UcsCommands.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ucs/src/com/cloud/ucs/manager/UcsCommands.java b/plugins/hypervisors/ucs/src/com/cloud/ucs/manager/UcsCommands.java
index 9bb77a2..f6cc57f 100644
--- a/plugins/hypervisors/ucs/src/com/cloud/ucs/manager/UcsCommands.java
+++ b/plugins/hypervisors/ucs/src/com/cloud/ucs/manager/UcsCommands.java
@@ -60,7 +60,7 @@ public class UcsCommands {
     }
 
     public static String associateProfileToBlade(String cookie, String profileDn, String bladeDn) {
-        XmlObject cmd = new XmlObject("configConfMos").putElement("inHierarchical", "true").putElement(
+        XmlObject cmd = new XmlObject("configConfMos").putElement("cookie", cookie).putElement("inHierarchical", "true").putElement(
                 "inConfigs", new XmlObject("inConfigs").putElement(
                         "pair", new XmlObject("pair").putElement("key", profileDn).putElement(
                                 "lsServer", new XmlObject("lsServer")


[05/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
fix db upgrade


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

Branch: refs/heads/sdnextensions
Commit: 7eb3d49e8e0a9b247ea974cad744803420982eda
Parents: 58f0007
Author: Edison Su <su...@gmail.com>
Authored: Wed Jul 10 14:50:51 2013 -0700
Committer: Edison Su <su...@gmail.com>
Committed: Wed Jul 10 14:50:51 2013 -0700

----------------------------------------------------------------------
 setup/db/db/schema-410to420.sql | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7eb3d49e/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 2c49cb9..1e9c201 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -36,6 +36,9 @@ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'manage
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'midonet.providerrouter.id', 'd7c5e6a3-e2f4-426b-b728-b7ce6a0448e5', 'Specifies the UUID of the Midonet provider router (if using Midonet)');
 ALTER TABLE `cloud`.`load_balancer_vm_map` ADD state VARCHAR(40) NULL COMMENT 'service status updated by LB healthcheck manager';
 
+ALTER TABLE `cloud`.`vm_template` ADD COLUMN `dynamically_scalable` tinyint(1) unsigned NOT NULL DEFAULT 0  COMMENT 'true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory';
+UPDATE `cloud`.`vm_template` SET dynamically_scalable = 1 WHERE name = "CentOS 5.6(64-bit) no GUI (XenServer)" AND type = "BUILTIN";
+
 alter table storage_pool add hypervisor varchar(32);
 alter table storage_pool change storage_provider_id storage_provider_name varchar(255);
 alter table storage_pool change available_bytes used_bytes bigint unsigned;
@@ -2155,8 +2158,6 @@ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'manag
 
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'direct.agent.scan.interval', 90, 'Time interval (in seconds) to run the direct agent scan task.');
 
-ALTER TABLE `cloud`.`vm_template` ADD COLUMN `dynamically_scalable` tinyint(1) unsigned NOT NULL DEFAULT 0  COMMENT 'true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory';
-UPDATE `cloud`.`vm_template` SET dynamically_scalable = 1 WHERE name = "CentOS 5.6(64-bit) no GUI (XenServer)" AND type = "BUILTIN";
 
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'external.baremetal.system.url', null, 'url of external baremetal system that CloudStack will talk to');
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'external.baremetal.resource.classname', null, 'class name for handling external baremetal resource');


[25/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3244: Inject KeystoreManager in ManagementServerImpl


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

Branch: refs/heads/sdnextensions
Commit: 33376f1459c061d6ebbd0ce03ebe70016954b0fa
Parents: e3e8bfc
Author: Wei Zhou <w....@leaseweb.com>
Authored: Thu Jul 11 09:57:06 2013 +0200
Committer: Wei Zhou <w....@leaseweb.com>
Committed: Thu Jul 11 09:58:25 2013 +0200

----------------------------------------------------------------------
 server/src/com/cloud/server/ManagementServerImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/33376f14/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 da9d6a2..7795bb3 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -687,7 +687,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
 
     private final ScheduledExecutorService _eventExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("EventChecker"));
     private final ScheduledExecutorService _alertExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("AlertChecker"));
-    private KeystoreManager _ksMgr;
+    @Inject private KeystoreManager _ksMgr;
 
     private Map<String, String> _configs;
 


[23/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
[DOC]configuration path refactor /etc/cloud to /etc/cloudstack
CLOUDSTACK-3182


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

Branch: refs/heads/sdnextensions
Commit: 873377c6bd0ab066ceb49231b7931ffc050dcbc7
Parents: 9b294ad
Author: Gavin Lee <ga...@gmail.com>
Authored: Thu Jul 11 13:50:15 2013 +0800
Committer: Gavin Lee <ga...@gmail.com>
Committed: Thu Jul 11 13:55:44 2013 +0800

----------------------------------------------------------------------
 docs/en-US/aws-ec2-configuration.xml                 |  4 ++--
 docs/en-US/change-database-config.xml                |  2 +-
 docs/en-US/change-database-password.xml              | 10 +++++-----
 docs/en-US/increase-management-server-max-memory.xml |  2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/873377c6/docs/en-US/aws-ec2-configuration.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/aws-ec2-configuration.xml b/docs/en-US/aws-ec2-configuration.xml
index d6dd2b5..f0f2d0f 100644
--- a/docs/en-US/aws-ec2-configuration.xml
+++ b/docs/en-US/aws-ec2-configuration.xml
@@ -95,8 +95,8 @@
         <note>
             <para>(Optional) The AWS API listens for requests on port 7080. If you prefer AWS API to listen on another port, you can change it as follows:</para>
             <orderedlist numeration="loweralpha">
-                <listitem><para>Edit the files /etc/cloud/management/server.xml, /etc/cloud/management/server-nonssl.xml,
-                          and /etc/cloud/management/server-ssl.xml.</para></listitem>
+                <listitem><para>Edit the files /etc/cloudstack/management/server.xml, /etc/cloudstack/management/server-nonssl.xml,
+                          and /etc/cloudstack/management/server-ssl.xml.</para></listitem>
                 <listitem><para>In each file, find the tag &lt;Service name="Catalina7080"&gt;. Under this tag,
                           locate &lt;Connector executor="tomcatThreadPool-internal" port= ....&lt;.</para></listitem>
                 <listitem><para>Change the port to whatever port you want to use, then save the files.</para></listitem>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/873377c6/docs/en-US/change-database-config.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/change-database-config.xml b/docs/en-US/change-database-config.xml
index 34e7672..567b9e4 100644
--- a/docs/en-US/change-database-config.xml
+++ b/docs/en-US/change-database-config.xml
@@ -24,5 +24,5 @@
 
 <section id="change-database-config">
     <title>Changing the Database Configuration</title>
-    <para>The &PRODUCT; Management Server stores database configuration information (e.g., hostname, port, credentials) in the file <filename>/etc/cloud/management/db.properties</filename>. To effect a change, edit this file on each Management Server, then restart the Management Server.</para> 
+    <para>The &PRODUCT; Management Server stores database configuration information (e.g., hostname, port, credentials) in the file <filename>/etc/cloudstack/management/db.properties</filename>. To effect a change, edit this file on each Management Server, then restart the Management Server.</para> 
 </section>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/873377c6/docs/en-US/change-database-password.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/change-database-password.xml b/docs/en-US/change-database-password.xml
index b0021a4..863984e 100644
--- a/docs/en-US/change-database-password.xml
+++ b/docs/en-US/change-database-password.xml
@@ -24,7 +24,7 @@
 
 <section id="change-database-password">
     <title>Changing the Database Password</title>
-    <para>You may need to change the password for the MySQL account used by CloudStack. If so, you'll need to change the password in MySQL, and then add the encrypted password to <filename>/etc/cloud/management/db.properties</filename>.</para> 
+    <para>You may need to change the password for the MySQL account used by CloudStack. If so, you'll need to change the password in MySQL, and then add the encrypted password to <filename>/etc/cloudstack/management/db.properties</filename>.</para> 
     <orderedlist>
     <listitem>
         <para>Before changing the password, you'll need to stop CloudStack's management server and the usage engine if you've deployed that component.</para>
@@ -46,11 +46,11 @@
 </screen>
     </listitem>
     <listitem>
-        <para>The next step is to encrypt the password and copy the encrypted password to CloudStack's database configuration (<filename>/etc/cloud/management/db.properties</filename>).</para>
+        <para>The next step is to encrypt the password and copy the encrypted password to CloudStack's database configuration (<filename>/etc/cloudstack/management/db.properties</filename>).</para>
 <screen>
-<command># java -classpath /usr/share/java/cloud-jasypt-1.8.jar \
+    <command># java -classpath /usr/share/cloudstack-common/lib/jasypt-1.9.0.jar \
 org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI encrypt.sh \ 
-input="newpassword123" password="`cat /etc/cloud/management/key`" \
+input="newpassword123" password="`cat /etc/cloudstack/management/key`" \
 verbose=false 
 </command>
 </screen>
@@ -59,7 +59,7 @@ verbose=false
 </note>
 </listitem>
 <listitem>
-    <para>Now, you'll update <filename>/etc/cloud/management/db.properties</filename> with the new ciphertext. Open <filename>/etc/cloud/management/db.properties</filename> in a text editor, and update these parameters: </para>
+    <para>Now, you'll update <filename>/etc/cloudstack/management/db.properties</filename> with the new ciphertext. Open <filename>/etc/cloudstack/management/db.properties</filename> in a text editor, and update these parameters: </para>
     <programlisting>
 db.cloud.password=ENC(encrypted_password_from_above) 
 db.usage.password=ENC(encrypted_password_from_above) 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/873377c6/docs/en-US/increase-management-server-max-memory.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/increase-management-server-max-memory.xml b/docs/en-US/increase-management-server-max-memory.xml
index 51c8724..8992ad6 100644
--- a/docs/en-US/increase-management-server-max-memory.xml
+++ b/docs/en-US/increase-management-server-max-memory.xml
@@ -26,7 +26,7 @@
     <title>Increase Management Server Maximum Memory</title>
     <para>If the Management Server is subject to high demand, the default maximum JVM memory allocation can be insufficient. To increase the memory:</para>
     <orderedlist>
-        <listitem><para>Edit the Tomcat configuration file:</para><programlisting>/etc/cloud/management/tomcat6.conf</programlisting></listitem>
+        <listitem><para>Edit the Tomcat configuration file:</para><programlisting>/etc/cloudstack/management/tomcat6.conf</programlisting></listitem>
         <listitem><para>Change the command-line parameter -XmxNNNm to a higher value of N.</para><para>For example, if the current value is -Xmx128m, change it to -Xmx1024m or higher.</para></listitem>
         <listitem><para>To put the new setting into effect, restart the Management Server.</para><programlisting># service cloudstack-management restart</programlisting></listitem>
       </orderedlist>


[50/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
make SDN GRE work with XCP 1.6


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

Branch: refs/heads/sdnextensions
Commit: bcfb4e67cb8c15102cdebae470c5684d585e619a
Parents: bdc7e4c
Author: tuna <ng...@gmail.com>
Authored: Wed Jul 10 22:18:18 2013 +0700
Committer: Sebastien Goasguen <ru...@gmail.com>
Committed: Fri Jul 12 03:50:28 2013 -0400

----------------------------------------------------------------------
 .../xen/resource/CitrixResourceBase.java        | 28 +++++++++--
 scripts/vm/hypervisor/xenserver/ovstunnel       | 49 ++++++++++++++++----
 scripts/vm/hypervisor/xenserver/xcposs/patch    |  4 ++
 scripts/vm/hypervisor/xenserver/xcpserver/patch |  4 ++
 .../vm/hypervisor/xenserver/xenserver56/patch   |  3 ++
 .../hypervisor/xenserver/xenserver56fp1/patch   |  4 ++
 6 files changed, 79 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bcfb4e67/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index d6d0523..cda5711 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -925,8 +925,8 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
                 } else {
                     vswitchNw = networks.iterator().next();
                 }
-
-                enableXenServerNetwork(conn, vswitchNw, "vswitch", "vswitch network");
+                if (!is_xcp())
+                	enableXenServerNetwork(conn, vswitchNw, "vswitch", "vswitch network");
                 _host.vswitchNetwork = vswitchNw;
             }
             return _host.vswitchNetwork;
@@ -960,7 +960,8 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
                 rec.otherConfig = otherConfig;
                 nw = Network.create(conn, rec);
                 // Plug dom0 vif only when creating network
-                enableXenServerNetwork(conn, nw, nwName, "tunnel network for account " + key);
+                if (!is_xcp())
+                	enableXenServerNetwork(conn, nw, nwName, "tunnel network for account " + key);
                 s_logger.debug("### Xen Server network for tunnels created:" + nwName);
             } else {
                 nw = networks.iterator().next();
@@ -996,7 +997,8 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
             }
             if (!configured) {
                 // Plug dom0 vif only if not done before for network and host
-                enableXenServerNetwork(conn, nw, nwName, "tunnel network for account " + key);
+            	if (!is_xcp())
+            		enableXenServerNetwork(conn, nw, nwName, "tunnel network for account " + key);
                 String result = callHostPlugin(conn, "ovstunnel", "setup_ovs_bridge", "bridge", bridge,
                         "key", String.valueOf(key),
                         "xs_nw_uuid", nw.getUuid(conn),
@@ -5786,6 +5788,10 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
     private OvsFetchInterfaceAnswer execute(OvsFetchInterfaceCommand cmd) {
 
         String label = cmd.getLabel();
+        //FIXME: this is a tricky to pass the network checking in XCP. I temporary get default label from Host.
+        if (is_xcp()) {
+        	label = getLabel();
+        }
         s_logger.debug("Will look for network with name-label:" + label + " on host " + _host.ip);
         Connection conn = getConnection();
         try {
@@ -8599,4 +8605,18 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
     @Override
     public void setRunLevel(int level) {
     }
+    
+    private boolean is_xcp() {
+    	Connection conn = getConnection();
+    	String result = callHostPlugin(conn, "ovstunnel", "is_xcp");
+    	if (result.equals("XCP"))
+    		return true;
+    	return false;
+    }
+    
+    private String getLabel() {
+    	Connection conn = getConnection();
+    	String result = callHostPlugin(conn, "ovstunnel", "getLabel");
+    	return result;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bcfb4e67/scripts/vm/hypervisor/xenserver/ovstunnel
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/ovstunnel b/scripts/vm/hypervisor/xenserver/ovstunnel
index ddcaa5b..9a89630 100755
--- a/scripts/vm/hypervisor/xenserver/ovstunnel
+++ b/scripts/vm/hypervisor/xenserver/ovstunnel
@@ -22,6 +22,7 @@
 
 import cloudstack_pluginlib as lib
 import logging
+import commands
 import os
 import sys
 import subprocess
@@ -107,14 +108,15 @@ def setup_ovs_bridge(session, args):
                    "other-config:ovs-host-setup=%s" % conf_hosts])
 
         # BLOCK IPv6 - Flow spec changes with ovs version
-        host_list_cmd = [lib.XE_PATH, 'host-list', '--minimal']
-        host_list_str = lib.do_cmd(host_list_cmd)
-        host_uuid = host_list_str.split(',')[0].strip()
-        version_cmd = [lib.XE_PATH, 'host-param-get', 'uuid=%s' % host_uuid,
-                                   'param-name=software-version',
-                                   'param-key=product_version']
-        version = lib.do_cmd(version_cmd).split('.')[0]
-        block_ipv6_handlers[version](bridge)
+        # Temporarily no need BLOCK IPv6
+#        host_list_cmd = [lib.XE_PATH, 'host-list', '--minimal']
+#        host_list_str = lib.do_cmd(host_list_cmd)
+#        host_uuid = host_list_str.split(',')[0].strip()
+#        version_cmd = [lib.XE_PATH, 'host-param-get', 'uuid=%s' % host_uuid,
+#                                   'param-name=software-version',
+#                                   'param-key=product_version']
+#        version = lib.do_cmd(version_cmd).split('.')[0]
+#        block_ipv6_handlers[version](bridge)
     logging.debug("Setup_ovs_bridge completed with result:%s" % result)
     return result
 
@@ -253,9 +255,38 @@ def get_field_of_interface(iface_name, field):
     res = lib.do_cmd(get_iface_cmd)
     return res
 
+def is_xcp(session, args):
+    host_list_cmd = [lib.XE_PATH, 'host-list', '--minimal']
+    host_list_str = lib.do_cmd(host_list_cmd)
+    host_uuid = host_list_str.split(',')[0].strip()
+
+    status, output = commands.getstatusoutput("xe host-param-list uuid="+host_uuid+" | grep platform_name")
+    if (status != 0):
+       return "FALSE"
+
+    platform_cmd = [lib.XE_PATH, 'host-param-get', 'uuid=%s' % host_uuid,
+                               'param-name=software-version',
+                               'param-key=platform_name']
+    platform = lib.do_cmd(platform_cmd).split('.')[0]
+    return platform                           
+
+def getLabel(session, args):
+    pif_list_cmd = [lib.XE_PATH, 'pif-list', '--minimal']
+    pif_list_str = lib.do_cmd(pif_list_cmd)
+    pif_uuid = pif_list_str.split(',')[0].strip()
+    network_cmd = [lib.XE_PATH, 'pif-param-get', 'uuid=%s' % pif_uuid,
+                               'param-name=network-uuid']
+    network_uuid = lib.do_cmd(network_cmd).split('.')[0]
+
+    label_cmd = [lib.XE_PATH, 'network-param-get', 'uuid=%s' % network_uuid,
+                               'param-name=name-label']
+    label = lib.do_cmd(label_cmd).split('.')[0]
+    return label
 
 if __name__ == "__main__":
     XenAPIPlugin.dispatch({"create_tunnel": create_tunnel,
                            "destroy_tunnel": destroy_tunnel,
                            "setup_ovs_bridge": setup_ovs_bridge,
-                           "destroy_ovs_bridge": destroy_ovs_bridge})
+                           "destroy_ovs_bridge": destroy_ovs_bridge,
+                           "is_xcp": is_xcp,
+                           "getLabel": getLabel})

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bcfb4e67/scripts/vm/hypervisor/xenserver/xcposs/patch
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/xcposs/patch b/scripts/vm/hypervisor/xenserver/xcposs/patch
index 4d07c76..4c9eb4f 100644
--- a/scripts/vm/hypervisor/xenserver/xcposs/patch
+++ b/scripts/vm/hypervisor/xenserver/xcposs/patch
@@ -67,3 +67,7 @@ getDomRVersion.sh=../../../../network/domr/,0755,/usr/lib/xcp/bin
 router_proxy.sh=../../../../network/domr/,0755,/usr/lib/xcp/bin
 createipAlias.sh=..,0755,/usr/lib/xcp/bin
 deleteipAlias.sh=..,0755,/usr/lib/xcp/bin
+
+###add cloudstack plugin script for XCP
+cloudstack_plugins.conf=..,0644,/etc/xensource
+cloudstack_pluginlib.py=..,0755,/etc/xapi.d/plugins

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bcfb4e67/scripts/vm/hypervisor/xenserver/xcpserver/patch
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/xcpserver/patch b/scripts/vm/hypervisor/xenserver/xcpserver/patch
index 7e92d5a..1b1b00a 100644
--- a/scripts/vm/hypervisor/xenserver/xcpserver/patch
+++ b/scripts/vm/hypervisor/xenserver/xcpserver/patch
@@ -65,3 +65,7 @@ getRouterStatus.sh=../../../../network/domr/,0755,/opt/xensource/bin
 bumpUpPriority.sh=../../../../network/domr/,0755,/opt/xensource/bin
 getDomRVersion.sh=../../../../network/domr/,0755,/opt/xensource/bin
 add_to_vcpus_params_live.sh=..,0755,/opt/xensource/bin
+
+###add cloudstack plugin script for XCP
+cloudstack_plugins.conf=..,0644,/etc/xensource
+cloudstack_pluginlib.py=..,0755,/etc/xapi.d/plugins
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bcfb4e67/scripts/vm/hypervisor/xenserver/xenserver56/patch
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/xenserver56/patch b/scripts/vm/hypervisor/xenserver/xenserver56/patch
index 8abd6b2..ee8cd13 100644
--- a/scripts/vm/hypervisor/xenserver/xenserver56/patch
+++ b/scripts/vm/hypervisor/xenserver/xenserver56/patch
@@ -67,3 +67,6 @@ swiftxen=..,0755,/etc/xapi.d/plugins
 s3xen=..,0755,/etc/xapi.d/plugins
 add_to_vcpus_params_live.sh=..,0755,/opt/xensource/bin
 
+###add cloudstack plugin script for XCP
+cloudstack_plugins.conf=..,0644,/etc/xensource
+cloudstack_pluginlib.py=..,0755,/etc/xapi.d/plugins
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bcfb4e67/scripts/vm/hypervisor/xenserver/xenserver56fp1/patch
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/xenserver56fp1/patch b/scripts/vm/hypervisor/xenserver/xenserver56fp1/patch
index 901f6de..588a2a3 100644
--- a/scripts/vm/hypervisor/xenserver/xenserver56fp1/patch
+++ b/scripts/vm/hypervisor/xenserver/xenserver56fp1/patch
@@ -66,3 +66,7 @@ swiftxen=..,0755,/etc/xapi.d/plugins
 s3xen=..,0755,/etc/xapi.d/plugins
 add_to_vcpus_params_live.sh=..,0755,/opt/xensource/bin
 
+###add cloudstack plugin script for XCP
+cloudstack_plugins.conf=..,0644,/etc/xensource
+cloudstack_pluginlib.py=..,0755,/etc/xapi.d/plugins
+


[06/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3301 NPE wile deployVM in kvm Only solidfire type PS is setting/using the capacityIops, This check will fix to return the storage has enough Iops when capacityIops is set to NULL for any PS Storage provider


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

Branch: refs/heads/sdnextensions
Commit: 7089e1ce44151702f36a8135e3b74752631a1894
Parents: 7eb3d49
Author: Rajesh Battala <ra...@citrix.com>
Authored: Tue Jul 2 11:56:19 2013 +0530
Committer: Edison Su <su...@gmail.com>
Committed: Wed Jul 10 14:52:47 2013 -0700

----------------------------------------------------------------------
 server/src/com/cloud/storage/StorageManagerImpl.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7089e1ce/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java
index d9ef853..7378708 100755
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@ -1499,11 +1499,15 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
         if (requestedVolumes == null || requestedVolumes.isEmpty() || pool == null) {
             return false;
         }
-
+        // Only Solidfire type primary storage is using/setting Iops.
+        // This check will fix to return the storage has enough Iops when capacityIops is set to NULL for any PS Storage provider
+        if (pool.getCapacityIops() == null ) {
+            return true;
+        }
         long currentIops = 0;
-
         List<VolumeVO> volumesInPool = _volumeDao.findByPoolId(pool.getId(), null);
 
+
         for (VolumeVO volumeInPool : volumesInPool) {
             Long minIops = volumeInPool.getMinIops();
 


[10/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3455: delete Shared networks of the domain when do domain deletion


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

Branch: refs/heads/sdnextensions
Commit: 56da71e5b66f5520f2024efb541b76bd2818ff56
Parents: 18b17fc
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Wed Jul 10 15:28:29 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Jul 10 15:36:24 2013 -0700

----------------------------------------------------------------------
 .../src/com/cloud/user/DomainManagerImpl.java   | 56 +++++++++++++++++---
 1 file changed, 50 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/56da71e5/server/src/com/cloud/user/DomainManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/user/DomainManagerImpl.java b/server/src/com/cloud/user/DomainManagerImpl.java
index 20537ba..562a0d8 100644
--- a/server/src/com/cloud/user/DomainManagerImpl.java
+++ b/server/src/com/cloud/user/DomainManagerImpl.java
@@ -46,6 +46,8 @@ import com.cloud.exception.ConcurrentOperationException;
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.exception.PermissionDeniedException;
 import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.NetworkManager;
+import com.cloud.network.dao.NetworkDomainDao;
 import com.cloud.projects.ProjectManager;
 import com.cloud.projects.ProjectVO;
 import com.cloud.projects.dao.ProjectDao;
@@ -63,6 +65,8 @@ import com.cloud.utils.db.SearchCriteria;
 import com.cloud.utils.db.Transaction;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.net.NetUtils;
+import com.cloud.vm.ReservationContext;
+import com.cloud.vm.ReservationContextImpl;
 
 @Component
 @Local(value = { DomainManager.class, DomainService.class })
@@ -91,6 +95,10 @@ public class DomainManagerImpl extends ManagerBase implements DomainManager, Dom
     private ResourceLimitDao _resourceLimitDao;
     @Inject
     private DedicatedResourceDao _dedicatedDao;
+    @Inject
+    private NetworkManager _networkMgr;
+    @Inject
+    private NetworkDomainDao _networkDomainDao;
 
     @Override
     public Domain getDomain(long domainId) {
@@ -229,13 +237,16 @@ public class DomainManagerImpl extends ManagerBase implements DomainManager, Dom
             long ownerId = domain.getAccountId();
             if ((cleanup != null) && cleanup.booleanValue()) {
                 if (!cleanupDomain(domain.getId(), ownerId)) {
+                    rollBackState=true;
                     CloudRuntimeException e = new CloudRuntimeException("Failed to clean up domain resources and sub domains, delete failed on domain " + domain.getName() + " (id: " + domain.getId() + ").");
                     e.addProxyObject(domain.getUuid(), "domainId");
                     throw e;
                 }
             } else {
+                //don't delete the domain if there are accounts set for cleanup, or non-removed networks exist
+                List<Long> networkIds = _networkDomainDao.listNetworkIdsByDomain(domain.getId());
                 List<AccountVO> accountsForCleanup = _accountDao.findCleanupsForRemovedAccounts(domain.getId());
-                if (accountsForCleanup.isEmpty()) {
+                if (accountsForCleanup.isEmpty() && networkIds.isEmpty()) {
                     if (!_domainDao.remove(domain.getId())) {
                         rollBackState = true;
                         CloudRuntimeException e = new CloudRuntimeException("Delete failed on domain " + domain.getName() + " (id: " + domain.getId() + "); Please make sure all users and sub domains have been removed from the domain before deleting");
@@ -255,7 +266,14 @@ public class DomainManagerImpl extends ManagerBase implements DomainManager, Dom
                     }
                 } else {
                     rollBackState = true;
-                    CloudRuntimeException e = new CloudRuntimeException("Can't delete the domain yet because it has " + accountsForCleanup.size() + "accounts that need a cleanup");
+                    String msg = null;
+                    if (!accountsForCleanup.isEmpty()) {
+                        msg = accountsForCleanup.size() + " accounts to cleanup";
+                    } else if (!networkIds.isEmpty()) {
+                        msg = networkIds.size() + " non-removed networks";
+                    }
+                    
+                    CloudRuntimeException e = new CloudRuntimeException("Can't delete the domain yet because it has " + msg);
                     e.addProxyObject(domain.getUuid(), "domainId");
                     throw e;
                 }
@@ -330,19 +348,44 @@ public class DomainManagerImpl extends ManagerBase implements DomainManager, Dom
         for (AccountVO account : accounts) {
             if (account.getType() != Account.ACCOUNT_TYPE_PROJECT) {
                 s_logger.debug("Deleting account " + account + " as a part of domain id=" + domainId + " cleanup");
-                success = (success && _accountMgr.deleteAccount(account, UserContext.current().getCallerUserId(), UserContext.current().getCaller()));
-                if (!success) {
+                boolean deleteAccount = _accountMgr.deleteAccount(account, UserContext.current().getCallerUserId(), UserContext.current().getCaller());
+                if (!deleteAccount) {
                     s_logger.warn("Failed to cleanup account id=" + account.getId() + " as a part of domain cleanup");
                 }
+                success = (success && deleteAccount);    
             } else {
                 ProjectVO project = _projectDao.findByProjectAccountId(account.getId());
                 s_logger.debug("Deleting project " + project + " as a part of domain id=" + domainId + " cleanup");
-                success = (success && _projectMgr.deleteProject(UserContext.current().getCaller(), UserContext.current().getCallerUserId(), project));
-                if (!success) {
+                boolean deleteProject = _projectMgr.deleteProject(UserContext.current().getCaller(), UserContext.current().getCallerUserId(), project);
+                if (!deleteProject) {
                     s_logger.warn("Failed to cleanup project " + project + " as a part of domain cleanup");
                 }
+                success = (success && deleteProject);
             }
         }
+        
+        //delete the domain shared networks
+        boolean networksDeleted = true;
+        s_logger.debug("Deleting networks for domain id=" + domainId);
+        List<Long> networkIds = _networkDomainDao.listNetworkIdsByDomain(domainId);
+        UserContext ctx = UserContext.current();
+        ReservationContext context = new ReservationContextImpl(null, null, _accountMgr.getActiveUser(ctx.getCallerUserId()), ctx.getCaller());
+        for (Long networkId : networkIds) {
+            s_logger.debug("Deleting network id=" + networkId + " as a part of domain id=" + domainId + " cleanup");
+            
+            if (!_networkMgr.destroyNetwork(networkId, context)) {
+                s_logger.warn("Unable to destroy network id=" + networkId + " as a part of domain id=" + domainId + " cleanup.");
+                networksDeleted = false;
+            } else {
+                s_logger.debug("Network " + networkId + " successfully deleted as a part of domain id=" + domainId + " cleanup.");
+            }
+        }
+        
+        //don't proceed if networks failed to cleanup. The cleanup will be performed for inactive domain once again
+        if (!networksDeleted) {
+            s_logger.debug("Failed to delete the shared networks as a part of domain id=" + domainId + " clenaup");
+            return false;
+        }
 
         // don't remove the domain if there are accounts required cleanup
         boolean deleteDomainSuccess = true;
@@ -366,6 +409,7 @@ public class DomainManagerImpl extends ManagerBase implements DomainManager, Dom
             _resourceLimitDao.removeEntriesByOwner(domainId, ResourceOwnerType.Domain);
         } else {
             s_logger.debug("Can't delete the domain yet because it has " + accountsForCleanup.size() + "accounts that need a cleanup");
+            return false;
         }
 
         return success && deleteDomainSuccess;


[08/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-2983: Fix protocol number field passing invalid values


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

Branch: refs/heads/sdnextensions
Commit: ef7d2740bdd04c217f92742941a7d44b1a87c40d
Parents: 7ea8c5f
Author: Brian Federle <br...@citrix.com>
Authored: Wed Jul 10 15:26:58 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Wed Jul 10 15:27:03 2013 -0700

----------------------------------------------------------------------
 ui/scripts/vpc.js | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ef7d2740/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index b93328f..17ea65e 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -185,7 +185,7 @@
                 $icmpFields.hide();
                 $otherFields.hide();
                 $protocolFields.show().addClass('required');
-                $portFields.show();
+                $inputs.filter('[name=startport],[name=endport]').show().attr('disabled', false);
               } else if ($(this).val() == 'icmp') {
                 $icmpFields.show();
                 $icmpFields.attr('disabled', false);
@@ -292,25 +292,27 @@
       action: function(args) {
         var $multi = args.$multi;
         //Support for Protocol Number between 0 to 255
-        if(args.data.protocol == 'protocolnumber'){
+        if (args.data.protocol === 'protocolnumber'){
           $.extend(args.data,{protocol:args.data.protocolnumber});
           delete args.data.protocolnumber;
-        }
-        else
+          delete args.data.startport;
+          delete args.data.endport;
+          delete args.data.icmptype;
+          delete args.data.icmpcode;
+        } else {
           delete args.data.protocolnumber;
+        }
 
-
-        
-        if((args.data.protocol == 'tcp' || args.data.protocol == 'udp') && (args.data.startport=="" || args.data.startport == undefined)){
+        if ((args.data.protocol == 'tcp' || args.data.protocol == 'udp') && (args.data.startport=="" || args.data.startport == undefined)){
           cloudStack.dialog.notice({message:_l('Start Port or End Port value should not be blank')});
           $(window).trigger('cloudStack.fullRefresh');
         }
-        else if((args.data.protocol == 'tcp' || args.data.protocol == 'udp')  && (args.data.endport=="" || args.data.endport == undefined)){
+        else if ((args.data.protocol == 'tcp' || args.data.protocol == 'udp')  && (args.data.endport=="" || args.data.endport == undefined)){
           cloudStack.dialog.notice({message:_l('Start Port or End Port value should not be blank')});
           $(window).trigger('cloudStack.fullRefresh');
         }
 
-        else{       
+        else {
           $.ajax({
             url: createURL('createNetworkACL'),
             data: $.extend(args.data, {


[34/50] git commit: updated refs/heads/sdnextensions to bcfb4e6

Posted by se...@apache.org.
CLOUDSTACK-3357: dnsmasq on vpc-routervm


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

Branch: refs/heads/sdnextensions
Commit: b903262df5e2ff5d174859ce28abae75c4689f0c
Parents: 7f2c659
Author: Daan Hoogland <dh...@schubergphilis.com>
Authored: Mon Jul 8 18:27:20 2013 +0200
Committer: Chip Childers <ch...@gmail.com>
Committed: Thu Jul 11 14:33:20 2013 +0100

----------------------------------------------------------------------
 .../VirtualNetworkApplianceManagerImpl.java     |  27 ++++-
 .../VpcVirtualNetworkApplianceManagerImpl.java  |  70 +++++++++++--
 ...cVirtualNetworkApplianceManagerImplTest.java | 100 +++++++++++++++++++
 server/test/resources/VpcVirtNetAppContext.xml  |  41 ++++++++
 4 files changed, 223 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b903262d/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index 8d73941..ed10369 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -1322,7 +1322,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
         }
         
     }
-    
+
     protected class CheckRouterTask implements Runnable {
 
         public CheckRouterTask() {
@@ -1588,6 +1588,12 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
             InsufficientAddressCapacityException, InsufficientServerCapacityException, InsufficientCapacityException,
             StorageUnavailableException, ResourceUnavailableException {
 
+        if(s_logger.isTraceEnabled()) {
+            s_logger.trace("deployRouter(" + owner.getAccountName() + ", " + dest.getHost() + ", " + plan.toString() + ", " + params.toString()
+                    + ", " + isRedundant + ", " + vrProvider.getUuid() + ", " + svcOffId + ", " + vpcId
+                    + ", list_of_" + networks.size() + "networks, " + startRouter + ", " + supportedHypervisors + ")");
+        }
+
         ServiceOfferingVO routerOffering = _serviceOfferingDao.findById(svcOffId);
 
         // Router is the network element, we don't know the hypervisor type yet.
@@ -1863,7 +1869,11 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
     private DomainRouterVO startVirtualRouter(DomainRouterVO router, User user, Account caller, Map<Param, Object> params) 
             throws StorageUnavailableException, InsufficientCapacityException,
     ConcurrentOperationException, ResourceUnavailableException {
-        
+
+        if(s_logger.isTraceEnabled()) {
+            s_logger.trace("startVirtualRouter(" + router.getHostName() + ", " + user.getUsername() + ", " + caller.getAccountName() + ", " + params.toString() + ")");
+        }
+
         if (router.getRole() != Role.VIRTUAL_ROUTER || !router.getIsRedundantRouter()) {
             return this.start(router, user, caller, params, null);
         }
@@ -2493,7 +2503,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
                    activeIpAliasTOs.add(new IpAliasTO(aliasVO.getIp4Address(), aliasVO.getNetmask(), aliasVO.getAliasCount().toString()));
             }
             if (revokedIpAliasTOs.size() != 0 || activeIpAliasTOs.size() != 0){
-            createDeleteIpAliasCommand(router, revokedIpAliasTOs, activeIpAliasTOs, guestNetworkId, cmds);
+                createDeleteIpAliasCommand(router, revokedIpAliasTOs, activeIpAliasTOs, guestNetworkId, cmds);
                 configDnsMasq(router, _networkDao.findById(guestNetworkId), cmds);
             }
 
@@ -2888,6 +2898,9 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
     public boolean applyDhcpEntry(Network network, final NicProfile nic, VirtualMachineProfile<UserVm> profile, 
             DeployDestination dest, List<DomainRouterVO> routers)
             throws ResourceUnavailableException {
+        if(s_logger.isTraceEnabled()) {
+            s_logger.trace("applyDhcpEntry(" + network.getCidr() + ", " + nic.getMacAddress() + ", " + profile.getUuid() + ", " + dest.getHost() + ", " + routers + ")");
+        }
         _userVmDao.loadDetails((UserVmVO) profile.getVirtualMachine());
         
         final VirtualMachineProfile<UserVm> updatedProfile = profile;
@@ -3429,6 +3442,9 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
     }
 
     private void configDnsMasq(VirtualRouter router, Network network, Commands cmds) {
+        if (s_logger.isTraceEnabled()) {
+            s_logger.trace("configDnsMasq(" + router.getHostName() + ", " + network.getNetworkDomain() + ", " + cmds + ")");
+        }
         DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId());
         List<NicIpAliasVO> ipAliasVOList = _nicIpAliasDao.listByNetworkIdAndState(network.getId(), NicIpAlias.state.active);
         List<DnsmasqTO> ipList = new ArrayList<DnsmasqTO>();
@@ -3443,6 +3459,9 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
         ipList.add(new DnsmasqTO(router_guest_nic.getIp4Address(),router_guest_nic.getGateway(),router_guest_nic.getNetmask(), startIpOfSubnet));
         for (NicIpAliasVO ipAliasVO : ipAliasVOList) {
              DnsmasqTO dnsmasqTO = new DnsmasqTO(ipAliasVO.getIp4Address(), ipAliasVO.getGateway(), ipAliasVO.getNetmask(), ipAliasVO.getStartIpOfSubnet());
+             if (s_logger.isTraceEnabled()) {
+                 s_logger.trace("configDnsMasq : adding ip {" + dnsmasqTO.getGateway() + ", " + dnsmasqTO.getNetmask() + ", " + dnsmasqTO.getRouterIp() + ", " + dnsmasqTO.getStartIpOfSubnet() + "}");
+             }
              ipList.add(dnsmasqTO);
              ipAliasVO.setVmId(router.getId());
         }
@@ -3453,7 +3472,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
         dnsMasqConfigCmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP, getRouterIpInNetwork(network.getId(), router.getId()));
         dnsMasqConfigCmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE, dcVo.getNetworkType().toString());
 
-        cmds.addCommand("dhcpConfig" ,dnsMasqConfigCmd);
+        cmds.addCommand("dnsMasqConfig" ,dnsMasqConfigCmd);
         //To change body of created methods use File | Settings | File Templates.
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b903262d/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
index 7115499..51c072c 100644
--- a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
@@ -40,12 +40,14 @@ import com.cloud.agent.api.SetupGuestNetworkCommand;
 import com.cloud.agent.api.StopAnswer;
 import com.cloud.agent.api.UnPlugNicAnswer;
 import com.cloud.agent.api.UnPlugNicCommand;
+import com.cloud.agent.api.routing.DnsMasqConfigCommand;
 import com.cloud.agent.api.routing.IpAssocVpcCommand;
 import com.cloud.agent.api.routing.NetworkElementCommand;
 import com.cloud.agent.api.routing.SetNetworkACLCommand;
 import com.cloud.agent.api.routing.SetSourceNatCommand;
 import com.cloud.agent.api.routing.SetStaticRouteCommand;
 import com.cloud.agent.api.routing.Site2SiteVpnCfgCommand;
+import com.cloud.agent.api.to.DnsmasqTO;
 import com.cloud.agent.api.to.IpAddressTO;
 import com.cloud.agent.api.to.NetworkACLTO;
 import com.cloud.agent.api.to.NicTO;
@@ -170,6 +172,9 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
     public List<DomainRouterVO> deployVirtualRouterInVpc(Vpc vpc, DeployDestination dest, Account owner, 
             Map<Param, Object> params) throws InsufficientCapacityException,
             ConcurrentOperationException, ResourceUnavailableException {
+        if(s_logger.isTraceEnabled()) {
+            s_logger.trace("deployVirtualRouterInVpc(" + vpc.getName() +", "+dest.getHost()+", "+owner.getAccountName()+", "+params.toString()+")");
+        }
 
         List<DomainRouterVO> routers = findOrDeployVirtualRouterInVpc(vpc, dest, owner, params);
         
@@ -247,7 +252,9 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
     @Override
     public boolean addVpcRouterToGuestNetwork(VirtualRouter router, Network network, boolean isRedundant) 
             throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
-        
+        if (s_logger.isTraceEnabled()) {
+            s_logger.trace("addVpcRouterToGuestNetwork(" + router.getUuid() + ", " + network.getCidr() + ", " + isRedundant + ")");
+        }
         if (network.getTrafficType() != TrafficType.Guest) {
             s_logger.warn("Network " + network + " is not of type " + TrafficType.Guest);
             return false;
@@ -319,7 +326,10 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
             Long vpcId, PublicIp sourceNatIp) throws ConcurrentOperationException, 
             InsufficientAddressCapacityException, InsufficientServerCapacityException, InsufficientCapacityException, 
             StorageUnavailableException, ResourceUnavailableException {
-        
+        if(s_logger.isTraceEnabled()) {
+            s_logger.trace("deployVpcRouter(" + owner.getAccountName() + ", " + dest.getHost() + ", " + plan.toString() + ", " + params.toString()
+                    + ", " + isRedundant + ", " + vrProvider.getUuid() + ", " + svcOffId + ", " + vpcId + ", " + sourceNatIp + ")");
+        }
         List<Pair<NetworkVO, NicProfile>> networks = createVpcRouterNetworks(owner, isRedundant, plan, new Pair<Boolean, PublicIp>(true, sourceNatIp),
                 vpcId);
         DomainRouterVO router = 
@@ -769,12 +779,15 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
     @Override
     public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile<DomainRouterVO> profile) {
         DomainRouterVO router = profile.getVirtualMachine();
+        if(s_logger.isTraceEnabled()) {
+            s_logger.trace("finalizeCommandsOnStart(" + cmds + ", " + profile.getHostName() + ")");
+        }
 
         boolean isVpc = (router.getVpcId() != null);
         if (!isVpc) {
             return super.finalizeCommandsOnStart(cmds, profile);
         }
-        
+
         //1) FORM SSH CHECK COMMAND
         NicProfile controlNic = getControlNic(profile);
         if (controlNic == null) {
@@ -783,7 +796,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
         }
 
         finalizeSshAndVersionAndNetworkUsageOnStart(cmds, profile, router, controlNic);
-        
+
         //2) FORM PLUG NIC COMMANDS
         List<Pair<Nic, Network>> guestNics = new ArrayList<Pair<Nic, Network>>();
         List<Pair<Nic, Network>> publicNics = new ArrayList<Pair<Nic, Network>>();
@@ -936,16 +949,44 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
 
         //Add network usage commands
         cmds.addCommands(usageCmds);
-        
+        configDnsMasq(router, cmds);
+
         return true;
     }
-    
-    
+
+    protected void configDnsMasq(VirtualRouter router, Commands cmds) {
+        if (s_logger.isTraceEnabled()) {
+            s_logger.trace("configDnsMasq(" + router.getHostName() + ", " + cmds + ")");
+        }
+        VpcVO vpc = _vpcDao.findById(router.getVpcId());
+        DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId());
+        List<DnsmasqTO> ipList = new ArrayList<DnsmasqTO>();
+
+        String cidr = vpc.getCidr();
+        String[] cidrPair = cidr.split("\\/");
+        String cidrAddress = cidrPair[0];
+        long cidrSize = Long.parseLong(cidrPair[1]);
+        String startIpOfSubnet = NetUtils.getIpRangeStartIpFromCidr(cidrAddress, cidrSize);
+        DnsmasqTO dnsmasqTO = new DnsmasqTO(router.getPrivateIpAddress(), router.getPublicIpAddress(), NetUtils.getCidrNetmask(cidrSize), startIpOfSubnet);
+        ipList.add(dnsmasqTO);
+
+        DnsMasqConfigCommand dnsMasqConfigCmd = new DnsMasqConfigCommand(vpc.getNetworkDomain(),ipList, dcVo.getDns1(), dcVo.getDns2(), dcVo.getInternalDns1(), dcVo.getInternalDns2());
+        dnsMasqConfigCmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, getRouterControlIp(router.getId()));
+        dnsMasqConfigCmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName());
+        dnsMasqConfigCmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP, router.getPublicIpAddress());
+        dnsMasqConfigCmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE, dcVo.getNetworkType().toString());
+
+        cmds.addCommand("dnsMasqConfig" ,dnsMasqConfigCmd);
+        //To change body of created methods use File | Settings | File Templates.
+    }
+
+
     @Override
     protected void finalizeNetworkRulesForNetwork(Commands cmds, DomainRouterVO router, Provider provider, Long guestNetworkId) {
-        
+        if(s_logger.isTraceEnabled()) {
+            s_logger.trace("finalizing network config for "+ router.getHostName());
+        }
         super.finalizeNetworkRulesForNetwork(cmds, router, provider, guestNetworkId);
-        
         if (router.getVpcId() != null) {
             if (_networkModel.isProviderSupportServiceInNetwork(guestNetworkId, Service.NetworkACL, Provider.VPCVirtualRouter)) {
                 List<NetworkACLItemVO> networkACLs = _networkACLMgr.listNetworkACLItems(guestNetworkId);
@@ -955,6 +996,10 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
                     createNetworkACLsCommands(networkACLs, router, cmds, guestNetworkId, false);
                 }
             }
+            
+            if(s_logger.isDebugEnabled()) {
+                s_logger.debug("setup the vpc domain on router " + router.getHostName());
+            }
         }
     }
 
@@ -999,7 +1044,10 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
      */
     protected boolean setupVpcPrivateNetwork(VirtualRouter router, boolean add, NicProfile privateNic) 
             throws ResourceUnavailableException {
-        
+        if(s_logger.isTraceEnabled()) {
+            s_logger.trace("deployVpcRouter(" + router.getHostName() + ", " + add + ", " + privateNic.getMacAddress() + ")");
+        }
+
         if (router.getState() == State.Running) {
             PrivateIpVO ipVO = _privateIpDao.findByIpAndSourceNetworkId(privateNic.getNetworkId(), privateNic.getIp4Address());
             Network network = _networkDao.findById(privateNic.getNetworkId());
@@ -1011,7 +1059,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
             privateIps.add(ip);
             Commands cmds = new Commands(OnError.Stop);
             createVpcAssociatePrivateIPCommands(router, privateIps, cmds, add);
-            
+
             if (sendCommandsToRouter(router, cmds)) {
                 s_logger.debug("Successfully applied ip association for ip " + ip + " in vpc network " + network);
                 return true;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b903262d/server/test/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImplTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImplTest.java b/server/test/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImplTest.java
new file mode 100644
index 0000000..04a3601
--- /dev/null
+++ b/server/test/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImplTest.java
@@ -0,0 +1,100 @@
+// 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.router;
+
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+
+import org.apache.log4j.Logger;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+import com.cloud.agent.AgentManager.OnError;
+import com.cloud.agent.api.routing.DnsMasqConfigCommand;
+import com.cloud.agent.manager.Commands;
+import com.cloud.dc.DataCenter.NetworkType;
+import com.cloud.dc.DataCenterVO;
+import com.cloud.dc.dao.DataCenterDao;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.network.NetworkManager;
+import com.cloud.network.router.VirtualRouter.RedundantState;
+import com.cloud.network.vpc.VpcVO;
+import com.cloud.network.vpc.dao.VpcDao;
+import com.cloud.vm.DomainRouterVO;
+import com.cloud.vm.NicVO;
+import com.cloud.vm.dao.DomainRouterDao;
+import com.cloud.vm.dao.NicDao;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(locations="classpath:/VpcVirtNetAppContext.xml")
+public class VpcVirtualNetworkApplianceManagerImplTest {
+    private static final Logger s_logger = Logger.getLogger(VpcVirtualNetworkApplianceManagerImplTest.class);
+
+    @Mock DataCenterDao _dcDao;
+    @Mock VpcDao _vpcDao;
+    @Mock VirtualRouter router;
+    @Mock NicDao _nicDao;
+    @Mock DomainRouterDao _routerDao; 
+
+    @Before
+    public void setup() {
+        MockitoAnnotations.initMocks(this);
+
+    }
+
+    @Test
+    public void testConfigDnsMasq() {
+        VpcVirtualNetworkApplianceManagerImpl vpcVirtNetAppMgr = new VpcVirtualNetworkApplianceManagerImpl();
+        vpcVirtNetAppMgr._vpcDao = _vpcDao;
+        vpcVirtNetAppMgr._dcDao = _dcDao;
+        vpcVirtNetAppMgr._nicDao = _nicDao;
+        vpcVirtNetAppMgr._routerDao = _routerDao;
+        when(router.getId()).thenReturn(1L);
+        when(router.getVpcId()).thenReturn(1L);
+        when(router.getDataCenterId()).thenReturn(1L);
+        VpcVO vpc = new VpcVO(1L,"bla","bla",1L,1L,1L,"10.0.0.0/8","blieb.net");
+        when( _vpcDao.findById(1L)).thenReturn(vpc);
+        DataCenterVO dcVo = new DataCenterVO(1L,"dc","dc","8.8.8.8",null,null,null,"10.0.0.0/8","bla.net",new Long(1L),NetworkType.Advanced,null,".net");
+        when( _dcDao.findById(1L) ).thenReturn(dcVo);
+        DomainRouterVO routerVo = new DomainRouterVO(1L,1L,1L,"brr",1L,HypervisorType.Any,1L,1L,1L,false,0,false,RedundantState.MASTER,false,false,1L);
+        when( _routerDao.findById(1L)).thenReturn(routerVo);
+//        when( vpcVirtNetAppMgr.getRouterControlIp(1L)).thenReturn("10.0.0.1");
+        when( router.getInstanceName()).thenReturn("r-vm-1");
+        when( router.getPublicIpAddress()).thenReturn("11.11.11.11");
+        when( _nicDao.listByVmId(1L)).thenReturn(new ArrayList<NicVO>());
+        NetworkManager netMgr = mock(NetworkManager.class);
+        vpcVirtNetAppMgr._networkMgr = netMgr;
+
+        Commands cmds = new Commands(OnError.Stop);
+
+        vpcVirtNetAppMgr.configDnsMasq(router, cmds);
+        Assert.assertEquals("expected one command",1,cmds.size());
+        
+        DnsMasqConfigCommand cmd = cmds.getCommand(DnsMasqConfigCommand.class);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b903262d/server/test/resources/VpcVirtNetAppContext.xml
----------------------------------------------------------------------
diff --git a/server/test/resources/VpcVirtNetAppContext.xml b/server/test/resources/VpcVirtNetAppContext.xml
new file mode 100644
index 0000000..f8a8aa4
--- /dev/null
+++ b/server/test/resources/VpcVirtNetAppContext.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. -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+  xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/tx 
+                      http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
+                      http://www.springframework.org/schema/aop
+                      http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+  <context:annotation-config />
+
+  <!-- @DB support -->
+<!-- 
+  <bean id="vpcVirtualNetworkApplianceManager" class="com.cloud.network.router.VpcVirtualNetworkApplianceManagerImpl" />
+  <bean id="vpcDao" class="com.cloud.network.vpc.dao.VpcDaoImpl" />
+  <bean id="nicDao" class="com.cloud.vm.dao.NicDaoImpl" />
+  <bean id="dcDao" class="com.cloud.dc.dao.DataCenterDaoImpl" />
+ -->
+  <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
+  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
+    <property name="Interceptors">
+        <list>
+            <ref bean="transactionContextBuilder" />
+        </list>
+    </property>
+  </bean>
+
+ </beans>