You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ah...@apache.org on 2013/07/29 19:54:49 UTC

[4/4] git commit: updated refs/heads/master to a4cea4e

Removed schema from the dependency of many components


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

Branch: refs/heads/master
Commit: a4cea4ebf2aa549a1b278fedbf1706357f5b4724
Parents: 399c373
Author: Alex Huang <al...@citrix.com>
Authored: Mon Jul 29 10:55:00 2013 -0700
Committer: Alex Huang <al...@citrix.com>
Committed: Mon Jul 29 10:55:19 2013 -0700

----------------------------------------------------------------------
 .../consoleproxy/ConsoleProxyAllocator.java     |  34 ++
 client/tomcatconf/log4j-cloud.xml.in            |   4 +-
 core/pom.xml                                    |  19 +-
 .../consoleproxy/ConsoleProxyAllocator.java     |  27 --
 .../com/cloud/storage/GuestOSHypervisorVO.java  |  73 ----
 core/src/com/cloud/storage/VolumeDetailVO.java  |  85 ----
 .../storage/command/AttachAnswer.java           |  47 ++
 .../storage/command/AttachCommand.java          | 126 ++++++
 .../command/AttachPrimaryDataStoreAnswer.java   |  56 +++
 .../command/AttachPrimaryDataStoreCmd.java      |  39 ++
 .../storage/command/CopyCmdAnswer.java          |  37 ++
 .../cloudstack/storage/command/CopyCommand.java |  58 +++
 .../storage/command/CreateObjectAnswer.java     |  43 ++
 .../storage/command/CreateObjectCommand.java    |  45 ++
 .../command/CreatePrimaryDataStoreCmd.java      |  38 ++
 .../storage/command/DeleteCommand.java          |  45 ++
 .../storage/command/DettachAnswer.java          |  47 ++
 .../storage/command/DettachCommand.java         |  90 ++++
 .../command/StorageSubSystemCommand.java        |  23 +
 .../cloudstack/storage/to/ImageStoreTO.java     |  79 ++++
 .../storage/to/PrimaryDataStoreTO.java          | 103 +++++
 .../cloudstack/storage/to/SnapshotObjectTO.java | 128 ++++++
 .../cloudstack/storage/to/TemplateObjectTO.java | 208 +++++++++
 .../cloudstack/storage/to/VolumeObjectTO.java   | 223 ++++++++++
 .../com/cloud/agent/transport/RequestTest.java  |  22 +-
 .../storage/command/AttachAnswer.java           |  47 --
 .../storage/command/AttachCommand.java          | 126 ------
 .../command/AttachPrimaryDataStoreAnswer.java   |  56 ---
 .../command/AttachPrimaryDataStoreCmd.java      |  39 --
 .../storage/command/CopyCmdAnswer.java          |  37 --
 .../cloudstack/storage/command/CopyCommand.java |  58 ---
 .../storage/command/CreateObjectAnswer.java     |  43 --
 .../storage/command/CreateObjectCommand.java    |  45 --
 .../command/CreatePrimaryDataStoreCmd.java      |  38 --
 .../storage/command/DeleteCommand.java          |  45 --
 .../storage/command/DettachAnswer.java          |  47 --
 .../storage/command/DettachCommand.java         |  90 ----
 .../command/StorageSubSystemCommand.java        |  23 -
 .../storage/datastore/db/ImageStoreDao.java     |  37 --
 .../datastore/db/ImageStoreDetailVO.java        |  82 ----
 .../datastore/db/ImageStoreDetailsDao.java      |  30 --
 .../storage/datastore/db/ImageStoreVO.java      | 193 ---------
 .../datastore/db/PrimaryDataStoreDao.java       | 120 ------
 .../datastore/db/PrimaryDataStoreDaoImpl.java   | 432 -------------------
 .../datastore/db/PrimaryDataStoreDetailVO.java  |  79 ----
 .../db/PrimaryDataStoreDetailsDao.java          |  28 --
 .../datastore/db/SnapshotDataStoreDao.java      |  43 --
 .../datastore/db/SnapshotDataStoreVO.java       | 271 ------------
 .../datastore/db/StoragePoolDetailVO.java       |  81 ----
 .../datastore/db/StoragePoolDetailsDao.java     |  30 --
 .../storage/datastore/db/StoragePoolVO.java     | 346 ---------------
 .../datastore/db/TemplateDataStoreDao.java      |  65 ---
 .../datastore/db/TemplateDataStoreVO.java       | 372 ----------------
 .../datastore/db/VolumeDataStoreDao.java        |  43 --
 .../storage/datastore/db/VolumeDataStoreVO.java | 348 ---------------
 .../cloudstack/storage/to/ImageStoreTO.java     |  79 ----
 .../storage/to/PrimaryDataStoreTO.java          | 103 -----
 .../cloudstack/storage/to/SnapshotObjectTO.java | 128 ------
 .../cloudstack/storage/to/TemplateObjectTO.java | 208 ---------
 .../cloudstack/storage/to/VolumeObjectTO.java   | 223 ----------
 .../com/cloud/storage/GuestOSHypervisorVO.java  |  73 ++++
 .../src/com/cloud/storage/VolumeDetailVO.java   |  85 ++++
 .../storage/datastore/db/ImageStoreDao.java     |  37 ++
 .../datastore/db/ImageStoreDetailVO.java        |  82 ++++
 .../datastore/db/ImageStoreDetailsDao.java      |  30 ++
 .../storage/datastore/db/ImageStoreVO.java      | 193 +++++++++
 .../datastore/db/PrimaryDataStoreDao.java       | 120 ++++++
 .../datastore/db/PrimaryDataStoreDaoImpl.java   | 432 +++++++++++++++++++
 .../datastore/db/PrimaryDataStoreDetailVO.java  |  79 ++++
 .../db/PrimaryDataStoreDetailsDao.java          |  28 ++
 .../datastore/db/SnapshotDataStoreDao.java      |  43 ++
 .../datastore/db/SnapshotDataStoreVO.java       | 271 ++++++++++++
 .../datastore/db/StoragePoolDetailVO.java       |  81 ++++
 .../datastore/db/StoragePoolDetailsDao.java     |  30 ++
 .../storage/datastore/db/StoragePoolVO.java     | 346 +++++++++++++++
 .../datastore/db/TemplateDataStoreDao.java      |  65 +++
 .../datastore/db/TemplateDataStoreVO.java       | 372 ++++++++++++++++
 .../datastore/db/VolumeDataStoreDao.java        |  43 ++
 .../storage/datastore/db/VolumeDataStoreVO.java | 348 +++++++++++++++
 engine/storage/cache/pom.xml                    |  20 +-
 pom.xml                                         |  18 +-
 server/pom.xml                                  |   5 +
 .../ConsoleProxyBalanceAllocator.java           |  52 +--
 .../consoleproxy/ConsoleProxyManagerImpl.java   |   7 +-
 usage/pom.xml                                   |   5 +
 85 files changed, 4303 insertions(+), 4296 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/api/src/com/cloud/consoleproxy/ConsoleProxyAllocator.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/consoleproxy/ConsoleProxyAllocator.java b/api/src/com/cloud/consoleproxy/ConsoleProxyAllocator.java
new file mode 100644
index 0000000..25d9d28
--- /dev/null
+++ b/api/src/com/cloud/consoleproxy/ConsoleProxyAllocator.java
@@ -0,0 +1,34 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.consoleproxy;
+
+import java.util.List;
+import java.util.Map;
+
+import com.cloud.utils.component.Adapter;
+import com.cloud.vm.ConsoleProxy;
+
+public interface ConsoleProxyAllocator extends Adapter {
+    /**
+     * Finds the least loaded console proxy.
+     * @param candidates
+     * @param loadInfo
+     * @param dataCenterId
+     * @return id of the console proxy to use or null if none.
+     */
+    public Long allocProxy(List<? extends ConsoleProxy> candidates, Map<Long, Integer> loadInfo, long dataCenterId);
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/client/tomcatconf/log4j-cloud.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/log4j-cloud.xml.in b/client/tomcatconf/log4j-cloud.xml.in
index 1207aa7..d439b77 100755
--- a/client/tomcatconf/log4j-cloud.xml.in
+++ b/client/tomcatconf/log4j-cloud.xml.in
@@ -71,7 +71,7 @@ under the License.
       <param name="SyslogHost" value="localhost"/>
       <param name="Facility" value="LOCAL6"/>
       <layout class="org.apache.log4j.PatternLayout">
-         <param name="ConversionPattern" value="%-5p [%c{1.}] (%t:%x) %m%n"/>
+         <param name="ConversionPattern" value="%-5p [%c{3}] (%t:%x) %m%n"/>
       </layout>
    </appender>
 
@@ -110,7 +110,7 @@ under the License.
    <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
       <param name="Target" value="System.out"/>
       <param name="Threshold" value="INFO"/>
-      <layout class="org.apache.log4j.PatternLayout">
+      <layout class="org.apache.log4j.EnhancedPatternLayout">
          <param name="ConversionPattern" value="%-5p [%c{1.}] (%t:%x) %m%n"/>
       </layout>
    </appender>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index a2d487e..76cdd12 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -35,30 +35,17 @@
       <groupId>org.apache.cloudstack</groupId>
       <artifactId>cloud-engine-api</artifactId>
       <version>${project.version}</version>
-    </dependency>
+    </dependency>    
+    <!-- 
     <dependency>
       <groupId>org.apache.cloudstack</groupId>
       <artifactId>cloud-engine-schema</artifactId>
       <version>${project.version}</version>
     </dependency>
-    <dependency>
-      <groupId>commons-httpclient</groupId>
-      <artifactId>commons-httpclient</artifactId>
-      <version>${cs.httpclient.version}</version>
-      <exclusions>
-        <exclusion>
-          <artifactId>commons-codec</artifactId>
-          <groupId>commons-codec</groupId>
-        </exclusion>
-      </exclusions>
-    </dependency>
+    -->
     <dependency>
       <groupId>commons-codec</groupId>
       <artifactId>commons-codec</artifactId>
-      <version>${cs.codec.version}</version>
     </dependency>
   </dependencies>
-  <build>
-    <defaultGoal>install</defaultGoal>
-  </build>
 </project>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/com/cloud/consoleproxy/ConsoleProxyAllocator.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/consoleproxy/ConsoleProxyAllocator.java b/core/src/com/cloud/consoleproxy/ConsoleProxyAllocator.java
deleted file mode 100644
index d6acf6d..0000000
--- a/core/src/com/cloud/consoleproxy/ConsoleProxyAllocator.java
+++ /dev/null
@@ -1,27 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.consoleproxy;
-
-import java.util.List;
-import java.util.Map;
-
-import com.cloud.utils.component.Adapter;
-import com.cloud.vm.ConsoleProxyVO;
-
-public interface ConsoleProxyAllocator extends Adapter {
-	public ConsoleProxyVO allocProxy(List<ConsoleProxyVO> candidates, Map<Long, Integer> loadInfo, long dataCenterId);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/com/cloud/storage/GuestOSHypervisorVO.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/GuestOSHypervisorVO.java b/core/src/com/cloud/storage/GuestOSHypervisorVO.java
deleted file mode 100644
index 5ab3480..0000000
--- a/core/src/com/cloud/storage/GuestOSHypervisorVO.java
+++ /dev/null
@@ -1,73 +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.UUID;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import org.apache.cloudstack.api.Identity;
-import org.apache.cloudstack.api.InternalIdentity;
-
-@Entity
-@Table(name="guest_os_hypervisor")
-public class GuestOSHypervisorVO implements GuestOSHypervisor {
-    @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-    @Column(name="id")
-    long id;
-
-    @Column(name="guest_os_id")
-    private long guestOsId;
-
-    @Column(name="guest_os_name")
-    String guestOsName;
-
-    @Column(name="hypervisor_type")
-    String hypervisorType;
-
-
-    @Override
-    public long getId() {
-    	return id;
-    }
-
-
-    @Override
-    public String getHypervisorType() {
-        return hypervisorType;
-    }
-
-
-    @Override
-    public String getGuestOsName() {
-        return guestOsName;
-    }
-
-
-    @Override
-    public long getGuestOsId() {
-        return guestOsId;
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/com/cloud/storage/VolumeDetailVO.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/VolumeDetailVO.java b/core/src/com/cloud/storage/VolumeDetailVO.java
deleted file mode 100644
index b0c8c1d..0000000
--- a/core/src/com/cloud/storage/VolumeDetailVO.java
+++ /dev/null
@@ -1,85 +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 org.apache.cloudstack.api.InternalIdentity;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name="volume_details")
-public class VolumeDetailVO implements InternalIdentity {
-    @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-    @Column(name="id")
-    private long id;
-
-    @Column(name="volume_id")
-    private long volumeId;
-
-    @Column(name="name")
-    private String name;
-
-    @Column(name="value", length=1024)
-    private String value;
-
-    public VolumeDetailVO() {}
-
-    public VolumeDetailVO(long volumeId, String name, String value) {
-        this.volumeId = volumeId;
-        this.name = name;
-        this.value = value;
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public long getVolumeId() {
-        return volumeId;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setId(long id) {
-        this.id = id;
-    }
-
-    public void setVolumeId(long volumeId) {
-        this.volumeId = volumeId;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/org/apache/cloudstack/storage/command/AttachAnswer.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/command/AttachAnswer.java b/core/src/org/apache/cloudstack/storage/command/AttachAnswer.java
new file mode 100644
index 0000000..5a26d4a
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/command/AttachAnswer.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.storage.command;
+
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.to.DiskTO;
+
+public class AttachAnswer extends Answer {
+    private DiskTO disk;
+
+    public AttachAnswer() {
+        super(null);
+    }
+
+    public AttachAnswer(DiskTO disk) {
+        super(null);
+        this.setDisk(disk);
+    }
+
+    public AttachAnswer(String errMsg) {
+        super(null, false, errMsg);
+    }
+
+    public DiskTO getDisk() {
+        return disk;
+    }
+
+    public void setDisk(DiskTO disk) {
+        this.disk = disk;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/org/apache/cloudstack/storage/command/AttachCommand.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/command/AttachCommand.java b/core/src/org/apache/cloudstack/storage/command/AttachCommand.java
new file mode 100644
index 0000000..44bce91
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/command/AttachCommand.java
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.storage.command;
+
+import com.cloud.agent.api.Command;
+import com.cloud.agent.api.to.DiskTO;
+
+public final class AttachCommand extends Command implements StorageSubSystemCommand {
+    private DiskTO disk;
+    private String vmName;
+    private String _storageHost;
+    private int _storagePort;
+    private boolean _managed;
+    private String _iScsiName;
+    private String _chapInitiatorUsername;
+    private String _chapInitiatorPassword;
+    private String _chapTargetUsername;
+    private String _chapTargetPassword;
+
+    public AttachCommand(DiskTO disk, String vmName) {
+        super();
+        this.disk = disk;
+        this.vmName = vmName;
+    }
+
+    @Override
+    public boolean executeInSequence() {
+        return false;
+    }
+
+    public DiskTO getDisk() {
+        return disk;
+    }
+
+    public void setDisk(DiskTO disk) {
+        this.disk = disk;
+    }
+
+    public String getVmName() {
+        return vmName;
+    }
+
+    public void setVmName(String vmName) {
+        this.vmName = vmName;
+    }
+
+    public void setStorageHost(String storageHost) {
+        _storageHost = storageHost;
+    }
+
+    public String getStorageHost() {
+        return _storageHost;
+    }
+
+    public void setStoragePort(int storagePort) {
+        _storagePort = storagePort;
+    }
+
+    public int getStoragePort() {
+        return _storagePort;
+    }
+
+    public void setManaged(boolean managed) {
+        _managed = managed;
+    }
+
+    public boolean isManaged() {
+        return _managed;
+    }
+
+    public void set_iScsiName(String iScsiName) {
+        this._iScsiName = iScsiName;
+    }
+
+    public String get_iScsiName() {
+        return _iScsiName;
+    }
+
+    public void setChapInitiatorUsername(String chapInitiatorUsername) {
+        _chapInitiatorUsername = chapInitiatorUsername;
+    }
+
+    public String getChapInitiatorUsername() {
+        return _chapInitiatorUsername;
+    }
+
+    public void setChapInitiatorPassword(String chapInitiatorPassword) {
+        _chapInitiatorPassword = chapInitiatorPassword;
+    }
+
+    public String getChapInitiatorPassword() {
+        return _chapInitiatorPassword;
+    }
+
+    public void setChapTargetUsername(String chapTargetUsername) {
+        _chapTargetUsername = chapTargetUsername;
+    }
+
+    public String getChapTargetUsername() {
+        return _chapTargetUsername;
+    }
+
+    public void setChapTargetPassword(String chapTargetPassword) {
+        _chapTargetPassword = chapTargetPassword;
+    }
+
+    public String getChapTargetPassword() {
+        return _chapTargetPassword;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreAnswer.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreAnswer.java b/core/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreAnswer.java
new file mode 100644
index 0000000..6d5bbaf
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreAnswer.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.storage.command;
+
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.Command;
+
+public class AttachPrimaryDataStoreAnswer extends Answer {
+    private String uuid;
+    private long capacity;
+    private long avail;
+
+    public AttachPrimaryDataStoreAnswer(Command cmd) {
+        super(cmd);
+    }
+
+    public void setUuid(String uuid) {
+        this.uuid = uuid;
+    }
+
+    public String getUuid() {
+        return this.uuid;
+    }
+
+    public void setCapacity(long capacity) {
+        this.capacity = capacity;
+    }
+
+    public long getCapacity() {
+        return this.capacity;
+    }
+
+    public void setAvailable(long avail) {
+        this.avail = avail;
+    }
+
+    public long getAvailable() {
+        return this.avail;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreCmd.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreCmd.java b/core/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreCmd.java
new file mode 100644
index 0000000..2083876
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreCmd.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.storage.command;
+
+import com.cloud.agent.api.Command;
+
+public final class AttachPrimaryDataStoreCmd extends Command implements StorageSubSystemCommand {
+    private final String dataStore;
+
+    public AttachPrimaryDataStoreCmd(String uri) {
+        super();
+        this.dataStore = uri;
+    }
+
+    public String getDataStore() {
+        return this.dataStore;
+    }
+
+    @Override
+    public boolean executeInSequence() {
+        return false;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/org/apache/cloudstack/storage/command/CopyCmdAnswer.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/command/CopyCmdAnswer.java b/core/src/org/apache/cloudstack/storage/command/CopyCmdAnswer.java
new file mode 100644
index 0000000..95c0e89
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/command/CopyCmdAnswer.java
@@ -0,0 +1,37 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.storage.command;
+
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.to.DataTO;
+
+public class CopyCmdAnswer extends Answer {
+    private DataTO newData;
+
+    public CopyCmdAnswer(DataTO newData) {
+        super(null);
+        this.newData = newData;
+    }
+
+    public DataTO getNewData() {
+        return this.newData;
+    }
+
+    public CopyCmdAnswer(String errMsg) {
+        super(null, false, errMsg);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/org/apache/cloudstack/storage/command/CopyCommand.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/command/CopyCommand.java b/core/src/org/apache/cloudstack/storage/command/CopyCommand.java
new file mode 100644
index 0000000..f14f37e
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/command/CopyCommand.java
@@ -0,0 +1,58 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.storage.command;
+
+import com.cloud.agent.api.Command;
+import com.cloud.agent.api.to.DataTO;
+
+public final class CopyCommand extends Command implements StorageSubSystemCommand {
+    private DataTO srcTO;
+    private DataTO destTO;
+    private DataTO cacheTO;
+    boolean executeInSequence = false;
+
+
+    public CopyCommand(DataTO srcData, DataTO destData, int timeout, boolean executeInSequence) {
+        super();
+        this.srcTO = srcData;
+        this.destTO = destData;
+        this.setWait(timeout);
+        this.executeInSequence = executeInSequence;
+    }
+
+    public DataTO getDestTO() {
+        return this.destTO;
+    }
+
+    public DataTO getSrcTO() {
+        return this.srcTO;
+    }
+
+    @Override
+    public boolean executeInSequence() {
+        return executeInSequence;
+    }
+
+    public DataTO getCacheTO() {
+        return cacheTO;
+    }
+
+    public void setCacheTO(DataTO cacheTO) {
+        this.cacheTO = cacheTO;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/org/apache/cloudstack/storage/command/CreateObjectAnswer.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/command/CreateObjectAnswer.java b/core/src/org/apache/cloudstack/storage/command/CreateObjectAnswer.java
new file mode 100644
index 0000000..b0c4744
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/command/CreateObjectAnswer.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.storage.command;
+
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.to.DataTO;
+
+public final class CreateObjectAnswer extends Answer {
+    private DataTO data;
+
+    protected CreateObjectAnswer() {
+        super();
+    }
+
+    public CreateObjectAnswer(DataTO data) {
+        super();
+        this.data = data;
+    }
+
+    public DataTO getData() {
+        return this.data;
+    }
+
+    public CreateObjectAnswer(String errMsg) {
+        super(null, false, errMsg);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/org/apache/cloudstack/storage/command/CreateObjectCommand.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/command/CreateObjectCommand.java b/core/src/org/apache/cloudstack/storage/command/CreateObjectCommand.java
new file mode 100644
index 0000000..121a7ee
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/command/CreateObjectCommand.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.storage.command;
+
+import com.cloud.agent.api.Command;
+import com.cloud.agent.api.to.DataTO;
+
+public final class CreateObjectCommand extends Command implements StorageSubSystemCommand {
+    private DataTO data;
+
+    public CreateObjectCommand(DataTO obj) {
+        super();
+        this.data = obj;
+    }
+
+    protected CreateObjectCommand() {
+        super();
+    }
+
+    @Override
+    public boolean executeInSequence() {
+        return false;
+    }
+
+    public DataTO getData() {
+        return this.data;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/org/apache/cloudstack/storage/command/CreatePrimaryDataStoreCmd.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/command/CreatePrimaryDataStoreCmd.java b/core/src/org/apache/cloudstack/storage/command/CreatePrimaryDataStoreCmd.java
new file mode 100644
index 0000000..b536028
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/command/CreatePrimaryDataStoreCmd.java
@@ -0,0 +1,38 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.storage.command;
+
+import com.cloud.agent.api.Command;
+
+public final class CreatePrimaryDataStoreCmd extends Command implements StorageSubSystemCommand {
+    private final String dataStore;
+
+    public CreatePrimaryDataStoreCmd(String uri) {
+        super();
+        this.dataStore = uri;
+    }
+
+    public String getDataStore() {
+        return this.dataStore;
+    }
+
+    @Override
+    public boolean executeInSequence() {
+        return false;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/org/apache/cloudstack/storage/command/DeleteCommand.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/command/DeleteCommand.java b/core/src/org/apache/cloudstack/storage/command/DeleteCommand.java
new file mode 100644
index 0000000..76696da
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/command/DeleteCommand.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.storage.command;
+
+import com.cloud.agent.api.Command;
+import com.cloud.agent.api.to.DataTO;
+
+public final class DeleteCommand extends Command implements StorageSubSystemCommand {
+    private DataTO data;
+
+    public DeleteCommand(DataTO data) {
+        super();
+        this.data = data;
+    }
+
+    protected DeleteCommand() {
+        super();
+    }
+
+    @Override
+    public boolean executeInSequence() {
+        return false;
+    }
+
+    public DataTO getData() {
+        return this.data;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/org/apache/cloudstack/storage/command/DettachAnswer.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/command/DettachAnswer.java b/core/src/org/apache/cloudstack/storage/command/DettachAnswer.java
new file mode 100644
index 0000000..62ce246
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/command/DettachAnswer.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.storage.command;
+
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.to.DiskTO;
+
+public final class DettachAnswer extends Answer {
+    private DiskTO disk;
+
+    public DettachAnswer() {
+        super(null);
+    }
+
+    public DettachAnswer(DiskTO disk) {
+        super(null);
+        this.setDisk(disk);
+    }
+
+    public DettachAnswer(String errMsg) {
+        super(null, false, errMsg);
+    }
+
+    public DiskTO getDisk() {
+        return disk;
+    }
+
+    public void setDisk(DiskTO disk) {
+        this.disk = disk;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/org/apache/cloudstack/storage/command/DettachCommand.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/command/DettachCommand.java b/core/src/org/apache/cloudstack/storage/command/DettachCommand.java
new file mode 100644
index 0000000..61cb88b
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/command/DettachCommand.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.storage.command;
+
+import com.cloud.agent.api.Command;
+import com.cloud.agent.api.to.DiskTO;
+
+public class DettachCommand extends Command implements StorageSubSystemCommand {
+    private DiskTO disk;
+    private String vmName;
+    private boolean _managed;
+    private String _iScsiName;
+    private String _storageHost;
+    private int _storagePort;
+
+    public DettachCommand(DiskTO disk, String vmName) {
+        super();
+        this.disk = disk;
+        this.vmName = vmName;
+    }
+
+    @Override
+    public boolean executeInSequence() {
+        return false;
+    }
+
+    public DiskTO getDisk() {
+        return disk;
+    }
+
+    public void setDisk(DiskTO disk) {
+        this.disk = disk;
+    }
+
+    public String getVmName() {
+        return vmName;
+    }
+
+    public void setVmName(String vmName) {
+        this.vmName = vmName;
+    }
+
+    public void setManaged(boolean managed) {
+        _managed = managed;
+    }
+
+    public boolean isManaged() {
+        return _managed;
+    }
+
+    public void set_iScsiName(String iScsiName) {
+        _iScsiName = iScsiName;
+    }
+
+    public String get_iScsiName() {
+        return _iScsiName;
+    }
+
+    public void setStorageHost(String storageHost) {
+        _storageHost = storageHost;
+    }
+
+    public String getStorageHost() {
+        return _storageHost;
+    }
+
+    public void setStoragePort(int storagePort) {
+        _storagePort = storagePort;
+    }
+
+    public int getStoragePort() {
+        return _storagePort;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/org/apache/cloudstack/storage/command/StorageSubSystemCommand.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/command/StorageSubSystemCommand.java b/core/src/org/apache/cloudstack/storage/command/StorageSubSystemCommand.java
new file mode 100644
index 0000000..d14161a
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/command/StorageSubSystemCommand.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.storage.command;
+
+public interface StorageSubSystemCommand {
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/org/apache/cloudstack/storage/to/ImageStoreTO.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/to/ImageStoreTO.java b/core/src/org/apache/cloudstack/storage/to/ImageStoreTO.java
new file mode 100644
index 0000000..0037ea5
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/to/ImageStoreTO.java
@@ -0,0 +1,79 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.storage.to;
+
+import org.apache.cloudstack.storage.image.datastore.ImageStoreInfo;
+
+import com.cloud.agent.api.to.DataStoreTO;
+import com.cloud.storage.DataStoreRole;
+
+public class ImageStoreTO implements DataStoreTO {
+    private String type;
+    private String uri;
+    private String providerName;
+    private DataStoreRole role;
+
+    public ImageStoreTO() {
+
+    }
+
+    public ImageStoreTO(ImageStoreInfo dataStore) {
+        this.type = dataStore.getType();
+        this.uri = dataStore.getUri();
+        this.providerName = null;
+        this.role = dataStore.getRole();
+    }
+
+    public String getProtocol() {
+        return this.type;
+    }
+
+    public String getUri() {
+        return this.uri;
+    }
+
+    public String getProviderName() {
+        return providerName;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public void setUri(String uri) {
+        this.uri = uri;
+    }
+
+    public void setProviderName(String providerName) {
+        this.providerName = providerName;
+    }
+
+    public void setRole(DataStoreRole role) {
+        this.role = role;
+    }
+
+    @Override
+    public DataStoreRole getRole() {
+        return this.role;
+    }
+
+    @Override
+    public String toString() {
+        return new StringBuilder("ImageStoreTO[type=").append(type).append("|provider=").append(providerName)
+                .append("|role=").append(role).append("|uri=").append(uri).append("]").toString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/org/apache/cloudstack/storage/to/PrimaryDataStoreTO.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/to/PrimaryDataStoreTO.java b/core/src/org/apache/cloudstack/storage/to/PrimaryDataStoreTO.java
new file mode 100644
index 0000000..5e870df
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/to/PrimaryDataStoreTO.java
@@ -0,0 +1,103 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.storage.to;
+
+import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
+
+import com.cloud.agent.api.to.DataStoreTO;
+import com.cloud.storage.DataStoreRole;
+import com.cloud.storage.Storage.StoragePoolType;
+
+public class PrimaryDataStoreTO implements DataStoreTO {
+    private final String uuid;
+    private final String name;
+    private String type;
+    private final long id;
+    private StoragePoolType poolType;
+    private String host;
+    private String path;
+    private int port;
+
+    public PrimaryDataStoreTO(PrimaryDataStoreInfo dataStore) {
+        this.uuid = dataStore.getUuid();
+        this.name = dataStore.getName();
+        this.id = dataStore.getId();
+        this.setPoolType(dataStore.getPoolType());
+        this.setHost(dataStore.getHostAddress());
+        this.setPath(dataStore.getPath());
+        this.setPort(dataStore.getPort());
+    }
+
+    public long getId() {
+        return this.id;
+    }
+
+    public String getUuid() {
+        return this.uuid;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public String getType() {
+        return this.type;
+    }
+
+    @Override
+    public DataStoreRole getRole() {
+        return DataStoreRole.Primary;
+    }
+
+    public StoragePoolType getPoolType() {
+        return poolType;
+    }
+
+    public void setPoolType(StoragePoolType poolType) {
+        this.poolType = poolType;
+    }
+
+    public String getHost() {
+        return host;
+    }
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    public String getPath() {
+        return path;
+    }
+
+    public void setPath(String path) {
+        this.path = path;
+    }
+
+    public int getPort() {
+        return port;
+    }
+
+    public void setPort(int port) {
+        this.port = port;
+    }
+
+    @Override
+    public String toString() {
+        return new StringBuilder("PrimaryDataStoreTO[uuid=").append(uuid).append("|name=").append(name)
+                .append("|id=").append(id).append("|pooltype=").append(poolType).append("]").toString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/org/apache/cloudstack/storage/to/SnapshotObjectTO.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/to/SnapshotObjectTO.java b/core/src/org/apache/cloudstack/storage/to/SnapshotObjectTO.java
new file mode 100644
index 0000000..d2cb72a
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/to/SnapshotObjectTO.java
@@ -0,0 +1,128 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.storage.to;
+
+import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
+
+import com.cloud.agent.api.to.DataObjectType;
+import com.cloud.agent.api.to.DataStoreTO;
+import com.cloud.agent.api.to.DataTO;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+
+public class SnapshotObjectTO implements DataTO {
+    private String path;
+    private VolumeObjectTO volume;
+    private String parentSnapshotPath;
+    private DataStoreTO dataStore;
+    private String vmName;
+    private String name;
+    private HypervisorType hypervisorType;
+    private long id;
+
+    public SnapshotObjectTO() {
+
+    }
+
+    public SnapshotObjectTO(SnapshotInfo snapshot) {
+        this.path = snapshot.getPath();
+        this.setId(snapshot.getId());
+        this.volume = (VolumeObjectTO) snapshot.getBaseVolume().getTO();
+        this.setVmName(snapshot.getBaseVolume().getAttachedVmName());
+        SnapshotInfo parentSnapshot = snapshot.getParent();
+        if (parentSnapshot != null) {
+            this.parentSnapshotPath = parentSnapshot.getPath();
+        }
+        this.dataStore = snapshot.getDataStore().getTO();
+        this.setName(snapshot.getName());
+        this.hypervisorType = snapshot.getHypervisorType();
+    }
+
+    @Override
+    public DataObjectType getObjectType() {
+        return DataObjectType.SNAPSHOT;
+    }
+
+    @Override
+    public DataStoreTO getDataStore() {
+        return this.dataStore;
+    }
+
+    @Override
+    public String getPath() {
+        return this.path;
+    }
+
+    public void setPath(String path) {
+        this.path = path;
+    }
+
+    public VolumeObjectTO getVolume() {
+        return volume;
+    }
+
+    public void setVolume(VolumeObjectTO volume) {
+        this.volume = volume;
+    }
+
+    public String getParentSnapshotPath() {
+        return parentSnapshotPath;
+    }
+
+    public void setParentSnapshotPath(String parentSnapshotPath) {
+        this.parentSnapshotPath = parentSnapshotPath;
+    }
+
+    public String getVmName() {
+        return vmName;
+    }
+
+    public void setVmName(String vmName) {
+        this.vmName = vmName;
+    }
+
+    @Override
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @Override
+    public HypervisorType getHypervisorType() {
+        return hypervisorType;
+    }
+
+    public void setHypervisorType(HypervisorType hypervisorType) {
+        this.hypervisorType = hypervisorType;
+    }
+
+    @Override
+    public String toString() {
+        return new StringBuilder("SnapshotTO[datastore=").append(dataStore).append("|volume=").append(volume).append("|path")
+                .append(path).append("]").toString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/org/apache/cloudstack/storage/to/TemplateObjectTO.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/to/TemplateObjectTO.java b/core/src/org/apache/cloudstack/storage/to/TemplateObjectTO.java
new file mode 100644
index 0000000..2347de3
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/to/TemplateObjectTO.java
@@ -0,0 +1,208 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.storage.to;
+
+import com.cloud.hypervisor.Hypervisor;
+import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
+
+import com.cloud.agent.api.to.DataObjectType;
+import com.cloud.agent.api.to.DataStoreTO;
+import com.cloud.agent.api.to.DataTO;
+import com.cloud.storage.Storage.ImageFormat;
+import com.cloud.template.VirtualMachineTemplate;
+
+public class TemplateObjectTO implements DataTO {
+    private String path;
+    private String origUrl;
+    private String uuid;
+    private long id;
+    private ImageFormat format;
+    private long accountId;
+    private String checksum;
+    private boolean hvm;
+    private String displayText;
+    private DataStoreTO imageDataStore;
+    private String name;
+    private String guestOsType;
+    private Long size;
+    private Hypervisor.HypervisorType hypervisorType;
+
+    public TemplateObjectTO() {
+
+    }
+
+    public TemplateObjectTO(VirtualMachineTemplate template) {
+        this.uuid = template.getUuid();
+        this.id = template.getId();
+        this.origUrl = template.getUrl();
+        this.displayText = template.getDisplayText();
+        this.checksum = template.getChecksum();
+        this.hvm = template.isRequiresHvm();
+        this.accountId = template.getAccountId();
+        this.name = template.getUniqueName();
+        this.format = template.getFormat();
+        this.hypervisorType = template.getHypervisorType();
+    }
+
+    public TemplateObjectTO(TemplateInfo template) {
+        this.path = template.getInstallPath();
+        this.uuid = template.getUuid();
+        this.id = template.getId();
+        this.origUrl = template.getUrl();
+        this.displayText = template.getDisplayText();
+        this.checksum = template.getChecksum();
+        this.hvm = template.isRequiresHvm();
+        this.accountId = template.getAccountId();
+        this.name = template.getUniqueName();
+        this.format = template.getFormat();
+        if (template.getDataStore() != null) {
+            this.imageDataStore = template.getDataStore().getTO();
+        }
+        this.hypervisorType = template.getHypervisorType();
+    }
+
+    @Override
+    public String getPath() {
+        return this.path;
+    }
+
+    public String getUuid() {
+        return this.uuid;
+    }
+
+    @Override
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id){
+        this.id = id;
+    }
+
+    public ImageFormat getFormat() {
+        return format;
+    }
+
+    public long getAccountId() {
+        return accountId;
+    }
+
+    public String getChecksum() {
+        return checksum;
+    }
+
+    public boolean isRequiresHvm() {
+        return hvm;
+    }
+
+    public void setRequiresHvm(boolean hvm) {
+        this.hvm = hvm;
+    }
+
+    public String getDescription() {
+        return displayText;
+    }
+
+    public void setDescription(String desc) {
+        this.displayText = desc;
+    }
+
+
+    @Override
+    public DataObjectType getObjectType() {
+        return DataObjectType.TEMPLATE;
+    }
+
+    @Override
+    public DataStoreTO getDataStore() {
+        return this.imageDataStore;
+    }
+
+    @Override
+    public Hypervisor.HypervisorType getHypervisorType() {
+        return this.hypervisorType;
+    }
+
+    public void setDataStore(DataStoreTO store){
+        this.imageDataStore = store;
+    }
+
+    /**
+     * @return the name
+     */
+    public String getName() {
+        return name;
+    }
+
+    public void setPath(String path) {
+        this.path = path;
+    }
+
+    public void setUuid(String uuid) {
+        this.uuid = uuid;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getOrigUrl() {
+        return origUrl;
+    }
+
+    public void setOrigUrl(String origUrl) {
+        this.origUrl = origUrl;
+    }
+
+    public void setFormat(ImageFormat format) {
+        this.format = format;
+    }
+
+    public void setAccountId(long accountId) {
+        this.accountId = accountId;
+    }
+
+    public void setChecksum(String checksum) {
+        this.checksum = checksum;
+    }
+
+    public void setImageDataStore(DataStoreTO imageDataStore) {
+        this.imageDataStore = imageDataStore;
+    }
+
+    public String getGuestOsType() {
+        return guestOsType;
+    }
+
+    public void setGuestOsType(String guestOsType) {
+        this.guestOsType = guestOsType;
+    }
+
+    public Long getSize() {
+        return size;
+    }
+
+    public void setSize(Long size) {
+        this.size = size;
+    }
+
+    @Override
+    public String toString() {
+        return new StringBuilder("TemplateTO[id=").append(id).append("|origUrl=").append(origUrl)
+                .append("|name").append(name).append("]").toString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/core/src/org/apache/cloudstack/storage/to/VolumeObjectTO.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/to/VolumeObjectTO.java b/core/src/org/apache/cloudstack/storage/to/VolumeObjectTO.java
new file mode 100644
index 0000000..9f466ae
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/to/VolumeObjectTO.java
@@ -0,0 +1,223 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.storage.to;
+
+import com.cloud.hypervisor.Hypervisor;
+import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
+
+import com.cloud.agent.api.to.DataObjectType;
+import com.cloud.agent.api.to.DataStoreTO;
+import com.cloud.agent.api.to.DataTO;
+import com.cloud.storage.Storage;
+import com.cloud.storage.Volume;
+
+public class VolumeObjectTO implements DataTO {
+    private String uuid;
+    private Volume.Type volumeType;
+    private DataStoreTO dataStore;
+    private String name;
+    private long size;
+    private String path;
+    private Long volumeId;
+    private String vmName;
+    private long accountId;
+    private String chainInfo;
+    private Storage.ImageFormat format;
+    private long id;
+    private Long bytesReadRate;
+    private Long bytesWriteRate;
+    private Long iopsReadRate;
+    private Long iopsWriteRate;
+    private Hypervisor.HypervisorType hypervisorType;
+
+    public VolumeObjectTO() {
+
+    }
+
+    public VolumeObjectTO(VolumeInfo volume) {
+        this.uuid = volume.getUuid();
+        this.path = volume.getPath();
+        this.accountId = volume.getAccountId();
+        if (volume.getDataStore() != null) {
+            this.dataStore = volume.getDataStore().getTO();
+        } else {
+            this.dataStore = null;
+        }
+        this.vmName = volume.getAttachedVmName();
+        this.size = volume.getSize();
+        this.setVolumeId(volume.getId());
+        this.chainInfo = volume.getChainInfo();
+        this.volumeType = volume.getVolumeType();
+        this.name = volume.getName();
+        this.setId(volume.getId());
+        this.format = volume.getFormat();
+        this.bytesReadRate = volume.getBytesReadRate();
+        this.bytesWriteRate = volume.getBytesWriteRate();
+        this.iopsReadRate = volume.getIopsReadRate();
+        this.iopsWriteRate = volume.getIopsWriteRate();
+        this.hypervisorType = volume.getHypervisorType();
+    }
+
+    public String getUuid() {
+        return this.uuid;
+    }
+
+    @Override
+    public String getPath() {
+        return this.path;
+    }
+
+    public Volume.Type getVolumeType() {
+        return this.volumeType;
+    }
+
+    @Override
+    public DataStoreTO getDataStore() {
+        return this.dataStore;
+    }
+
+    @Override
+    public Hypervisor.HypervisorType getHypervisorType() {
+        return this.hypervisorType;
+    }
+
+
+    public void setDataStore(DataStoreTO store){
+        this.dataStore = store;
+    }
+
+    public void setDataStore(PrimaryDataStoreTO dataStore) {
+        this.dataStore = dataStore;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public long getSize() {
+        return this.size;
+    }
+
+    @Override
+    public DataObjectType getObjectType() {
+        return DataObjectType.VOLUME;
+    }
+
+    public void setUuid(String uuid) {
+        this.uuid = uuid;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public void setSize(long size) {
+        this.size = size;
+    }
+
+    public void setPath(String path) {
+        this.path = path;
+    }
+
+    public Long getVolumeId() {
+        return volumeId;
+    }
+
+    public void setVolumeId(Long volumeId) {
+        this.volumeId = volumeId;
+    }
+
+    public long getAccountId() {
+        return accountId;
+    }
+
+    public void setAccountId(long accountId) {
+        this.accountId = accountId;
+    }
+
+    public String getVmName() {
+        return vmName;
+    }
+
+    public void setVmName(String vmName) {
+        this.vmName = vmName;
+    }
+
+    public String getChainInfo() {
+        return chainInfo;
+    }
+
+    public void setChainInfo(String chainInfo) {
+        this.chainInfo = chainInfo;
+    }
+
+    @Override
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public Storage.ImageFormat getFormat() {
+        return format;
+    }
+
+    public void setFormat(Storage.ImageFormat format) {
+        this.format = format;
+    }
+
+    @Override
+    public String toString() {
+        return new StringBuilder("volumeTO[uuid=").append(uuid).append("|path=").append(path)
+                .append("|datastore=").append(dataStore).append("]").toString();
+    }
+
+    public void setBytesReadRate(Long bytesReadRate) {
+        this.bytesReadRate = bytesReadRate;
+    }
+
+    public Long getBytesReadRate() {
+        return bytesReadRate;
+    }
+
+    public void setBytesWriteRate(Long bytesWriteRate) {
+        this.bytesWriteRate = bytesWriteRate;
+    }
+
+    public Long getBytesWriteRate() {
+        return bytesWriteRate;
+    }
+
+    public void setIopsReadRate(Long iopsReadRate) {
+        this.iopsReadRate = iopsReadRate;
+    }
+
+    public Long getIopsReadRate() {
+        return iopsReadRate;
+    }
+
+    public void setIopsWriteRate(Long iopsWriteRate) {
+        this.iopsWriteRate = iopsWriteRate;
+    }
+
+    public Long getIopsWriteRate() {
+        return iopsWriteRate;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/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 510be91..973a799 100644
--- a/core/test/com/cloud/agent/transport/RequestTest.java
+++ b/core/test/com/cloud/agent/transport/RequestTest.java
@@ -20,17 +20,18 @@ import java.nio.ByteBuffer;
 
 import junit.framework.TestCase;
 
-import org.apache.cloudstack.storage.command.DownloadCommand;
-import org.apache.cloudstack.storage.to.TemplateObjectTO;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 import org.junit.Assert;
+import org.mockito.Mockito;
+
+import org.apache.cloudstack.storage.command.DownloadCommand;
+import org.apache.cloudstack.storage.to.TemplateObjectTO;
 
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.Command;
 import com.cloud.agent.api.GetHostStatsCommand;
 import com.cloud.agent.api.SecStorageFirewallCfgCommand;
-import com.cloud.agent.api.SecStorageSetupCommand;
 import com.cloud.agent.api.UpdateHostPasswordCommand;
 import com.cloud.agent.api.storage.DownloadAnswer;
 import com.cloud.agent.api.storage.ListTemplateCommand;
@@ -38,11 +39,11 @@ import com.cloud.agent.api.to.NfsTO;
 import com.cloud.exception.UnsupportedVersionException;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.serializer.GsonHelper;
+import com.cloud.storage.DataStoreRole;
 import com.cloud.storage.Storage.ImageFormat;
 import com.cloud.storage.Storage.TemplateType;
 import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
-import com.cloud.storage.DataStoreRole;
-import com.cloud.storage.VMTemplateVO;
+import com.cloud.template.VirtualMachineTemplate;
 
 /**
  *
@@ -165,8 +166,15 @@ public class RequestTest extends TestCase {
 
     public void testDownload() {
         s_logger.info("Testing Download answer");
-        VMTemplateVO template = new VMTemplateVO(1, "templatename", ImageFormat.QCOW2, true, true, true, TemplateType.USER, "url", true, 32, 1, "chksum", "displayText", true, 30, true,
-                HypervisorType.KVM, null);
+        VirtualMachineTemplate template = Mockito.mock(VirtualMachineTemplate.class);
+        Mockito.when(template.getId()).thenReturn(1L);
+        Mockito.when(template.getFormat()).thenReturn(ImageFormat.QCOW2);
+        Mockito.when(template.getName()).thenReturn("templatename");
+        Mockito.when(template.getTemplateType()).thenReturn(TemplateType.USER);
+        Mockito.when(template.getDisplayText()).thenReturn("displayText");
+        Mockito.when(template.getHypervisorType()).thenReturn(HypervisorType.KVM);
+        Mockito.when(template.getUrl()).thenReturn("url");
+
         NfsTO nfs = new NfsTO("secUrl", DataStoreRole.Image);
         TemplateObjectTO to = new TemplateObjectTO(template);
         to.setImageDataStore(nfs);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/command/AttachAnswer.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/command/AttachAnswer.java b/engine/api/src/org/apache/cloudstack/storage/command/AttachAnswer.java
deleted file mode 100644
index 5a26d4a..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/command/AttachAnswer.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cloudstack.storage.command;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.to.DiskTO;
-
-public class AttachAnswer extends Answer {
-    private DiskTO disk;
-
-    public AttachAnswer() {
-        super(null);
-    }
-
-    public AttachAnswer(DiskTO disk) {
-        super(null);
-        this.setDisk(disk);
-    }
-
-    public AttachAnswer(String errMsg) {
-        super(null, false, errMsg);
-    }
-
-    public DiskTO getDisk() {
-        return disk;
-    }
-
-    public void setDisk(DiskTO disk) {
-        this.disk = disk;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/command/AttachCommand.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/command/AttachCommand.java b/engine/api/src/org/apache/cloudstack/storage/command/AttachCommand.java
deleted file mode 100644
index 44bce91..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/command/AttachCommand.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cloudstack.storage.command;
-
-import com.cloud.agent.api.Command;
-import com.cloud.agent.api.to.DiskTO;
-
-public final class AttachCommand extends Command implements StorageSubSystemCommand {
-    private DiskTO disk;
-    private String vmName;
-    private String _storageHost;
-    private int _storagePort;
-    private boolean _managed;
-    private String _iScsiName;
-    private String _chapInitiatorUsername;
-    private String _chapInitiatorPassword;
-    private String _chapTargetUsername;
-    private String _chapTargetPassword;
-
-    public AttachCommand(DiskTO disk, String vmName) {
-        super();
-        this.disk = disk;
-        this.vmName = vmName;
-    }
-
-    @Override
-    public boolean executeInSequence() {
-        return false;
-    }
-
-    public DiskTO getDisk() {
-        return disk;
-    }
-
-    public void setDisk(DiskTO disk) {
-        this.disk = disk;
-    }
-
-    public String getVmName() {
-        return vmName;
-    }
-
-    public void setVmName(String vmName) {
-        this.vmName = vmName;
-    }
-
-    public void setStorageHost(String storageHost) {
-        _storageHost = storageHost;
-    }
-
-    public String getStorageHost() {
-        return _storageHost;
-    }
-
-    public void setStoragePort(int storagePort) {
-        _storagePort = storagePort;
-    }
-
-    public int getStoragePort() {
-        return _storagePort;
-    }
-
-    public void setManaged(boolean managed) {
-        _managed = managed;
-    }
-
-    public boolean isManaged() {
-        return _managed;
-    }
-
-    public void set_iScsiName(String iScsiName) {
-        this._iScsiName = iScsiName;
-    }
-
-    public String get_iScsiName() {
-        return _iScsiName;
-    }
-
-    public void setChapInitiatorUsername(String chapInitiatorUsername) {
-        _chapInitiatorUsername = chapInitiatorUsername;
-    }
-
-    public String getChapInitiatorUsername() {
-        return _chapInitiatorUsername;
-    }
-
-    public void setChapInitiatorPassword(String chapInitiatorPassword) {
-        _chapInitiatorPassword = chapInitiatorPassword;
-    }
-
-    public String getChapInitiatorPassword() {
-        return _chapInitiatorPassword;
-    }
-
-    public void setChapTargetUsername(String chapTargetUsername) {
-        _chapTargetUsername = chapTargetUsername;
-    }
-
-    public String getChapTargetUsername() {
-        return _chapTargetUsername;
-    }
-
-    public void setChapTargetPassword(String chapTargetPassword) {
-        _chapTargetPassword = chapTargetPassword;
-    }
-
-    public String getChapTargetPassword() {
-        return _chapTargetPassword;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreAnswer.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreAnswer.java b/engine/api/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreAnswer.java
deleted file mode 100644
index 6d5bbaf..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreAnswer.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cloudstack.storage.command;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.Command;
-
-public class AttachPrimaryDataStoreAnswer extends Answer {
-    private String uuid;
-    private long capacity;
-    private long avail;
-
-    public AttachPrimaryDataStoreAnswer(Command cmd) {
-        super(cmd);
-    }
-
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    public String getUuid() {
-        return this.uuid;
-    }
-
-    public void setCapacity(long capacity) {
-        this.capacity = capacity;
-    }
-
-    public long getCapacity() {
-        return this.capacity;
-    }
-
-    public void setAvailable(long avail) {
-        this.avail = avail;
-    }
-
-    public long getAvailable() {
-        return this.avail;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreCmd.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreCmd.java b/engine/api/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreCmd.java
deleted file mode 100644
index 2083876..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreCmd.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cloudstack.storage.command;
-
-import com.cloud.agent.api.Command;
-
-public final class AttachPrimaryDataStoreCmd extends Command implements StorageSubSystemCommand {
-    private final String dataStore;
-
-    public AttachPrimaryDataStoreCmd(String uri) {
-        super();
-        this.dataStore = uri;
-    }
-
-    public String getDataStore() {
-        return this.dataStore;
-    }
-
-    @Override
-    public boolean executeInSequence() {
-        return false;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/command/CopyCmdAnswer.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/command/CopyCmdAnswer.java b/engine/api/src/org/apache/cloudstack/storage/command/CopyCmdAnswer.java
deleted file mode 100644
index 95c0e89..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/command/CopyCmdAnswer.java
+++ /dev/null
@@ -1,37 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.storage.command;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.to.DataTO;
-
-public class CopyCmdAnswer extends Answer {
-    private DataTO newData;
-
-    public CopyCmdAnswer(DataTO newData) {
-        super(null);
-        this.newData = newData;
-    }
-
-    public DataTO getNewData() {
-        return this.newData;
-    }
-
-    public CopyCmdAnswer(String errMsg) {
-        super(null, false, errMsg);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/command/CopyCommand.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/command/CopyCommand.java b/engine/api/src/org/apache/cloudstack/storage/command/CopyCommand.java
deleted file mode 100644
index f14f37e..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/command/CopyCommand.java
+++ /dev/null
@@ -1,58 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.storage.command;
-
-import com.cloud.agent.api.Command;
-import com.cloud.agent.api.to.DataTO;
-
-public final class CopyCommand extends Command implements StorageSubSystemCommand {
-    private DataTO srcTO;
-    private DataTO destTO;
-    private DataTO cacheTO;
-    boolean executeInSequence = false;
-
-
-    public CopyCommand(DataTO srcData, DataTO destData, int timeout, boolean executeInSequence) {
-        super();
-        this.srcTO = srcData;
-        this.destTO = destData;
-        this.setWait(timeout);
-        this.executeInSequence = executeInSequence;
-    }
-
-    public DataTO getDestTO() {
-        return this.destTO;
-    }
-
-    public DataTO getSrcTO() {
-        return this.srcTO;
-    }
-
-    @Override
-    public boolean executeInSequence() {
-        return executeInSequence;
-    }
-
-    public DataTO getCacheTO() {
-        return cacheTO;
-    }
-
-    public void setCacheTO(DataTO cacheTO) {
-        this.cacheTO = cacheTO;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/command/CreateObjectAnswer.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/command/CreateObjectAnswer.java b/engine/api/src/org/apache/cloudstack/storage/command/CreateObjectAnswer.java
deleted file mode 100644
index b0c4744..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/command/CreateObjectAnswer.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cloudstack.storage.command;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.to.DataTO;
-
-public final class CreateObjectAnswer extends Answer {
-    private DataTO data;
-
-    protected CreateObjectAnswer() {
-        super();
-    }
-
-    public CreateObjectAnswer(DataTO data) {
-        super();
-        this.data = data;
-    }
-
-    public DataTO getData() {
-        return this.data;
-    }
-
-    public CreateObjectAnswer(String errMsg) {
-        super(null, false, errMsg);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/command/CreateObjectCommand.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/command/CreateObjectCommand.java b/engine/api/src/org/apache/cloudstack/storage/command/CreateObjectCommand.java
deleted file mode 100644
index 121a7ee..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/command/CreateObjectCommand.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cloudstack.storage.command;
-
-import com.cloud.agent.api.Command;
-import com.cloud.agent.api.to.DataTO;
-
-public final class CreateObjectCommand extends Command implements StorageSubSystemCommand {
-    private DataTO data;
-
-    public CreateObjectCommand(DataTO obj) {
-        super();
-        this.data = obj;
-    }
-
-    protected CreateObjectCommand() {
-        super();
-    }
-
-    @Override
-    public boolean executeInSequence() {
-        return false;
-    }
-
-    public DataTO getData() {
-        return this.data;
-    }
-
-}