You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2012/08/16 02:45:39 UTC
[2/7] refactor
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/storage/StorageStats.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/StorageStats.java b/api/src/com/cloud/storage/StorageStats.java
deleted file mode 100755
index fe21c44..0000000
--- a/api/src/com/cloud/storage/StorageStats.java
+++ /dev/null
@@ -1,28 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.storage;
-
-public interface StorageStats {
- /**
- * @return bytes used by the storage server already.
- */
- public long getByteUsed();
- /**
- * @return bytes capacity of the storage server
- */
- public long getCapacityBytes();
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/storage/Volume.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/Volume.java b/api/src/com/cloud/storage/Volume.java
deleted file mode 100755
index 6e8e48e..0000000
--- a/api/src/com/cloud/storage/Volume.java
+++ /dev/null
@@ -1,150 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.storage;
-
-import java.util.Date;
-
-import com.cloud.acl.ControlledEntity;
-import com.cloud.template.BasedOn;
-import com.cloud.utils.fsm.StateMachine2;
-import com.cloud.utils.fsm.StateObject;
-
-public interface Volume extends ControlledEntity, BasedOn, StateObject<Volume.State> {
- enum Type {
- UNKNOWN, ROOT, SWAP, DATADISK, ISO
- };
-
- enum State {
- Allocated("The volume is allocated but has not been created yet."),
- Creating("The volume is being created. getPoolId() should reflect the pool where it is being created."),
- Ready("The volume is ready to be used."),
- Migrating("The volume is migrating to other storage pool"),
- Snapshotting("There is a snapshot created on this volume, not backed up to secondary storage yet"),
- Expunging("The volume is being expunging"),
- Destroy("The volume is destroyed, and can't be recovered."),
- UploadOp ("The volume upload operation is in progress or in short the volume is on secondary storage");
-
- String _description;
-
- private State(String description) {
- _description = description;
- }
-
- public static StateMachine2<State, Event, Volume> getStateMachine() {
- return s_fsm;
- }
-
- public String getDescription() {
- return _description;
- }
-
- private final static StateMachine2<State, Event, Volume> s_fsm = new StateMachine2<State, Event, Volume>();
- static {
- s_fsm.addTransition(Allocated, Event.CreateRequested, Creating);
- s_fsm.addTransition(Allocated, Event.DestroyRequested, Destroy);
- s_fsm.addTransition(Creating, Event.OperationRetry, Creating);
- s_fsm.addTransition(Creating, Event.OperationFailed, Allocated);
- s_fsm.addTransition(Creating, Event.OperationSucceeded, Ready);
- s_fsm.addTransition(Creating, Event.DestroyRequested, Destroy);
- s_fsm.addTransition(Creating, Event.CreateRequested, Creating);
- s_fsm.addTransition(Allocated, Event.UploadRequested, UploadOp);
- s_fsm.addTransition(UploadOp, Event.CopyRequested, Creating);// CopyRequested for volume from sec to primary storage
- s_fsm.addTransition(Creating, Event.CopySucceeded, Ready);
- s_fsm.addTransition(Creating, Event.CopyFailed, UploadOp);// Copying volume from sec to primary failed.
- s_fsm.addTransition(UploadOp, Event.DestroyRequested, Destroy);
- s_fsm.addTransition(Ready, Event.DestroyRequested, Destroy);
- s_fsm.addTransition(Destroy, Event.ExpungingRequested, Expunging);
- s_fsm.addTransition(Ready, Event.SnapshotRequested, Snapshotting);
- s_fsm.addTransition(Snapshotting, Event.OperationSucceeded, Ready);
- s_fsm.addTransition(Snapshotting, Event.OperationFailed, Ready);
- s_fsm.addTransition(Ready, Event.MigrationRequested, Migrating);
- s_fsm.addTransition(Migrating, Event.OperationSucceeded, Ready);
- s_fsm.addTransition(Migrating, Event.OperationFailed, Ready);
- s_fsm.addTransition(Destroy, Event.OperationSucceeded, Destroy);
- }
- }
-
- enum Event {
- CreateRequested,
- CopyRequested,
- CopySucceeded,
- CopyFailed,
- OperationFailed,
- OperationSucceeded,
- OperationRetry,
- UploadRequested,
- MigrationRequested,
- SnapshotRequested,
- DestroyRequested,
- ExpungingRequested;
- }
-
- long getId();
-
- /**
- * @return the volume name
- */
- String getName();
-
- /**
- * @return total size of the partition
- */
- long getSize();
-
- /**
- * @return the vm instance id
- */
- Long getInstanceId();
-
- /**
- * @return the folder of the volume
- */
- String getFolder();
-
- /**
- * @return the path created.
- */
- String getPath();
-
- Long getPodId();
-
- long getDataCenterId();
-
- Type getVolumeType();
-
- Long getPoolId();
-
- State getState();
-
- Date getAttached();
-
- Long getDeviceId();
-
- Date getCreated();
-
- long getDiskOfferingId();
-
- String getChainInfo();
-
- boolean isRecreatable();
-
- public long getUpdatedCount();
-
- public void incrUpdatedCount();
-
- public Date getUpdated();
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/storage/VolumeStats.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/VolumeStats.java b/api/src/com/cloud/storage/VolumeStats.java
deleted file mode 100644
index 70c0b17..0000000
--- a/api/src/com/cloud/storage/VolumeStats.java
+++ /dev/null
@@ -1,24 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.storage;
-
-public interface VolumeStats {
- /**
- * @return bytes used by the volume
- */
- public long getBytesUsed();
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/storage/orchestra/StorageOrchestraEngine.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/orchestra/StorageOrchestraEngine.java b/api/src/com/cloud/storage/orchestra/StorageOrchestraEngine.java
new file mode 100644
index 0000000..ffcb182
--- /dev/null
+++ b/api/src/com/cloud/storage/orchestra/StorageOrchestraEngine.java
@@ -0,0 +1,10 @@
+package com.cloud.storage.orchestra;
+
+import com.cloud.storage.pool.StoragePoolService;
+import com.cloud.storage.snapshot.SnapshotService;
+import com.cloud.storage.volume.VolumeService;
+import com.cloud.template.TemplateService;
+
+public interface StorageOrchestraEngine extends StoragePoolService, VolumeService, SnapshotService, TemplateService {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/storage/pool/Storage.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/pool/Storage.java b/api/src/com/cloud/storage/pool/Storage.java
new file mode 100755
index 0000000..3c2f476
--- /dev/null
+++ b/api/src/com/cloud/storage/pool/Storage.java
@@ -0,0 +1,132 @@
+// 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.storage.pool;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Storage {
+ public static enum ImageFormat {
+ QCOW2(true, true, false),
+ RAW(false, false, false),
+ VHD(true, true, true),
+ ISO(false, false, false),
+ OVA(true, true, true, "ova"),
+ BAREMETAL(false, false, false);
+
+ private final boolean thinProvisioned;
+ private final boolean supportSparse;
+ private final boolean supportSnapshot;
+ private final String fileExtension;
+
+ private ImageFormat(boolean thinProvisioned, boolean supportSparse, boolean supportSnapshot) {
+ this.thinProvisioned = thinProvisioned;
+ this.supportSparse = supportSparse;
+ this.supportSnapshot = supportSnapshot;
+ fileExtension = null;
+ }
+
+ private ImageFormat(boolean thinProvisioned, boolean supportSparse, boolean supportSnapshot, String fileExtension) {
+ this.thinProvisioned = thinProvisioned;
+ this.supportSparse = supportSparse;
+ this.supportSnapshot = supportSnapshot;
+ this.fileExtension = fileExtension;
+ }
+
+ public boolean isThinProvisioned() {
+ return thinProvisioned;
+ }
+
+ public boolean supportsSparse() {
+ return supportSparse;
+ }
+
+ public boolean supportSnapshot() {
+ return supportSnapshot;
+ }
+
+ public String getFileExtension() {
+ if (fileExtension == null)
+ return toString().toLowerCase();
+
+ return fileExtension;
+ }
+ }
+
+ public static enum FileSystem {
+ Unknown,
+ ext3,
+ ntfs,
+ fat,
+ fat32,
+ ext2,
+ ext4,
+ cdfs,
+ hpfs,
+ ufs,
+ hfs,
+ hfsp
+ }
+
+ public static enum TemplateType {
+ SYSTEM, /* routing, system vm template */
+ BUILTIN, /* buildin template */
+ PERHOST, /* every host has this template, don't need to install it in secondary storage */
+ USER /* User supplied template/iso */
+ }
+
+ public static enum StoragePoolType {
+ Filesystem(false), // local directory
+ NetworkFilesystem(true), // NFS or CIFS
+ IscsiLUN(true), // shared LUN, with a clusterfs overlay
+ Iscsi(true), // for e.g., ZFS Comstar
+ ISO(false), // for iso image
+ LVM(false), // XenServer local LVM SR
+ CLVM(true),
+ RBD(true),
+ SharedMountPoint(true),
+ VMFS(true), // VMware VMFS storage
+ PreSetup(true), // for XenServer, Storage Pool is set up by customers.
+ EXT(false), // XenServer local EXT SR
+ OCFS2(true);
+
+ boolean shared;
+
+ StoragePoolType(boolean shared) {
+ this.shared = shared;
+ }
+
+ public boolean isShared() {
+ return shared;
+ }
+ }
+
+ public static List<StoragePoolType> getNonSharedStoragePoolTypes() {
+ List<StoragePoolType> nonSharedStoragePoolTypes = new ArrayList<StoragePoolType>();
+ for (StoragePoolType storagePoolType : StoragePoolType.values()) {
+ if (!storagePoolType.isShared()) {
+ nonSharedStoragePoolTypes.add(storagePoolType);
+ }
+ }
+ return nonSharedStoragePoolTypes;
+
+ }
+
+ public static enum StorageResourceType {
+ STORAGE_POOL, STORAGE_HOST, SECONDARY_STORAGE, LOCAL_SECONDARY_STORAGE
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/storage/pool/StoragePool.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/pool/StoragePool.java b/api/src/com/cloud/storage/pool/StoragePool.java
new file mode 100644
index 0000000..76765ff
--- /dev/null
+++ b/api/src/com/cloud/storage/pool/StoragePool.java
@@ -0,0 +1,106 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.storage.pool;
+
+import java.util.Date;
+
+import com.cloud.storage.pool.Storage.StoragePoolType;
+
+public interface StoragePool {
+
+ /**
+ * @return id of the pool.
+ */
+ long getId();
+
+ /**
+ * @return name of the pool.
+ */
+ String getName();
+
+ /***
+ *
+ * @return unique identifier
+ */
+ String getUuid();
+
+ /**
+ * @return the type of pool.
+ */
+ StoragePoolType getPoolType();
+
+ /**
+ * @return the date the pool first registered
+ */
+ Date getCreated();
+
+ /**
+ * @return the last time the state of this pool was modified.
+ */
+ Date getUpdateTime();
+
+ /**
+ * @return availability zone.
+ */
+ long getDataCenterId();
+
+ /**
+ * @return capacity of storage poolin bytes
+ */
+ long getCapacityBytes();
+
+ /**
+ * @return available storage in bytes
+ */
+ long getAvailableBytes();
+
+ Long getClusterId();
+
+ /**
+ * @return the fqdn or ip address of the storage host
+ */
+ String getHostAddress();
+
+ /**
+ * @return the filesystem path of the pool on the storage host (server)
+ */
+ String getPath();
+
+ /**
+ * @return the user information / credentials for the storage host
+ */
+ String getUserInfo();
+
+ /**
+ * @return the storage pool represents a shared storage resource
+ */
+ boolean isShared();
+
+ /**
+ * @return the storage pool represents a local storage resource
+ */
+ boolean isLocal();
+
+ /**
+ * @return the storage pool status
+ */
+ StoragePoolStatus getStatus();
+
+ int getPort();
+
+ Long getPodId();
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/storage/pool/StoragePoolService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/pool/StoragePoolService.java b/api/src/com/cloud/storage/pool/StoragePoolService.java
new file mode 100644
index 0000000..c7bfc5b
--- /dev/null
+++ b/api/src/com/cloud/storage/pool/StoragePoolService.java
@@ -0,0 +1,91 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.storage.pool;
+
+import java.net.UnknownHostException;
+import java.util.List;
+
+import com.cloud.api.commands.CancelPrimaryStorageMaintenanceCmd;
+import com.cloud.api.commands.CreateStoragePoolCmd;
+import com.cloud.api.commands.CreateVolumeCmd;
+import com.cloud.api.commands.DeletePoolCmd;
+import com.cloud.api.commands.ListVolumesCmd;
+import com.cloud.api.commands.UpdateStoragePoolCmd;
+import com.cloud.api.commands.UploadVolumeCmd;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.PermissionDeniedException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceInUseException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.storage.volume.Volume;
+
+public interface StoragePoolService {
+ /**
+ * Create StoragePool based on uri
+ *
+ * @param cmd
+ * the command object that specifies the zone, cluster/pod, URI, details, etc. to use to create the
+ * storage pool.
+ * @return
+ * @throws ResourceInUseException
+ * @throws IllegalArgumentException
+ * @throws UnknownHostException
+ * @throws ResourceUnavailableException
+ */
+ StoragePool createPool(CreateStoragePoolCmd cmd) throws ResourceInUseException, IllegalArgumentException,
+ UnknownHostException, ResourceUnavailableException;
+
+ /**
+ * Delete the storage pool
+ *
+ * @param cmd
+ * - the command specifying poolId
+ * @return success or failure
+ */
+ boolean deletePool(DeletePoolCmd cmd);
+
+ /**
+ * Enable maintenance for storage
+ *
+ * @param cmd
+ * - the command specifying primaryStorageId
+ * @return the primary storage pool
+ * @throws ResourceUnavailableException
+ * @throws InsufficientCapacityException
+ */
+ public StoragePool prepareStorageForMaintenance(Long primaryStorageId) throws ResourceUnavailableException,
+ InsufficientCapacityException;
+
+ /**
+ * Complete maintenance for primary storage
+ *
+ * @param cmd
+ * - the command specifying primaryStorageId
+ * @return the primary storage pool
+ * @throws ResourceUnavailableException
+ */
+ public StoragePool cancelStorageForMaintenance(CancelPrimaryStorageMaintenanceCmd cmd)
+ throws ResourceUnavailableException;
+
+
+
+ //TODO: Need to move around for this following APIs
+ public StoragePool updateStoragePool(UpdateStoragePoolCmd cmd) throws IllegalArgumentException;
+
+ public StoragePool getStoragePool(long id);
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/storage/pool/StoragePoolStatus.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/pool/StoragePoolStatus.java b/api/src/com/cloud/storage/pool/StoragePoolStatus.java
new file mode 100644
index 0000000..b038b56
--- /dev/null
+++ b/api/src/com/cloud/storage/pool/StoragePoolStatus.java
@@ -0,0 +1,26 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.storage.pool;
+
+public enum StoragePoolStatus {
+ Up,
+ PrepareForMaintenance,
+ ErrorInMaintenance,
+ CancelMaintenance,
+ Maintenance,
+ Removed;
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/storage/pool/StorageStats.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/pool/StorageStats.java b/api/src/com/cloud/storage/pool/StorageStats.java
new file mode 100755
index 0000000..6da1889
--- /dev/null
+++ b/api/src/com/cloud/storage/pool/StorageStats.java
@@ -0,0 +1,28 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.storage.pool;
+
+public interface StorageStats {
+ /**
+ * @return bytes used by the storage server already.
+ */
+ public long getByteUsed();
+ /**
+ * @return bytes capacity of the storage server
+ */
+ public long getCapacityBytes();
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/storage/snapshot/Snapshot.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/snapshot/Snapshot.java b/api/src/com/cloud/storage/snapshot/Snapshot.java
new file mode 100644
index 0000000..03aa775
--- /dev/null
+++ b/api/src/com/cloud/storage/snapshot/Snapshot.java
@@ -0,0 +1,92 @@
+// 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.storage.snapshot;
+
+import java.util.Date;
+
+import com.cloud.acl.ControlledEntity;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+
+public interface Snapshot extends ControlledEntity {
+ public enum Type {
+ MANUAL,
+ RECURRING,
+ TEMPLATE,
+ HOURLY,
+ DAILY,
+ WEEKLY,
+ MONTHLY;
+ private int max = 8;
+
+ public void setMax(int max) {
+ this.max = max;
+ }
+
+ public int getMax() {
+ return max;
+ }
+
+ public String toString() {
+ return this.name();
+ }
+
+ public boolean equals(String snapshotType) {
+ return this.toString().equalsIgnoreCase(snapshotType);
+ }
+ }
+
+ public enum Status {
+ Creating,
+ CreatedOnPrimary,
+ BackingUp,
+ BackedUp,
+ Error;
+
+ public String toString() {
+ return this.name();
+ }
+
+ public boolean equals(String status) {
+ return this.toString().equalsIgnoreCase(status);
+ }
+ }
+
+ public static final long MANUAL_POLICY_ID = 0L;
+
+ Long getId();
+
+ long getAccountId();
+
+ long getVolumeId();
+
+ String getPath();
+
+ String getName();
+
+ Date getCreated();
+
+ Type getType();
+
+ Status getStatus();
+
+ HypervisorType getHypervisorType();
+
+ boolean isRecursive();
+
+ short getsnapshotType();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/storage/snapshot/SnapshotService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/snapshot/SnapshotService.java b/api/src/com/cloud/storage/snapshot/SnapshotService.java
index 0500061..f0735c6 100644
--- a/api/src/com/cloud/storage/snapshot/SnapshotService.java
+++ b/api/src/com/cloud/storage/snapshot/SnapshotService.java
@@ -25,7 +25,6 @@ import com.cloud.api.commands.ListSnapshotPoliciesCmd;
import com.cloud.api.commands.ListSnapshotsCmd;
import com.cloud.exception.PermissionDeniedException;
import com.cloud.exception.ResourceAllocationException;
-import com.cloud.storage.Snapshot;
import com.cloud.user.Account;
public interface SnapshotService {
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/storage/volume/GuestOS.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/volume/GuestOS.java b/api/src/com/cloud/storage/volume/GuestOS.java
new file mode 100644
index 0000000..e73b9a0
--- /dev/null
+++ b/api/src/com/cloud/storage/volume/GuestOS.java
@@ -0,0 +1,28 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.storage.volume;
+
+public interface GuestOS {
+
+ long getId();
+
+ String getName();
+
+ String getDisplayName();
+
+ long getCategoryId();
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/storage/volume/GuestOsCategory.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/volume/GuestOsCategory.java b/api/src/com/cloud/storage/volume/GuestOsCategory.java
new file mode 100644
index 0000000..a1677a6
--- /dev/null
+++ b/api/src/com/cloud/storage/volume/GuestOsCategory.java
@@ -0,0 +1,26 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.storage.volume;
+
+public interface GuestOsCategory {
+ long getId();
+
+ String getName();
+
+ void setName(String name);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/storage/volume/StorageGuru.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/volume/StorageGuru.java b/api/src/com/cloud/storage/volume/StorageGuru.java
new file mode 100644
index 0000000..07c36a0
--- /dev/null
+++ b/api/src/com/cloud/storage/volume/StorageGuru.java
@@ -0,0 +1,31 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.storage.volume;
+
+import com.cloud.utils.component.Adapter;
+
+/**
+ * StorageGuru understands about how to implement different
+ * types of storage pools.
+ */
+public interface StorageGuru extends Adapter {
+ void createVolume();
+
+ void prepareVolume();
+
+ void destroyVolume();
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/storage/volume/Volume.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/volume/Volume.java b/api/src/com/cloud/storage/volume/Volume.java
new file mode 100755
index 0000000..87415a5
--- /dev/null
+++ b/api/src/com/cloud/storage/volume/Volume.java
@@ -0,0 +1,150 @@
+// 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.storage.volume;
+
+import java.util.Date;
+
+import com.cloud.acl.ControlledEntity;
+import com.cloud.template.BasedOn;
+import com.cloud.utils.fsm.StateMachine2;
+import com.cloud.utils.fsm.StateObject;
+
+public interface Volume extends ControlledEntity, BasedOn, StateObject<Volume.State> {
+ enum Type {
+ UNKNOWN, ROOT, SWAP, DATADISK, ISO
+ };
+
+ enum State {
+ Allocated("The volume is allocated but has not been created yet."),
+ Creating("The volume is being created. getPoolId() should reflect the pool where it is being created."),
+ Ready("The volume is ready to be used."),
+ Migrating("The volume is migrating to other storage pool"),
+ Snapshotting("There is a snapshot created on this volume, not backed up to secondary storage yet"),
+ Expunging("The volume is being expunging"),
+ Destroy("The volume is destroyed, and can't be recovered."),
+ UploadOp ("The volume upload operation is in progress or in short the volume is on secondary storage");
+
+ String _description;
+
+ private State(String description) {
+ _description = description;
+ }
+
+ public static StateMachine2<State, Event, Volume> getStateMachine() {
+ return s_fsm;
+ }
+
+ public String getDescription() {
+ return _description;
+ }
+
+ private final static StateMachine2<State, Event, Volume> s_fsm = new StateMachine2<State, Event, Volume>();
+ static {
+ s_fsm.addTransition(Allocated, Event.CreateRequested, Creating);
+ s_fsm.addTransition(Allocated, Event.DestroyRequested, Destroy);
+ s_fsm.addTransition(Creating, Event.OperationRetry, Creating);
+ s_fsm.addTransition(Creating, Event.OperationFailed, Allocated);
+ s_fsm.addTransition(Creating, Event.OperationSucceeded, Ready);
+ s_fsm.addTransition(Creating, Event.DestroyRequested, Destroy);
+ s_fsm.addTransition(Creating, Event.CreateRequested, Creating);
+ s_fsm.addTransition(Allocated, Event.UploadRequested, UploadOp);
+ s_fsm.addTransition(UploadOp, Event.CopyRequested, Creating);// CopyRequested for volume from sec to primary storage
+ s_fsm.addTransition(Creating, Event.CopySucceeded, Ready);
+ s_fsm.addTransition(Creating, Event.CopyFailed, UploadOp);// Copying volume from sec to primary failed.
+ s_fsm.addTransition(UploadOp, Event.DestroyRequested, Destroy);
+ s_fsm.addTransition(Ready, Event.DestroyRequested, Destroy);
+ s_fsm.addTransition(Destroy, Event.ExpungingRequested, Expunging);
+ s_fsm.addTransition(Ready, Event.SnapshotRequested, Snapshotting);
+ s_fsm.addTransition(Snapshotting, Event.OperationSucceeded, Ready);
+ s_fsm.addTransition(Snapshotting, Event.OperationFailed, Ready);
+ s_fsm.addTransition(Ready, Event.MigrationRequested, Migrating);
+ s_fsm.addTransition(Migrating, Event.OperationSucceeded, Ready);
+ s_fsm.addTransition(Migrating, Event.OperationFailed, Ready);
+ s_fsm.addTransition(Destroy, Event.OperationSucceeded, Destroy);
+ }
+ }
+
+ enum Event {
+ CreateRequested,
+ CopyRequested,
+ CopySucceeded,
+ CopyFailed,
+ OperationFailed,
+ OperationSucceeded,
+ OperationRetry,
+ UploadRequested,
+ MigrationRequested,
+ SnapshotRequested,
+ DestroyRequested,
+ ExpungingRequested;
+ }
+
+ long getId();
+
+ /**
+ * @return the volume name
+ */
+ String getName();
+
+ /**
+ * @return total size of the partition
+ */
+ long getSize();
+
+ /**
+ * @return the vm instance id
+ */
+ Long getInstanceId();
+
+ /**
+ * @return the folder of the volume
+ */
+ String getFolder();
+
+ /**
+ * @return the path created.
+ */
+ String getPath();
+
+ Long getPodId();
+
+ long getDataCenterId();
+
+ Type getVolumeType();
+
+ Long getPoolId();
+
+ State getState();
+
+ Date getAttached();
+
+ Long getDeviceId();
+
+ Date getCreated();
+
+ long getDiskOfferingId();
+
+ String getChainInfo();
+
+ boolean isRecreatable();
+
+ public long getUpdatedCount();
+
+ public void incrUpdatedCount();
+
+ public Date getUpdated();
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/storage/volume/VolumeService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/volume/VolumeService.java b/api/src/com/cloud/storage/volume/VolumeService.java
new file mode 100644
index 0000000..9c207f3
--- /dev/null
+++ b/api/src/com/cloud/storage/volume/VolumeService.java
@@ -0,0 +1,59 @@
+package com.cloud.storage.volume;
+
+import java.util.List;
+
+import com.cloud.api.commands.CreateVolumeCmd;
+import com.cloud.api.commands.ListVolumesCmd;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.PermissionDeniedException;
+import com.cloud.exception.ResourceAllocationException;
+
+public interface VolumeService {
+ /**
+ * Creates the database object for a volume based on the given criteria
+ *
+ * @param cmd
+ * the API command wrapping the criteria (account/domainId [admin only], zone, diskOffering, snapshot,
+ * name)
+ * @return the volume object
+ * @throws PermissionDeniedException
+ */
+ Volume allocVolume(CreateVolumeCmd cmd) throws ResourceAllocationException;
+
+ /**
+ * Creates the volume based on the given criteria
+ *
+ * @param cmd
+ * the API command wrapping the criteria (account/domainId [admin only], zone, diskOffering, snapshot,
+ * name)
+ * @return the volume object
+ */
+ Volume createVolume(CreateVolumeCmd cmd);
+
+ /**
+ * Delete volume
+ * @param volumeId
+ * @return
+ * @throws ConcurrentOperationException
+ */
+ boolean deleteVolume(long volumeId) throws ConcurrentOperationException;
+
+ /**
+ * Migrate volume to another storage pool
+ * @param volumeId
+ * @param storagePoolId
+ * @return
+ * @throws ConcurrentOperationException
+ */
+ Volume migrateVolume(Long volumeId, Long storagePoolId) throws ConcurrentOperationException;
+
+ /**
+ * Copy volume another storage pool, a new volume will be created on destination storage pool
+ * @param volumeId
+ * @param destStoragePoolId
+ * @return
+ */
+ Volume copyVolume(Long volumeId, Long destStoragePoolId);
+
+ List<? extends Volume> searchForVolumes(ListVolumesCmd cmd);
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/storage/volume/VolumeStats.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/volume/VolumeStats.java b/api/src/com/cloud/storage/volume/VolumeStats.java
new file mode 100644
index 0000000..f9f7576
--- /dev/null
+++ b/api/src/com/cloud/storage/volume/VolumeStats.java
@@ -0,0 +1,24 @@
+// 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.storage.volume;
+
+public interface VolumeStats {
+ /**
+ * @return bytes used by the volume
+ */
+ public long getBytesUsed();
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/template/TemplateService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/template/TemplateService.java b/api/src/com/cloud/template/TemplateService.java
index e45f43d..c66154c 100755
--- a/api/src/com/cloud/template/TemplateService.java
+++ b/api/src/com/cloud/template/TemplateService.java
@@ -28,9 +28,11 @@ import com.cloud.api.commands.ListTemplateOrIsoPermissionsCmd;
import com.cloud.api.commands.RegisterIsoCmd;
import com.cloud.api.commands.RegisterTemplateCmd;
import com.cloud.api.commands.UpdateTemplateOrIsoPermissionsCmd;
+import com.cloud.api.commands.UploadVolumeCmd;
import com.cloud.exception.InternalErrorException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.StorageUnavailableException;
+import com.cloud.storage.volume.Volume;
public interface TemplateService {
@@ -86,4 +88,7 @@ public interface TemplateService {
List<String> listTemplatePermissions(ListTemplateOrIsoPermissionsCmd cmd);
boolean updateTemplateOrIsoPermissions(UpdateTemplateOrIsoPermissionsCmd cmd);
+
+ Volume uploadVolume(UploadVolumeCmd cmd)
+ throws ResourceAllocationException;
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/template/VirtualMachineTemplate.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/template/VirtualMachineTemplate.java b/api/src/com/cloud/template/VirtualMachineTemplate.java
index 27f5871..0319428 100755
--- a/api/src/com/cloud/template/VirtualMachineTemplate.java
+++ b/api/src/com/cloud/template/VirtualMachineTemplate.java
@@ -21,8 +21,8 @@ import java.util.Map;
import com.cloud.acl.ControlledEntity;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.storage.Storage.ImageFormat;
-import com.cloud.storage.Storage.TemplateType;
+import com.cloud.storage.pool.Storage.ImageFormat;
+import com.cloud.storage.pool.Storage.TemplateType;
public interface VirtualMachineTemplate extends ControlledEntity {
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/vm/DiskProfile.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/vm/DiskProfile.java b/api/src/com/cloud/vm/DiskProfile.java
index bb74d84..2869dfc 100644
--- a/api/src/com/cloud/vm/DiskProfile.java
+++ b/api/src/com/cloud/vm/DiskProfile.java
@@ -18,7 +18,7 @@ package com.cloud.vm;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.offering.DiskOffering;
-import com.cloud.storage.Volume;
+import com.cloud.storage.volume.Volume;
/**
* DiskProfile describes a disk and what functionality is required from it.
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/api/src/com/cloud/vm/UserVmService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/vm/UserVmService.java b/api/src/com/cloud/vm/UserVmService.java
index 6635657..1b96400 100755
--- a/api/src/com/cloud/vm/UserVmService.java
+++ b/api/src/com/cloud/vm/UserVmService.java
@@ -48,8 +48,8 @@ import com.cloud.exception.VirtualMachineMigrationException;
import com.cloud.host.Host;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.offering.ServiceOffering;
-import com.cloud.storage.StoragePool;
-import com.cloud.storage.Volume;
+import com.cloud.storage.pool.StoragePool;
+import com.cloud.storage.volume.Volume;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account;
import com.cloud.uservm.UserVm;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/host/HostVO.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/host/HostVO.java b/core/src/com/cloud/host/HostVO.java
index dab9768..d2fa1d0 100755
--- a/core/src/com/cloud/host/HostVO.java
+++ b/core/src/com/cloud/host/HostVO.java
@@ -40,7 +40,7 @@ import javax.persistence.Transient;
import com.cloud.api.Identity;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.resource.ResourceState;
-import com.cloud.storage.Storage.StoragePoolType;
+import com.cloud.storage.pool.Storage.StoragePoolType;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.db.GenericDao;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/hypervisor/hyperv/resource/HypervResource.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/hypervisor/hyperv/resource/HypervResource.java b/core/src/com/cloud/hypervisor/hyperv/resource/HypervResource.java
index ede6301..131f495 100755
--- a/core/src/com/cloud/hypervisor/hyperv/resource/HypervResource.java
+++ b/core/src/com/cloud/hypervisor/hyperv/resource/HypervResource.java
@@ -104,8 +104,8 @@ import com.cloud.utils.ssh.SshHelper;
import com.cloud.resource.ServerResource;
import com.cloud.resource.ServerResourceBase;
import com.cloud.serializer.GsonHelper;
-import com.cloud.storage.Volume;
import com.cloud.storage.template.TemplateInfo;
+import com.cloud.storage.volume.Volume;
import com.cloud.utils.Pair;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.vm.DiskProfile;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/GuestOSCategoryVO.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/GuestOSCategoryVO.java b/core/src/com/cloud/storage/GuestOSCategoryVO.java
index cbe242e..9bb85f9 100644
--- a/core/src/com/cloud/storage/GuestOSCategoryVO.java
+++ b/core/src/com/cloud/storage/GuestOSCategoryVO.java
@@ -26,6 +26,7 @@ import javax.persistence.Id;
import javax.persistence.Table;
import com.cloud.api.Identity;
+import com.cloud.storage.volume.GuestOsCategory;
@Entity
@Table(name="guest_os_category")
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/GuestOSVO.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/GuestOSVO.java b/core/src/com/cloud/storage/GuestOSVO.java
index 85db94e..8fe71c0 100644
--- a/core/src/com/cloud/storage/GuestOSVO.java
+++ b/core/src/com/cloud/storage/GuestOSVO.java
@@ -26,6 +26,7 @@ import javax.persistence.Id;
import javax.persistence.Table;
import com.cloud.api.Identity;
+import com.cloud.storage.volume.GuestOS;
@Entity
@Table(name="guest_os")
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/SecondaryStorageLayer.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/SecondaryStorageLayer.java b/core/src/com/cloud/storage/SecondaryStorageLayer.java
index 539733d..de5c08f 100644
--- a/core/src/com/cloud/storage/SecondaryStorageLayer.java
+++ b/core/src/com/cloud/storage/SecondaryStorageLayer.java
@@ -18,7 +18,7 @@ package com.cloud.storage;
import java.net.URI;
-import com.cloud.storage.Storage.ImageFormat;
+import com.cloud.storage.pool.Storage.ImageFormat;
import com.cloud.utils.component.Adapter;
public interface SecondaryStorageLayer extends Adapter {
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/SnapshotVO.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/SnapshotVO.java b/core/src/com/cloud/storage/SnapshotVO.java
index 08dfafa..5165806 100644
--- a/core/src/com/cloud/storage/SnapshotVO.java
+++ b/core/src/com/cloud/storage/SnapshotVO.java
@@ -30,6 +30,7 @@ import javax.persistence.Table;
import com.cloud.api.Identity;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.storage.snapshot.Snapshot;
import com.cloud.utils.db.GenericDao;
import com.google.gson.annotations.Expose;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/StoragePoolVO.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/StoragePoolVO.java b/core/src/com/cloud/storage/StoragePoolVO.java
index 5fecefb..bc442f6 100644
--- a/core/src/com/cloud/storage/StoragePoolVO.java
+++ b/core/src/com/cloud/storage/StoragePoolVO.java
@@ -31,7 +31,9 @@ import javax.persistence.TemporalType;
import javax.persistence.Transient;
import com.cloud.api.Identity;
-import com.cloud.storage.Storage.StoragePoolType;
+import com.cloud.storage.pool.StoragePool;
+import com.cloud.storage.pool.StoragePoolStatus;
+import com.cloud.storage.pool.Storage.StoragePoolType;
import com.cloud.utils.db.GenericDao;
@Entity
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/VMTemplateVO.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/VMTemplateVO.java b/core/src/com/cloud/storage/VMTemplateVO.java
index cd17bc9..41bbcda 100755
--- a/core/src/com/cloud/storage/VMTemplateVO.java
+++ b/core/src/com/cloud/storage/VMTemplateVO.java
@@ -33,8 +33,9 @@ import javax.persistence.Transient;
import com.cloud.api.Identity;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.storage.Storage.ImageFormat;
-import com.cloud.storage.Storage.TemplateType;
+import com.cloud.storage.pool.Storage;
+import com.cloud.storage.pool.Storage.ImageFormat;
+import com.cloud.storage.pool.Storage.TemplateType;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.utils.db.GenericDao;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/VolumeHostVO.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/VolumeHostVO.java b/core/src/com/cloud/storage/VolumeHostVO.java
index d3d88ae..590e570 100755
--- a/core/src/com/cloud/storage/VolumeHostVO.java
+++ b/core/src/com/cloud/storage/VolumeHostVO.java
@@ -30,8 +30,9 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType;
//import com.cloud.storage.VMVolumeStorageResourceAssoc.Status;
-import com.cloud.storage.Storage.ImageFormat;
import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
+import com.cloud.storage.pool.Storage;
+import com.cloud.storage.pool.Storage.ImageFormat;
import com.cloud.utils.db.GenericDaoBase;
/**
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/VolumeVO.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/VolumeVO.java b/core/src/com/cloud/storage/VolumeVO.java
index ef0feda..55c508a 100755
--- a/core/src/com/cloud/storage/VolumeVO.java
+++ b/core/src/com/cloud/storage/VolumeVO.java
@@ -32,7 +32,8 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import com.cloud.api.Identity;
-import com.cloud.storage.Storage.StoragePoolType;
+import com.cloud.storage.pool.Storage.StoragePoolType;
+import com.cloud.storage.volume.Volume;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.db.GenericDao;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/resource/CifsSecondaryStorageResource.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/resource/CifsSecondaryStorageResource.java b/core/src/com/cloud/storage/resource/CifsSecondaryStorageResource.java
index c606fca..65f9ed3 100755
--- a/core/src/com/cloud/storage/resource/CifsSecondaryStorageResource.java
+++ b/core/src/com/cloud/storage/resource/CifsSecondaryStorageResource.java
@@ -56,9 +56,9 @@ import com.cloud.host.Host;
import com.cloud.host.Host.Type;
import com.cloud.resource.ServerResource;
import com.cloud.resource.ServerResourceBase;
-import com.cloud.storage.Storage;
-import com.cloud.storage.Storage.StoragePoolType;
import com.cloud.storage.StorageLayer;
+import com.cloud.storage.pool.Storage;
+import com.cloud.storage.pool.Storage.StoragePoolType;
import com.cloud.storage.template.DownloadManager;
import com.cloud.storage.template.DownloadManagerImpl;
import com.cloud.storage.template.TemplateInfo;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/resource/LocalSecondaryStorageResource.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/resource/LocalSecondaryStorageResource.java b/core/src/com/cloud/storage/resource/LocalSecondaryStorageResource.java
index d9c69f8..17b190f 100644
--- a/core/src/com/cloud/storage/resource/LocalSecondaryStorageResource.java
+++ b/core/src/com/cloud/storage/resource/LocalSecondaryStorageResource.java
@@ -44,9 +44,9 @@ import com.cloud.agent.api.storage.DownloadProgressCommand;
import com.cloud.host.Host;
import com.cloud.host.Host.Type;
import com.cloud.resource.ServerResourceBase;
-import com.cloud.storage.Storage;
-import com.cloud.storage.Storage.StoragePoolType;
import com.cloud.storage.StorageLayer;
+import com.cloud.storage.pool.Storage;
+import com.cloud.storage.pool.Storage.StoragePoolType;
import com.cloud.storage.template.DownloadManager;
import com.cloud.storage.template.DownloadManagerImpl;
import com.cloud.storage.template.TemplateInfo;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/template/DownloadManager.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/template/DownloadManager.java b/core/src/com/cloud/storage/template/DownloadManager.java
index f4f8a0f..2db1752 100644
--- a/core/src/com/cloud/storage/template/DownloadManager.java
+++ b/core/src/com/cloud/storage/template/DownloadManager.java
@@ -24,7 +24,7 @@ import com.cloud.agent.api.storage.DownloadCommand;
import com.cloud.agent.api.storage.DownloadCommand.Proxy;
import com.cloud.agent.api.storage.DownloadCommand.ResourceType;
import com.cloud.storage.VMTemplateHostVO;
-import com.cloud.storage.Storage.ImageFormat;
+import com.cloud.storage.pool.Storage.ImageFormat;
import com.cloud.storage.resource.SecondaryStorageResource;
import com.cloud.utils.component.Manager;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/template/DownloadManagerImpl.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/template/DownloadManagerImpl.java b/core/src/com/cloud/storage/template/DownloadManagerImpl.java
index ab81bed..75c7840 100755
--- a/core/src/com/cloud/storage/template/DownloadManagerImpl.java
+++ b/core/src/com/cloud/storage/template/DownloadManagerImpl.java
@@ -51,10 +51,10 @@ import com.cloud.agent.api.storage.DownloadCommand.ResourceType;
import com.cloud.agent.api.storage.DownloadProgressCommand;
import com.cloud.agent.api.storage.DownloadProgressCommand.RequestType;
import com.cloud.exception.InternalErrorException;
-import com.cloud.storage.Storage.ImageFormat;
import com.cloud.storage.StorageLayer;
import com.cloud.storage.VMTemplateHostVO;
import com.cloud.storage.VMTemplateStorageResourceAssoc;
+import com.cloud.storage.pool.Storage.ImageFormat;
import com.cloud.storage.resource.SecondaryStorageResource;
import com.cloud.storage.template.Processor.FormatInfo;
import com.cloud.storage.template.TemplateDownloader.DownloadCompleteCallback;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/template/IsoProcessor.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/template/IsoProcessor.java b/core/src/com/cloud/storage/template/IsoProcessor.java
index 112002a..fb882bc 100644
--- a/core/src/com/cloud/storage/template/IsoProcessor.java
+++ b/core/src/com/cloud/storage/template/IsoProcessor.java
@@ -25,7 +25,7 @@ import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import com.cloud.storage.StorageLayer;
-import com.cloud.storage.Storage.ImageFormat;
+import com.cloud.storage.pool.Storage.ImageFormat;
@Local(value=Processor.class)
public class IsoProcessor implements Processor {
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/template/Processor.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/template/Processor.java b/core/src/com/cloud/storage/template/Processor.java
index 2ec3593..c22f8a9 100644
--- a/core/src/com/cloud/storage/template/Processor.java
+++ b/core/src/com/cloud/storage/template/Processor.java
@@ -17,7 +17,7 @@
package com.cloud.storage.template;
import com.cloud.exception.InternalErrorException;
-import com.cloud.storage.Storage.ImageFormat;
+import com.cloud.storage.pool.Storage.ImageFormat;
import com.cloud.utils.component.Adapter;
/**
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/template/QCOW2Processor.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/template/QCOW2Processor.java b/core/src/com/cloud/storage/template/QCOW2Processor.java
index 15af849..39e8db7 100644
--- a/core/src/com/cloud/storage/template/QCOW2Processor.java
+++ b/core/src/com/cloud/storage/template/QCOW2Processor.java
@@ -26,7 +26,7 @@ import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
-import com.cloud.storage.Storage.ImageFormat;
+import com.cloud.storage.pool.Storage.ImageFormat;
import com.cloud.storage.StorageLayer;
import com.cloud.utils.NumbersUtil;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/template/RawImageProcessor.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/template/RawImageProcessor.java b/core/src/com/cloud/storage/template/RawImageProcessor.java
index 694c76a..3c7cd67 100644
--- a/core/src/com/cloud/storage/template/RawImageProcessor.java
+++ b/core/src/com/cloud/storage/template/RawImageProcessor.java
@@ -26,7 +26,7 @@ import org.apache.log4j.Logger;
import com.cloud.exception.InternalErrorException;
import com.cloud.storage.StorageLayer;
-import com.cloud.storage.Storage.ImageFormat;
+import com.cloud.storage.pool.Storage.ImageFormat;
import com.cloud.storage.template.Processor.FormatInfo;
@Local(value=Processor.class)
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/template/TemplateLocation.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/template/TemplateLocation.java b/core/src/com/cloud/storage/template/TemplateLocation.java
index 58d023a..2c9aaf0 100644
--- a/core/src/com/cloud/storage/template/TemplateLocation.java
+++ b/core/src/com/cloud/storage/template/TemplateLocation.java
@@ -27,8 +27,8 @@ import java.util.Properties;
import org.apache.log4j.Logger;
import com.cloud.agent.api.storage.DownloadCommand.ResourceType;
-import com.cloud.storage.Storage.ImageFormat;
import com.cloud.storage.StorageLayer;
+import com.cloud.storage.pool.Storage.ImageFormat;
import com.cloud.storage.template.Processor.FormatInfo;
import com.cloud.utils.NumbersUtil;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/template/UploadManager.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/template/UploadManager.java b/core/src/com/cloud/storage/template/UploadManager.java
index fa40b8c..234f3de 100755
--- a/core/src/com/cloud/storage/template/UploadManager.java
+++ b/core/src/com/cloud/storage/template/UploadManager.java
@@ -22,8 +22,8 @@ import com.cloud.agent.api.storage.DeleteEntityDownloadURLAnswer;
import com.cloud.agent.api.storage.DeleteEntityDownloadURLCommand;
import com.cloud.agent.api.storage.UploadAnswer;
import com.cloud.agent.api.storage.UploadCommand;
-import com.cloud.storage.Storage.ImageFormat;
import com.cloud.storage.Upload.Status;
+import com.cloud.storage.pool.Storage.ImageFormat;
import com.cloud.storage.resource.SecondaryStorageResource;
import com.cloud.utils.component.Manager;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/template/UploadManagerImpl.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/template/UploadManagerImpl.java b/core/src/com/cloud/storage/template/UploadManagerImpl.java
index 2dd1751..d425b83 100755
--- a/core/src/com/cloud/storage/template/UploadManagerImpl.java
+++ b/core/src/com/cloud/storage/template/UploadManagerImpl.java
@@ -38,10 +38,10 @@ import com.cloud.agent.api.storage.DeleteEntityDownloadURLCommand;
import com.cloud.agent.api.storage.UploadAnswer;
import com.cloud.agent.api.storage.UploadCommand;
import com.cloud.agent.api.storage.UploadProgressCommand;
-import com.cloud.storage.Storage.ImageFormat;
import com.cloud.storage.StorageLayer;
import com.cloud.storage.Upload;
import com.cloud.storage.UploadVO;
+import com.cloud.storage.pool.Storage.ImageFormat;
import com.cloud.storage.resource.SecondaryStorageResource;
import com.cloud.storage.template.TemplateUploader.Status;
import com.cloud.storage.template.TemplateUploader.UploadCompleteCallback;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/template/VhdProcessor.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/template/VhdProcessor.java b/core/src/com/cloud/storage/template/VhdProcessor.java
index b65b1dc..698f402 100644
--- a/core/src/com/cloud/storage/template/VhdProcessor.java
+++ b/core/src/com/cloud/storage/template/VhdProcessor.java
@@ -28,7 +28,7 @@ import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import com.cloud.exception.InternalErrorException;
-import com.cloud.storage.Storage.ImageFormat;
+import com.cloud.storage.pool.Storage.ImageFormat;
import com.cloud.storage.StorageLayer;
import com.cloud.utils.NumbersUtil;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/storage/template/VmdkProcessor.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/template/VmdkProcessor.java b/core/src/com/cloud/storage/template/VmdkProcessor.java
index ec7f014..0674e08 100644
--- a/core/src/com/cloud/storage/template/VmdkProcessor.java
+++ b/core/src/com/cloud/storage/template/VmdkProcessor.java
@@ -30,7 +30,7 @@ import org.w3c.dom.NodeList;
import org.apache.log4j.Logger;
import com.cloud.exception.InternalErrorException;
-import com.cloud.storage.Storage.ImageFormat;
+import com.cloud.storage.pool.Storage.ImageFormat;
import com.cloud.storage.StorageLayer;
import com.cloud.utils.script.Script;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/src/com/cloud/vm/VirtualDisk.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/vm/VirtualDisk.java b/core/src/com/cloud/vm/VirtualDisk.java
index ad7bb43..16c3312 100644
--- a/core/src/com/cloud/vm/VirtualDisk.java
+++ b/core/src/com/cloud/vm/VirtualDisk.java
@@ -16,7 +16,7 @@
// under the License.
package com.cloud.vm;
-import com.cloud.storage.Storage;
+import com.cloud.storage.pool.Storage;
/**
* VirtualDisk describes the disks that are plugged into
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/core/test/com/cloud/agent/transport/RequestTest.java
----------------------------------------------------------------------
diff --git a/core/test/com/cloud/agent/transport/RequestTest.java b/core/test/com/cloud/agent/transport/RequestTest.java
index 64c1e0b..92f881c 100644
--- a/core/test/com/cloud/agent/transport/RequestTest.java
+++ b/core/test/com/cloud/agent/transport/RequestTest.java
@@ -34,9 +34,9 @@ import com.cloud.agent.api.storage.DownloadCommand;
import com.cloud.exception.UnsupportedVersionException;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.serializer.GsonHelper;
-import com.cloud.storage.Storage.ImageFormat;
-import com.cloud.storage.Storage.TemplateType;
import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
+import com.cloud.storage.pool.Storage.ImageFormat;
+import com.cloud.storage.pool.Storage.TemplateType;
import com.cloud.storage.VMTemplateVO;
/**
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/FakeComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/FakeComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/FakeComputingResource.java
index 83f6976..8a8ecbe 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/FakeComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/FakeComputingResource.java
@@ -94,10 +94,10 @@ import com.cloud.network.Networks.RouterPrivateIpStrategy;
import com.cloud.network.Networks.TrafficType;
import com.cloud.resource.ServerResource;
import com.cloud.resource.ServerResourceBase;
-import com.cloud.storage.Storage;
-import com.cloud.storage.Storage.StoragePoolType;
-import com.cloud.storage.Volume;
+import com.cloud.storage.pool.Storage;
+import com.cloud.storage.pool.Storage.StoragePoolType;
import com.cloud.storage.template.TemplateInfo;
+import com.cloud.storage.volume.Volume;
import com.cloud.utils.PropertiesUtil;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.utils.script.Script;
@@ -553,7 +553,7 @@ public class FakeComputingResource extends ServerResourceBase implements
try {
VolumeTO vol = new VolumeTO(cmd.getVolumeId(), Volume.Type.ROOT,
- com.cloud.storage.Storage.StoragePoolType.LVM, cmd
+ com.cloud.storage.pool.Storage.StoragePoolType.LVM, cmd
.getPool().getUuid(), "dummy", "/mountpoint",
"dummyPath", 1000L, null);
return new CreateAnswer(cmd, vol);
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index 8b876cf..007cd28 100755
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -186,16 +186,16 @@ import com.cloud.network.Networks.TrafficType;
import com.cloud.network.PhysicalNetworkSetupInfo;
import com.cloud.resource.ServerResource;
import com.cloud.resource.ServerResourceBase;
-import com.cloud.storage.Storage;
-import com.cloud.storage.Storage.ImageFormat;
-import com.cloud.storage.Storage.StoragePoolType;
import com.cloud.storage.StorageLayer;
-import com.cloud.storage.Volume;
+import com.cloud.storage.pool.Storage;
+import com.cloud.storage.pool.Storage.ImageFormat;
+import com.cloud.storage.pool.Storage.StoragePoolType;
import com.cloud.storage.template.Processor;
import com.cloud.storage.template.Processor.FormatInfo;
import com.cloud.storage.template.QCOW2Processor;
import com.cloud.storage.template.TemplateInfo;
import com.cloud.storage.template.TemplateLocation;
+import com.cloud.storage.volume.Volume;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.Pair;
import com.cloud.utils.PropertiesUtil;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePool.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePool.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePool.java
index 5437e7c..56dd037 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePool.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePool.java
@@ -19,7 +19,7 @@ package com.cloud.hypervisor.kvm.storage;
import java.util.List;
import com.cloud.hypervisor.kvm.storage.KVMPhysicalDisk.PhysicalDiskFormat;
-import com.cloud.storage.Storage.StoragePoolType;
+import com.cloud.storage.pool.Storage.StoragePoolType;
public interface KVMStoragePool {
public KVMPhysicalDisk createPhysicalDisk(String name,
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java
index 751da83..66bac52 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java
@@ -23,7 +23,7 @@ import com.cloud.hypervisor.kvm.resource.KVMHABase;
import com.cloud.hypervisor.kvm.resource.KVMHABase.PoolType;
import com.cloud.hypervisor.kvm.resource.KVMHAMonitor;
import com.cloud.hypervisor.kvm.storage.KVMPhysicalDisk.PhysicalDiskFormat;
-import com.cloud.storage.Storage.StoragePoolType;
+import com.cloud.storage.pool.Storage.StoragePoolType;
import com.cloud.storage.StorageLayer;
public class KVMStoragePoolManager {
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/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 9f62ee8..ca94877 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
@@ -45,7 +45,7 @@ import com.cloud.hypervisor.kvm.resource.LibvirtStorageVolumeDef.volFormat;
import com.cloud.hypervisor.kvm.resource.LibvirtStorageVolumeXMLParser;
import com.cloud.hypervisor.kvm.storage.KVMPhysicalDisk.PhysicalDiskFormat;
import com.cloud.exception.InternalErrorException;
-import com.cloud.storage.Storage.StoragePoolType;
+import com.cloud.storage.pool.Storage.StoragePoolType;
import com.cloud.storage.StorageLayer;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.utils.script.OutputInterpreter;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java
index 32f8ce9..e7022ab 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java
@@ -21,7 +21,7 @@ import java.util.List;
import org.libvirt.StoragePool;
import com.cloud.hypervisor.kvm.storage.KVMPhysicalDisk.PhysicalDiskFormat;
-import com.cloud.storage.Storage.StoragePoolType;
+import com.cloud.storage.pool.Storage.StoragePoolType;
public class LibvirtStoragePool implements KVMStoragePool {
protected String uuid;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/StorageAdaptor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/StorageAdaptor.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/StorageAdaptor.java
index be6c5c0..27d72ef 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/StorageAdaptor.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/StorageAdaptor.java
@@ -19,7 +19,7 @@ package com.cloud.hypervisor.kvm.storage;
import java.util.List;
import com.cloud.hypervisor.kvm.storage.KVMPhysicalDisk.PhysicalDiskFormat;
-import com.cloud.storage.Storage.StoragePoolType;
+import com.cloud.storage.pool.Storage.StoragePoolType;
public interface StorageAdaptor {
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java
index c5cb586..d4099dd 100755
--- a/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java
+++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmResourceBase.java
@@ -111,10 +111,10 @@ import com.cloud.ovm.object.OvmVm;
import com.cloud.ovm.object.OvmVolume;
import com.cloud.resource.ServerResource;
import com.cloud.resource.hypervisor.HypervisorResource;
-import com.cloud.storage.Storage.ImageFormat;
-import com.cloud.storage.Storage.StoragePoolType;
-import com.cloud.storage.Volume;
+import com.cloud.storage.pool.Storage.ImageFormat;
+import com.cloud.storage.pool.Storage.StoragePoolType;
import com.cloud.storage.template.TemplateInfo;
+import com.cloud.storage.volume.Volume;
import com.cloud.template.VirtualMachineTemplate.BootloaderType;
import com.cloud.utils.Pair;
import com.cloud.utils.Ternary;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/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 af53dad..37afdb7 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
@@ -54,10 +54,10 @@ import com.cloud.resource.ResourceManager;
import com.cloud.resource.ResourceStateAdapter;
import com.cloud.resource.ServerResource;
import com.cloud.resource.UnableDeleteHostException;
-import com.cloud.storage.Storage.ImageFormat;
-import com.cloud.storage.Storage.TemplateType;
import com.cloud.storage.VMTemplateVO;
import com.cloud.storage.dao.VMTemplateDao;
+import com.cloud.storage.pool.Storage.ImageFormat;
+import com.cloud.storage.pool.Storage.TemplateType;
import com.cloud.user.Account;
import com.cloud.utils.UriUtils;
import com.cloud.utils.component.ComponentLocator;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
index b525e13..2f46ba8 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
@@ -45,8 +45,8 @@ import com.cloud.hypervisor.vmware.mo.VmwareHypervisorHost;
import com.cloud.hypervisor.vmware.util.VmwareContext;
import com.cloud.hypervisor.vmware.util.VmwareHelper;
import com.cloud.storage.JavaStorageLayer;
-import com.cloud.storage.Storage.ImageFormat;
import com.cloud.storage.StorageLayer;
+import com.cloud.storage.pool.Storage.ImageFormat;
import com.cloud.storage.template.VmdkProcessor;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index 034a296..8fabf1f 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -187,11 +187,11 @@ import com.cloud.network.Networks;
import com.cloud.network.Networks.BroadcastDomainType;
import com.cloud.resource.ServerResource;
import com.cloud.serializer.GsonHelper;
-import com.cloud.storage.Storage;
-import com.cloud.storage.Storage.StoragePoolType;
-import com.cloud.storage.Volume;
+import com.cloud.storage.pool.Storage;
+import com.cloud.storage.pool.Storage.StoragePoolType;
import com.cloud.storage.resource.StoragePoolResource;
import com.cloud.storage.template.TemplateInfo;
+import com.cloud.storage.volume.Volume;
import com.cloud.utils.DateUtil;
import com.cloud.utils.Pair;
import com.cloud.utils.StringUtils;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java
index f9e1c89..5d8fa6a 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java
@@ -17,8 +17,8 @@ import javax.ejb.Local;
import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.GuestOSVO;
-import com.cloud.storage.Storage;
import com.cloud.storage.dao.GuestOSDao;
+import com.cloud.storage.pool.Storage;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.template.VirtualMachineTemplate.BootloaderType;
import com.cloud.utils.component.Inject;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
index 4fd202b..a13fc45 100755
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
@@ -73,11 +73,11 @@ import com.cloud.resource.ResourceManager;
import com.cloud.resource.ResourceStateAdapter;
import com.cloud.resource.ServerResource;
import com.cloud.resource.UnableDeleteHostException;
-import com.cloud.storage.Storage.ImageFormat;
-import com.cloud.storage.Storage.TemplateType;
import com.cloud.storage.VMTemplateVO;
import com.cloud.storage.dao.VMTemplateDao;
import com.cloud.storage.dao.VMTemplateHostDao;
+import com.cloud.storage.pool.Storage.ImageFormat;
+import com.cloud.storage.pool.Storage.TemplateType;
import com.cloud.user.Account;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.component.Inject;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/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 7abe281..b11f558 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
@@ -204,12 +204,12 @@ import com.cloud.network.ovs.OvsSetTagAndFlowCommand;
import com.cloud.network.ovs.OvsSetupBridgeCommand;
import com.cloud.resource.ServerResource;
import com.cloud.resource.hypervisor.HypervisorResource;
-import com.cloud.storage.Storage;
-import com.cloud.storage.Storage.ImageFormat;
-import com.cloud.storage.Storage.StoragePoolType;
-import com.cloud.storage.Volume;
import com.cloud.storage.VolumeVO;
+import com.cloud.storage.pool.Storage;
+import com.cloud.storage.pool.Storage.ImageFormat;
+import com.cloud.storage.pool.Storage.StoragePoolType;
import com.cloud.storage.template.TemplateInfo;
+import com.cloud.storage.volume.Volume;
import com.cloud.template.VirtualMachineTemplate.BootloaderType;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java
index d689393..198d988 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java
@@ -30,7 +30,7 @@ import com.cloud.agent.api.FenceCommand;
import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.agent.api.to.VolumeTO;
import com.cloud.resource.ServerResource;
-import com.cloud.storage.Volume;
+import com.cloud.storage.volume.Volume;
import com.cloud.template.VirtualMachineTemplate.BootloaderType;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.utils.script.Script;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/plugins/storage-allocators/random/src/com/cloud/storage/allocator/RandomStoragePoolAllocator.java
----------------------------------------------------------------------
diff --git a/plugins/storage-allocators/random/src/com/cloud/storage/allocator/RandomStoragePoolAllocator.java b/plugins/storage-allocators/random/src/com/cloud/storage/allocator/RandomStoragePoolAllocator.java
index 9192703..ee38cf8 100644
--- a/plugins/storage-allocators/random/src/com/cloud/storage/allocator/RandomStoragePoolAllocator.java
+++ b/plugins/storage-allocators/random/src/com/cloud/storage/allocator/RandomStoragePoolAllocator.java
@@ -26,9 +26,9 @@ import org.apache.log4j.Logger;
import com.cloud.deploy.DeploymentPlan;
import com.cloud.deploy.DeploymentPlanner.ExcludeList;
import com.cloud.server.StatsCollector;
-import com.cloud.storage.StoragePool;
import com.cloud.storage.StoragePoolVO;
import com.cloud.storage.VMTemplateVO;
+import com.cloud.storage.pool.StoragePool;
import com.cloud.vm.DiskProfile;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/server/src/com/cloud/agent/manager/AgentManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/agent/manager/AgentManagerImpl.java b/server/src/com/cloud/agent/manager/AgentManagerImpl.java
index 62e8acb..0278681 100755
--- a/server/src/com/cloud/agent/manager/AgentManagerImpl.java
+++ b/server/src/com/cloud/agent/manager/AgentManagerImpl.java
@@ -94,11 +94,11 @@ import com.cloud.resource.Discoverer;
import com.cloud.resource.ResourceManager;
import com.cloud.resource.ResourceState;
import com.cloud.resource.ServerResource;
-import com.cloud.storage.StorageManager;
-import com.cloud.storage.StorageService;
import com.cloud.storage.dao.StoragePoolDao;
import com.cloud.storage.dao.StoragePoolHostDao;
import com.cloud.storage.dao.VolumeDao;
+import com.cloud.storage.pool.StoragePoolManager;
+import com.cloud.storage.pool.StoragePoolService;
import com.cloud.storage.resource.DummySecondaryStorageResource;
import com.cloud.storage.secondary.SecondaryStorageVmManager;
import com.cloud.user.AccountManager;
@@ -194,8 +194,8 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, Manager {
@Inject
protected VirtualMachineManager _vmMgr = null;
- @Inject StorageService _storageSvr = null;
- @Inject StorageManager _storageMgr = null;
+ @Inject StoragePoolService _storageSvr = null;
+ @Inject StoragePoolManager _storageMgr = null;
@Inject
protected HypervisorGuruManager _hvGuruMgr;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5ba4913f/server/src/com/cloud/alert/AlertManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/alert/AlertManagerImpl.java b/server/src/com/cloud/alert/AlertManagerImpl.java
index 9c0cbb3..f4e3345 100755
--- a/server/src/com/cloud/alert/AlertManagerImpl.java
+++ b/server/src/com/cloud/alert/AlertManagerImpl.java
@@ -65,10 +65,10 @@ import com.cloud.host.dao.HostDao;
import com.cloud.network.dao.IPAddressDao;
import com.cloud.org.Grouping.AllocationState;
import com.cloud.resource.ResourceManager;
-import com.cloud.storage.StorageManager;
import com.cloud.storage.StoragePoolVO;
import com.cloud.storage.dao.StoragePoolDao;
import com.cloud.storage.dao.VolumeDao;
+import com.cloud.storage.pool.StoragePoolManager;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.Pair;
import com.cloud.utils.component.ComponentLocator;
@@ -92,7 +92,7 @@ public class AlertManagerImpl implements AlertManager {
private EmailAlert _emailAlert;
@Inject private AlertDao _alertDao;
@Inject private HostDao _hostDao;
- @Inject protected StorageManager _storageMgr;
+ @Inject protected StoragePoolManager _storageMgr;
@Inject protected CapacityManager _capacityMgr;
@Inject private CapacityDao _capacityDao;
@Inject private DataCenterDao _dcDao;