cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject git commit: updated refs/heads/volume-upload-master to 96e45e0
Date Wed, 29 Apr 2015 04:07:52 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/volume-upload-master [created] 96e45e08e


Merge branch 'volume-upload' into master


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

Branch: refs/heads/volume-upload-master
Commit: 96e45e08ed413f35d72a3daae3eced67f2b75b41
Parents: 07c3089 faaa136
Author: Rajani Karuturi <rajanikaruturi@gmail.com>
Authored: Wed Apr 29 09:36:00 2015 +0530
Committer: Rajani Karuturi <rajanikaruturi@gmail.com>
Committed: Wed Apr 29 09:36:00 2015 +0530

----------------------------------------------------------------------
 agent/pom.xml                                   |    1 +
 api/src/com/cloud/storage/Volume.java           |   24 +-
 api/src/com/cloud/storage/VolumeApiService.java |    6 +
 .../com/cloud/template/TemplateApiService.java  |    5 +
 .../cloud/template/VirtualMachineTemplate.java  |   42 +-
 .../api/AbstractGetUploadParamsCmd.java         |   89 +
 .../org/apache/cloudstack/api/ApiConstants.java |    2 +
 .../template/GetUploadParamsForTemplateCmd.java |  183 ++
 .../volume/GetUploadParamsForVolumeCmd.java     |   83 +
 .../api/response/GetUploadParamsResponse.java   |   84 +
 client/tomcatconf/commands.properties.in        |    4 +
 core/pom.xml                                    |   14 -
 .../cloud/agent/api/SecStorageSetupCommand.java |    8 +
 .../template/HttpTemplateDownloader.java        |    4 +-
 .../TemplateOrVolumePostUploadCommand.java      |  199 ++
 .../storage/command/UploadStatusAnswer.java     |   88 +
 .../storage/command/UploadStatusCommand.java    |   53 +
 .../subsystem/api/storage/VolumeService.java    |    3 +
 .../src/com/cloud/storage/VMTemplateVO.java     |    3 +
 .../com/cloud/storage/dao/VMTemplateDao.java    |    4 +-
 .../cloud/storage/dao/VMTemplateDaoImpl.java    |   72 +
 .../datastore/db/TemplateDataStoreDao.java      |    3 +
 .../datastore/db/VolumeDataStoreDao.java        |    3 +
 .../storage/image/TemplateServiceImpl.java      |   60 +-
 .../storage/image/store/TemplateObject.java     |   20 +-
 .../datastore/ObjectInDataStoreManagerImpl.java |    2 +
 .../storage/image/TemplateEntityImpl.java       |   17 +
 .../image/db/TemplateDataStoreDaoImpl.java      |   22 +-
 .../image/db/VolumeDataStoreDaoImpl.java        |   28 +-
 .../storage/volume/VolumeServiceImpl.java       |   63 +-
 framework/db/pom.xml                            |    1 +
 framework/jobs/pom.xml                          |    1 +
 framework/spring/module/pom.xml                 |    1 +
 .../manager/BareMetalTemplateAdapter.java       |   10 +-
 plugins/hypervisors/kvm/pom.xml                 |    1 +
 .../cloud/agent/manager/MockStorageManager.java |    5 +
 .../agent/manager/MockStorageManagerImpl.java   |    9 +-
 .../agent/manager/SimulatorManagerImpl.java     |    3 +
 pom.xml                                         |    2 +-
 server/pom.xml                                  |    2 +
 .../spring-server-core-managers-context.xml     |    1 +
 .../com/cloud/api/query/QueryManagerImpl.java   |    2 +-
 .../api/query/dao/TemplateJoinDaoImpl.java      |    4 +-
 server/src/com/cloud/configuration/Config.java  |    4 +-
 .../cloud/server/ConfigurationServerImpl.java   |   44 +-
 .../com/cloud/server/ManagementServerImpl.java  |    5 +-
 .../cloud/storage/ImageStoreUploadMonitor.java  |   27 +
 .../storage/ImageStoreUploadMonitorImpl.java    |  436 +++
 .../com/cloud/storage/StorageManagerImpl.java   |  154 +-
 .../com/cloud/storage/VolumeApiServiceImpl.java |  145 +-
 .../template/HypervisorTemplateAdapter.java     |  102 +-
 .../src/com/cloud/template/TemplateAdapter.java |    7 +
 .../com/cloud/template/TemplateAdapterBase.java |   39 +-
 .../com/cloud/template/TemplateManagerImpl.java |   72 +-
 services/iam/server/pom.xml                     |    1 +
 .../SecondaryStorageManagerImpl.java            |    4 +
 services/secondary-storage/server/pom.xml       |    7 +
 .../resource/HttpUploadServerHandler.java       |  295 ++
 .../resource/NfsSecondaryStorageResource.java   |  433 ++-
 .../storage/template/DownloadManager.java       |    3 +
 .../storage/template/DownloadManagerImpl.java   |    7 +-
 .../storage/template/UploadEntity.java          |  201 ++
 .../debian/config/etc/init.d/cloud-early-config |   30 +
 systemvm/scripts/config_ssl.sh                  |   24 +
 .../component/test_browse_templates.py          | 1684 +++++++++++
 .../component/test_browse_volumes.py            | 2686 ++++++++++++++++++
 test/pom.xml                                    |    5 -
 tools/marvin/marvin/config/test_data.py         |   34 +-
 ui/scripts/storage.js                           |  194 +-
 ui/scripts/templates.js                         |  327 ++-
 ui/scripts/ui/dialog.js                         |  141 +-
 utils/pom.xml                                   |   14 +-
 utils/src/com/cloud/utils/EncryptionUtil.java   |   69 +
 .../utils/imagestore/ImageStoreUtil.java        |  110 +
 .../utils/template/TemplateUtils.java           |   97 -
 .../utils/imagestore/ImageStoreUtilTest.java    |   38 +
 76 files changed, 8363 insertions(+), 307 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/api/src/com/cloud/storage/Volume.java
----------------------------------------------------------------------
diff --cc api/src/com/cloud/storage/Volume.java
index f0c7000,b7a5eeb..9f5f502
mode 100644,100755..100644
--- a/api/src/com/cloud/storage/Volume.java
+++ b/api/src/com/cloud/storage/Volume.java

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/api/src/com/cloud/storage/VolumeApiService.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/api/src/com/cloud/template/TemplateApiService.java
----------------------------------------------------------------------
diff --cc api/src/com/cloud/template/TemplateApiService.java
index 9a2e215,43177fc..43177fc
mode 100644,100755..100644
--- a/api/src/com/cloud/template/TemplateApiService.java
+++ b/api/src/com/cloud/template/TemplateApiService.java

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/api/src/com/cloud/template/VirtualMachineTemplate.java
----------------------------------------------------------------------
diff --cc api/src/com/cloud/template/VirtualMachineTemplate.java
index 599212b,54d61a4..54d61a4
mode 100644,100755..100644
--- a/api/src/com/cloud/template/VirtualMachineTemplate.java
+++ b/api/src/com/cloud/template/VirtualMachineTemplate.java

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/api/src/org/apache/cloudstack/api/ApiConstants.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/ApiConstants.java
index 4ab10fa,54604f3..2b64258
mode 100644,100755..100644
--- a/api/src/org/apache/cloudstack/api/ApiConstants.java
+++ b/api/src/org/apache/cloudstack/api/ApiConstants.java
@@@ -616,10 -614,7 +617,11 @@@ public class ApiConstants 
      public static final String REGION_LEVEL_VPC = "regionlevelvpc";
      public static final String STRECHED_L2_SUBNET = "strechedl2subnet";
      public static final String NETWORK_SPANNED_ZONES = "zonesnetworkspans";
+     public static final String METADATA = "metadata";
 +    public static final String PHYSICAL_SIZE = "physicalsize";
 +    public static final String OVM3_POOL = "ovm3pool";
 +    public static final String OVM3_CLUSTER = "ovm3cluster";
 +    public static final String OVM3_VIP = "ovm3vip";
  
      public enum HostDetails {
          all, capacity, events, stats, min;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeService.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/engine/schema/src/com/cloud/storage/VMTemplateVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/storage/VMTemplateVO.java
index d44de22,dd2b35a..dd2b35a
mode 100644,100755..100644
--- a/engine/schema/src/com/cloud/storage/VMTemplateVO.java
+++ b/engine/schema/src/com/cloud/storage/VMTemplateVO.java

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/engine/schema/src/com/cloud/storage/dao/VMTemplateDao.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/storage/dao/VMTemplateDao.java
index 2b815d8,a3adffc..a3adffc
mode 100644,100755..100644
--- a/engine/schema/src/com/cloud/storage/dao/VMTemplateDao.java
+++ b/engine/schema/src/com/cloud/storage/dao/VMTemplateDao.java

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
index 401a4a2,90196a8..90196a8
mode 100644,100755..100644
--- a/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
----------------------------------------------------------------------
diff --cc engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
index c5ca5b9,197caa7..473959b
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
@@@ -166,7 -165,7 +165,7 @@@ public class TemplateObject implements 
      }
  
      @Override
-     public void processEvent(Event event) {
 -    public void processEvent(org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine.Event
event) {
++    public void processEvent(ObjectInDataStoreStateMachine.Event event) {
          try {
              objectInStoreMgr.update(this, event);
          } catch (NoTransitionException e) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
----------------------------------------------------------------------
diff --cc engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
index 3a52c83,436c462..a2fd656
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
@@@ -26,8 -26,8 +26,9 @@@ import java.util.Map
  
  import javax.inject.Inject;
  
 +import com.cloud.offering.DiskOffering;
  import com.cloud.storage.RegisterVolumePayload;
+ import com.cloud.utils.Pair;
  import org.apache.cloudstack.engine.cloud.entity.api.VolumeEntity;
  import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo;
  import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
@@@ -1226,18 -1224,25 +1227,31 @@@ public class VolumeServiceImpl implemen
          return future;
      }
  
+     @Override
+     public Pair<EndPoint,DataObject> registerVolumeForPostUpload(VolumeInfo volume,
DataStore store) {
+ 
+         EndPoint ep = _epSelector.select(store);
+         if (ep == null) {
+             String errorMessage = "There is no secondary storage VM for image store " +
store.getName();
+             s_logger.warn(errorMessage);
+             throw new CloudRuntimeException(errorMessage);
+         }
+         DataObject volumeOnStore = store.create(volume);
+         return new Pair<>(ep,volumeOnStore);
+     }
+ 
      protected Void registerVolumeCallback(AsyncCallbackDispatcher<VolumeServiceImpl,
CreateCmdResult> callback, CreateVolumeContext<VolumeApiResult> context) {
          CreateCmdResult result = callback.getResult();
 +        VolumeObject vo = (VolumeObject)context.volume;
          try {
 -            VolumeObject vo = (VolumeObject)context.volume;
              if (result.isFailed()) {
                  vo.processEvent(Event.OperationFailed);
 +                // delete the volume entry from volumes table in case of failure
 +                VolumeVO vol = volDao.findById(vo.getId());
 +                if (vol != null) {
 +                    volDao.remove(vo.getId());
 +                }
 +
              } else {
                  vo.processEvent(Event.OperationSuccessed, result.getAnswer());
  
@@@ -1385,13 -1385,12 +1399,13 @@@
                          return;
                      }
  
 -                    List<VolumeDataStoreVO> dbVolumes = _volumeStoreDao.listUploadedVolumesByStoreId(storeId);
 +                    // find all the db volumes including those with NULL url column to avoid
accidentally deleting volumes on image store later.
 +                    List<VolumeDataStoreVO> dbVolumes = _volumeStoreDao.listByStoreId(storeId);
                      List<VolumeDataStoreVO> toBeDownloaded = new ArrayList<VolumeDataStoreVO>(dbVolumes);
                      for (VolumeDataStoreVO volumeStore : dbVolumes) {
 -                        VolumeVO volume = _volumeDao.findById(volumeStore.getVolumeId());
 +                        VolumeVO volume = volDao.findById(volumeStore.getVolumeId());
                          if (volume == null) {
-                             s_logger.warn("Volume_store_ref shows that volume " + volumeStore.getVolumeId()
+ " is on image store " + storeId +
+                             s_logger.warn("Volume_store_ref table shows that volume " +
volumeStore.getVolumeId() + " is on image store " + storeId +
                                      ", but the volume is not found in volumes table, potentially
some bugs in deleteVolume, so we just treat this volume to be deleted and mark it as destroyed");
                              volumeStore.setDestroyed(true);
                              _volumeStoreDao.update(volumeStore.getId(), volumeStore);
@@@ -1434,9 -1436,14 +1451,14 @@@
                                  if (volume.getSize() == 0) {
                                      // Set volume size in volumes table
                                      volume.setSize(volInfo.getSize());
 -                                    _volumeDao.update(volumeStore.getVolumeId(), volume);
 +                                    volDao.update(volumeStore.getVolumeId(), volume);
                                  }
  
+                                 if (volume.getState() == State.NotUploaded || volume.getState()
== State.UploadInProgress) {
+                                     VolumeObject volObj = (VolumeObject)volFactory.getVolume(volume.getId());
+                                     volObj.processEvent(Event.OperationSuccessed);
+                                 }
+ 
                                  if (volInfo.getSize() > 0) {
                                      try {
                                          _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(volume.getAccountId()),
@@@ -1456,8 -1472,8 +1487,7 @@@
                          }
                          // Volume is not on secondary but we should download.
                          if (volumeStore.getDownloadState() != Status.DOWNLOADED) {
-                             s_logger.info("Volume Sync did not find " + volume.getName()
+ " ready on image store " + storeId +
-                                     ", will request download to start/resume shortly");
+                             s_logger.info("Volume Sync did not find " + volume.getName()
+ " ready on image store " + storeId + ", will request download to start/resume shortly");
 -                            toBeDownloaded.add(volumeStore);
                          }
                      }
  

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java
----------------------------------------------------------------------
diff --cc plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java
index 1be3439,17dab00..17dab00
mode 100644,100755..100644
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/plugins/hypervisors/kvm/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
----------------------------------------------------------------------
diff --cc plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
index 46ddd95,27be6f8..bd7e9e8
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
@@@ -31,8 -35,7 +31,9 @@@ import org.apache.cloudstack.storage.co
  import org.apache.cloudstack.storage.command.DownloadCommand;
  import org.apache.cloudstack.storage.command.DownloadProgressCommand;
  import org.apache.cloudstack.storage.command.StorageSubSystemCommand;
+ import org.apache.cloudstack.storage.command.UploadStatusCommand;
 +import org.apache.log4j.Logger;
 +import org.springframework.stereotype.Component;
  
  import com.cloud.agent.api.Answer;
  import com.cloud.agent.api.AttachIsoCommand;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/pom.xml
----------------------------------------------------------------------
diff --cc pom.xml
index 175394c,6f7bd34..0c55e33
--- a/pom.xml
+++ b/pom.xml
@@@ -57,21 -53,20 +57,21 @@@
      <cs.junit.version>4.11</cs.junit.version>
      <cs.hamcrest.version>1.3</cs.hamcrest.version>
      <cs.bcprov.version>1.46</cs.bcprov.version>
 -    <cs.jsch.version>0.1.42</cs.jsch.version>
 -    <cs.jpa.version>2.0.0</cs.jpa.version>
 -    <cs.jasypt.version>1.9.0</cs.jasypt.version>
 -    <cs.trilead.version>build213-svnkit-1.3-patch</cs.trilead.version>
 -    <cs.ehcache.version>2.6.6</cs.ehcache.version>
 +    <cs.jsch.version>0.1.51</cs.jsch.version>
 +    <cs.jpa.version>2.1.0</cs.jpa.version>
 +    <cs.jasypt.version>1.9.2</cs.jasypt.version>
 +    <cs.trilead.version>1.0.0-build217</cs.trilead.version>
 +    <cs.ehcache.version>2.6.9</cs.ehcache.version>
      <cs.gson.version>1.7.2</cs.gson.version>
 -    <cs.guava.version>14.0-rc1</cs.guava.version>
 +    <cs.guava.version>18.0</cs.guava.version>
      <cs.xapi.version>6.2.0-3.1</cs.xapi.version>
      <cs.httpclient.version>4.3.6</cs.httpclient.version>
-     <cs.httpcore.version>4.3.3</cs.httpcore.version>
+     <cs.httpcore.version>4.4</cs.httpcore.version>
 -    <cs.mysql.version>5.1.21</cs.mysql.version>
 -    <cs.xstream.version>1.3.1</cs.xstream.version>
 +    <cs.commons-httpclient.version>3.1</cs.commons-httpclient.version>
 +    <cs.mysql.version>5.1.34</cs.mysql.version>
 +    <cs.xstream.version>1.4.7</cs.xstream.version>
      <cs.xmlrpc.version>3.1.3</cs.xmlrpc.version>
 -    <cs.mail.version>1.4</cs.mail.version>
 +    <cs.mail.version>1.4.7</cs.mail.version>
      <cs.axis.version>1.4</cs.axis.version>
      <cs.axis2.version>1.5.6</cs.axis2.version>
      <cs.rampart.version>1.5.1</cs.rampart.version>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/server/src/com/cloud/api/query/QueryManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/server/src/com/cloud/configuration/Config.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/configuration/Config.java
index e48e0b3,4d6fb53..1d0a387
mode 100644,100755..100644
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/server/src/com/cloud/server/ConfigurationServerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/server/ConfigurationServerImpl.java
index 157ea03,d12bd6b..a28d984
mode 100644,100755..100644
--- a/server/src/com/cloud/server/ConfigurationServerImpl.java
+++ b/server/src/com/cloud/server/ConfigurationServerImpl.java

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/server/ManagementServerImpl.java
index 1723c1e,66fa52a..a187d4e
mode 100644,100755..100644
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@@ -39,8 -37,9 +39,10 @@@ import javax.crypto.spec.SecretKeySpec
  import javax.inject.Inject;
  import javax.naming.ConfigurationException;
  
 +import org.apache.cloudstack.api.command.admin.usage.RemoveRawUsageRecordsCmd;
  import org.apache.cloudstack.api.command.user.snapshot.UpdateSnapshotPolicyCmd;
+ import org.apache.cloudstack.api.command.user.template.GetUploadParamsForTemplateCmd;
+ import org.apache.cloudstack.api.command.user.volume.GetUploadParamsForVolumeCmd;
  import org.apache.commons.codec.binary.Base64;
  import org.apache.log4j.Logger;
  import org.apache.cloudstack.acl.ControlledEntity;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/storage/StorageManagerImpl.java
index 2a46592,91e4047..f31095b
mode 100644,100755..100644
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@@ -41,10 -41,8 +41,9 @@@ import javax.ejb.Local
  import javax.inject.Inject;
  import javax.naming.ConfigurationException;
  
 +import com.cloud.hypervisor.Hypervisor;
  import org.apache.log4j.Logger;
  import org.springframework.stereotype.Component;
- 
  import org.apache.cloudstack.api.command.admin.storage.CancelPrimaryStorageMaintenanceCmd;
  import org.apache.cloudstack.api.command.admin.storage.CreateSecondaryStagingStoreCmd;
  import org.apache.cloudstack.api.command.admin.storage.CreateStoragePoolCmd;
@@@ -269,7 -270,7 +272,9 @@@ public class StorageManagerImpl extend
      @Inject
      EndPointSelector _epSelector;
      @Inject
 +    private DiskOfferingDao _diskOfferingDao;
++    @Inject
+     ResourceLimitService _resourceLimitMgr;
  
      protected List<StoragePoolDiscoverer> _discoverers;
  
@@@ -588,15 -585,11 +593,15 @@@
  
                  store = lifeCycle.initialize(params);
              } else {
-                 store = dataStoreMgr.getDataStore(pool.getId(), DataStoreRole.Primary);
+                 store = _dataStoreMgr.getDataStore(pool.getId(), DataStoreRole.Primary);
              }
  
 -            HostScope scope = new HostScope(host.getId(), host.getClusterId(), host.getDataCenterId());
 -            lifeCycle.attachHost(store, scope, pInfo);
 +            pool = _storagePoolDao.findById(store.getId());
 +            if (pool.getStatus() != StoragePoolStatus.Maintenance && pool.getStatus()
!= StoragePoolStatus.Removed) {
 +                HostScope scope = new HostScope(host.getId(), host.getClusterId(), host.getDataCenterId());
 +                lifeCycle.attachHost(store, scope, pInfo);
 +            }
 +
          } catch (Exception e) {
              s_logger.warn("Unable to setup the local storage pool for " + host, e);
              throw new ConnectionException(true, "Unable to setup the local storage pool
for " + host, e);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/storage/VolumeApiServiceImpl.java
index dbae194,7e12284..7a450e7
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@@ -291,22 -375,24 +384,26 @@@ public class VolumeApiServiceImpl exten
              throw new PermissionDeniedException("Cannot perform this operation, Zone is
currently disabled: " + zoneId);
          }
  
-         if (url.toLowerCase().contains("file://")) {
-             throw new InvalidParameterValueException("File:// type urls are currently unsupported");
-         }
- 
-         ImageFormat imgfmt = ImageFormat.valueOf(format.toUpperCase());
-         if (imgfmt == null) {
-             throw new IllegalArgumentException("Image format is incorrect " + format + ".
Supported formats are " + EnumUtils.listValues(ImageFormat.values()));
-         }
- 
-         UriUtils.validateUrl(format, url);
- 
+         //validating the url only when url is not null. url can be null incase of form based
post upload
+         if (url != null ) {
+             if( url.toLowerCase().contains("file://")) {
+                 throw new InvalidParameterValueException("File:// type urls are currently
unsupported");
+             }
+             UriUtils.validateUrl(format, url);
 +        // check URL existence
 +        UriUtils.checkUrlExistence(url);
+             // Check that the resource limit for secondary storage won't be exceeded
+             _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(ownerId), ResourceType.secondary_storage,
UriUtils.getRemoteSize(url));
+         } else {
+             _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(ownerId), ResourceType.secondary_storage);
+         }
  
-         // Check that the resource limit for secondary storage won't be exceeded
-         _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(ownerId), ResourceType.secondary_storage,
UriUtils.getRemoteSize(url));
+         try {
+             ImageFormat.valueOf(format.toUpperCase());
+         } catch (IllegalArgumentException e) {
+             s_logger.debug("ImageFormat IllegalArgumentException: " + e.getMessage());
+             throw new IllegalArgumentException("Image format: " + format + " is incorrect.
Supported formats are " + EnumUtils.listValues(ImageFormat.values()));
+         }
  
          // Check that the the disk offering specified is valid
          if (diskOfferingId != null) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/server/src/com/cloud/template/HypervisorTemplateAdapter.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/template/HypervisorTemplateAdapter.java
index e58edb9,38a145b..369262b
mode 100644,100755..100644
--- a/server/src/com/cloud/template/HypervisorTemplateAdapter.java
+++ b/server/src/com/cloud/template/HypervisorTemplateAdapter.java

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/server/src/com/cloud/template/TemplateAdapter.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/template/TemplateAdapter.java
index a85e337,4ed0a81..4ed0a81
mode 100644,100755..100644
--- a/server/src/com/cloud/template/TemplateAdapter.java
+++ b/server/src/com/cloud/template/TemplateAdapter.java

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/server/src/com/cloud/template/TemplateAdapterBase.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/template/TemplateAdapterBase.java
index 92383a0,c5d0c5b..c5d0c5b
mode 100644,100755..100644
--- a/server/src/com/cloud/template/TemplateAdapterBase.java
+++ b/server/src/com/cloud/template/TemplateAdapterBase.java

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/template/TemplateManagerImpl.java
index c322b12,af35dd8..1135518
mode 100644,100755..100644
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/services/secondary-storage/controller/src/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java
----------------------------------------------------------------------
diff --cc services/secondary-storage/controller/src/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java
index 8d4454f,79a1486..6abb421
mode 100644,100755..100644
--- a/services/secondary-storage/controller/src/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java
+++ b/services/secondary-storage/controller/src/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
----------------------------------------------------------------------
diff --cc services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
index 1b3dc83,bedd5c1..6565187
mode 100644,100755..100644
--- a/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java
+++ b/services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java
----------------------------------------------------------------------
diff --cc services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java
index 9678b6b,25c0887..25c0887
mode 100644,100755..100644
--- a/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java
+++ b/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/DownloadManagerImpl.java

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/systemvm/patches/debian/config/etc/init.d/cloud-early-config
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/systemvm/scripts/config_ssl.sh
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/tools/marvin/marvin/config/test_data.py
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/ui/scripts/storage.js
----------------------------------------------------------------------
diff --cc ui/scripts/storage.js
index 1773c27,68e3ec1..7f210bd
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@@ -322,45 -328,37 +329,68 @@@
                                                  data: items
                                              });
                                          }
 +
-                                     },
-                                     url: {
-                                         label: 'label.url',
-                                         docID: 'helpUploadVolumeURL',
-                                         validation: {
-                                             required: true
+                                     },                                      
+                                     diskOffering: {
+                                         label: 'Custom Disk Offering',
+                                         docID: 'helpVolumeDiskOffering',
+                                         select: function(args) {
+                                         	var diskofferingObjs;
+                                         	$.ajax({
+                                                 url: createURL("listDiskOfferings"),
+                                                 dataType: "json",
+                                                 async: false,
+                                                 success: function(json) {
+                                                     diskofferingObjs = json.listdiskofferingsresponse.diskoffering;
+                                                     var items = [{
+                                                     	id: '',
+                                                         description: ''
+                                                     }];
+                                                     $(diskofferingObjs).each(function()
{
+                                                     	if (this.iscustomized == true) {  
                                                 	
+ 	                                                        items.push({
+ 	                                                            id: this.id,
+ 	                                                            description: this.displaytext
+ 	                                                        });
+                                                     	}
+                                                     });
+                                                     args.response.success({
+                                                         data: items
+                                                     });
+                                                 }
+                                             });
                                          }
-                                     },                                                 
                       
+                                     },                                    
 +                                    diskOffering: {
 +                                        label: 'Custom Disk Offering',
 +                                        docID: 'helpVolumeDiskOffering',
 +                                        select: function(args) {
 +                                        	var diskofferingObjs;
 +                                        	$.ajax({
 +                                                url: createURL("listDiskOfferings"),
 +                                                dataType: "json",
 +                                                async: false,
 +                                                success: function(json) {
 +                                                    diskofferingObjs = json.listdiskofferingsresponse.diskoffering;
 +                                                    var items = [{
 +                                                    	id: '',
 +                                                        description: ''
 +                                                    }];
 +                                                    $(diskofferingObjs).each(function()
{
 +                                                    	if (this.iscustomized == true) {  
                                                 	
 +	                                                        items.push({
 +	                                                            id: this.id,
 +	                                                            description: this.displaytext
 +	                                                        });
 +                                                    	}
 +                                                    });
 +                                                    args.response.success({
 +                                                        data: items
 +                                                    });
 +                                                }
 +                                            });
 +                                        }
 +                                    },      
                                      checksum: {
                                          docID: 'helpUploadVolumeChecksum',
                                          label: 'label.md5.checksum'

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/ui/scripts/templates.js
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/ui/scripts/ui/dialog.js
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/96e45e08/utils/pom.xml
----------------------------------------------------------------------


Mime
View raw message