cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject [7/9] git commit: updated refs/heads/master to d785479
Date Sat, 23 May 2015 15:27:57 GMT
Fix xenserver tests for travis


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

Branch: refs/heads/master
Commit: 79d24ae218889b36674f2c064701638b3f2c5e29
Parents: cd55413
Author: Rafael da Fonseca <rsafonseca@gmail.com>
Authored: Sat May 23 16:14:09 2015 +0200
Committer: Rafael da Fonseca <rsafonseca@gmail.com>
Committed: Sat May 23 16:14:09 2015 +0200

----------------------------------------------------------------------
 .../xenserver/resource/CitrixResourceBase.java  |   4 +-
 .../wrapper/CitrixAttachIsoCommandWrapper.java  | 136 ------------
 .../CitrixAttachVolumeCommandWrapper.java       | 146 -------------
 ...trixCheckConsoleProxyLoadCommandWrapper.java |  43 ----
 .../CitrixCheckHealthCommandWrapper.java        |  37 ----
 .../CitrixCheckNetworkCommandWrapper.java       |  96 ---------
 .../CitrixCheckOnHostCommandWrapper.java        |  36 ----
 .../wrapper/CitrixCheckSshCommandWrapper.java   |  65 ------
 ...CitrixCheckVirtualMachineCommandWrapper.java |  50 -----
 .../CitrixCleanupNetworkRulesCmdWrapper.java    |  56 -----
 ...trixClusterVMMetaDataSyncCommandWrapper.java |  59 ------
 .../CitrixConsoleProxyLoadCommandWrapper.java   |  83 --------
 .../wrapper/CitrixCreateCommandWrapper.java     |  84 --------
 .../CitrixCreateStoragePoolCommandWrapper.java  |  59 ------
 .../CitrixCreateVMSnapshotCommandWrapper.java   | 190 -----------------
 .../CitrixDeleteStoragePoolCommandWrapper.java  |  54 -----
 .../CitrixDeleteVMSnapshotCommandWrapper.java   |  92 --------
 .../wrapper/CitrixDestroyCommandWrapper.java    |  85 --------
 .../CitrixGetHostStatsCommandWrapper.java       |  50 -----
 .../CitrixGetStorageStatsCommandWrapper.java    |  71 -------
 .../CitrixGetVmDiskStatsCommandWrapper.java     |  36 ----
 .../wrapper/CitrixGetVmStatsCommandWrapper.java |  84 --------
 .../wrapper/CitrixGetVncPortCommandWrapper.java |  58 -----
 .../wrapper/CitrixMaintainCommandWrapper.java   |  77 -------
 .../wrapper/CitrixMigrateCommandWrapper.java    |  86 --------
 .../CitrixModifySshKeysCommandWrapper.java      |  35 ---
 .../CitrixModifyStoragePoolCommandWrapper.java  |  98 ---------
 .../CitrixNetworkElementCommandWrapper.java     |  37 ----
 ...itrixNetworkRulesSystemVmCommandWrapper.java |  47 ----
 ...NetworkRulesVmSecondaryIpCommandWrapper.java |  46 ----
 .../CitrixOvsCreateGreTunnelCommandWrapper.java |  69 ------
 .../CitrixOvsCreateTunnelCommandWrapper.java    |  69 ------
 .../CitrixOvsDeleteFlowCommandWrapper.java      |  64 ------
 .../CitrixOvsDestroyBridgeCommandWrapper.java   |  55 -----
 .../CitrixOvsDestroyTunnelCommandWrapper.java   |  60 ------
 .../CitrixOvsFetchInterfaceCommandWrapper.java  |  73 -------
 .../CitrixOvsSetTagAndFlowCommandWrapper.java   |  74 -------
 .../CitrixOvsSetupBridgeCommandWrapper.java     |  47 ----
 ...VpcPhysicalTopologyConfigCommandWrapper.java |  59 ------
 ...OvsVpcRoutingPolicyConfigCommandWrapper.java |  59 ------
 .../CitrixPerformanceMonitorCommandWrapper.java |  43 ----
 .../wrapper/CitrixPingTestCommandWrapper.java   |  49 -----
 .../wrapper/CitrixPlugNicCommandWrapper.java    |  94 --------
 ...CitrixPrepareForMigrationCommandWrapper.java |  63 ------
 ...rixPrimaryStorageDownloadCommandWrapper.java |  85 --------
 .../wrapper/CitrixPvlanSetupCommandWrapper.java |  94 --------
 .../wrapper/CitrixReadyCommandWrapper.java      |  77 -------
 .../wrapper/CitrixRebootCommandWrapper.java     |  70 ------
 .../CitrixRebootRouterCommandWrapper.java       |  54 -----
 .../resource/wrapper/CitrixRequestWrapper.java  | 124 -----------
 .../CitrixResizeVolumeCommandWrapper.java       |  54 -----
 .../CitrixRevertToVMSnapshotCommandWrapper.java | 112 ----------
 .../wrapper/CitrixScaleVmCommandWrapper.java    | 108 ----------
 .../CitrixSecurityGroupRulesCommandWrapper.java |  63 ------
 .../wrapper/CitrixSetupCommandWrapper.java      | 202 ------------------
 .../wrapper/CitrixStartCommandWrapper.java      | 212 -------------------
 .../wrapper/CitrixStopCommandWrapper.java       | 175 ---------------
 .../CitrixStorageSubSystemCommandWrapper.java   |  38 ----
 .../wrapper/CitrixUnPlugNicCommandWrapper.java  |  74 -------
 .../CitrixUpdateHostPasswordCommandWrapper.java |  36 ----
 .../CitrixUpgradeSnapshotCommandWrapper.java    |  66 ------
 ...trixWatchConsoleProxyLoadCommandWrapper.java |  43 ----
 .../citrix/CitrixAttachIsoCommandWrapper.java   | 136 ++++++++++++
 .../CitrixAttachVolumeCommandWrapper.java       | 146 +++++++++++++
 ...trixCheckConsoleProxyLoadCommandWrapper.java |  43 ++++
 .../citrix/CitrixCheckHealthCommandWrapper.java |  37 ++++
 .../CitrixCheckNetworkCommandWrapper.java       |  96 +++++++++
 .../citrix/CitrixCheckOnHostCommandWrapper.java |  36 ++++
 .../citrix/CitrixCheckSshCommandWrapper.java    |  65 ++++++
 ...CitrixCheckVirtualMachineCommandWrapper.java |  50 +++++
 .../CitrixCleanupNetworkRulesCmdWrapper.java    |  56 +++++
 ...trixClusterVMMetaDataSyncCommandWrapper.java |  59 ++++++
 .../CitrixConsoleProxyLoadCommandWrapper.java   |  83 ++++++++
 .../citrix/CitrixCreateCommandWrapper.java      |  84 ++++++++
 .../CitrixCreateStoragePoolCommandWrapper.java  |  59 ++++++
 .../CitrixCreateVMSnapshotCommandWrapper.java   | 190 +++++++++++++++++
 .../CitrixDeleteStoragePoolCommandWrapper.java  |  54 +++++
 .../CitrixDeleteVMSnapshotCommandWrapper.java   |  92 ++++++++
 .../citrix/CitrixDestroyCommandWrapper.java     |  85 ++++++++
 .../CitrixGetHostStatsCommandWrapper.java       |  50 +++++
 .../CitrixGetStorageStatsCommandWrapper.java    |  71 +++++++
 .../CitrixGetVmDiskStatsCommandWrapper.java     |  36 ++++
 .../citrix/CitrixGetVmStatsCommandWrapper.java  |  84 ++++++++
 .../citrix/CitrixGetVncPortCommandWrapper.java  |  58 +++++
 .../citrix/CitrixMaintainCommandWrapper.java    |  77 +++++++
 .../citrix/CitrixMigrateCommandWrapper.java     |  86 ++++++++
 .../CitrixModifySshKeysCommandWrapper.java      |  35 +++
 .../CitrixModifyStoragePoolCommandWrapper.java  |  98 +++++++++
 .../CitrixNetworkElementCommandWrapper.java     |  37 ++++
 ...itrixNetworkRulesSystemVmCommandWrapper.java |  47 ++++
 ...NetworkRulesVmSecondaryIpCommandWrapper.java |  46 ++++
 .../CitrixOvsCreateGreTunnelCommandWrapper.java |  69 ++++++
 .../CitrixOvsCreateTunnelCommandWrapper.java    |  69 ++++++
 .../CitrixOvsDeleteFlowCommandWrapper.java      |  64 ++++++
 .../CitrixOvsDestroyBridgeCommandWrapper.java   |  55 +++++
 .../CitrixOvsDestroyTunnelCommandWrapper.java   |  60 ++++++
 .../CitrixOvsFetchInterfaceCommandWrapper.java  |  73 +++++++
 .../CitrixOvsSetTagAndFlowCommandWrapper.java   |  74 +++++++
 .../CitrixOvsSetupBridgeCommandWrapper.java     |  47 ++++
 ...VpcPhysicalTopologyConfigCommandWrapper.java |  59 ++++++
 ...OvsVpcRoutingPolicyConfigCommandWrapper.java |  59 ++++++
 .../CitrixPerformanceMonitorCommandWrapper.java |  43 ++++
 .../citrix/CitrixPingTestCommandWrapper.java    |  49 +++++
 .../citrix/CitrixPlugNicCommandWrapper.java     |  94 ++++++++
 ...CitrixPrepareForMigrationCommandWrapper.java |  63 ++++++
 ...rixPrimaryStorageDownloadCommandWrapper.java |  85 ++++++++
 .../citrix/CitrixPvlanSetupCommandWrapper.java  |  94 ++++++++
 .../citrix/CitrixReadyCommandWrapper.java       |  77 +++++++
 .../citrix/CitrixRebootCommandWrapper.java      |  70 ++++++
 .../CitrixRebootRouterCommandWrapper.java       |  54 +++++
 .../wrapper/citrix/CitrixRequestWrapper.java    | 124 +++++++++++
 .../CitrixResizeVolumeCommandWrapper.java       |  54 +++++
 .../CitrixRevertToVMSnapshotCommandWrapper.java | 112 ++++++++++
 .../citrix/CitrixScaleVmCommandWrapper.java     | 108 ++++++++++
 .../CitrixSecurityGroupRulesCommandWrapper.java |  63 ++++++
 .../citrix/CitrixSetupCommandWrapper.java       | 202 ++++++++++++++++++
 .../citrix/CitrixStartCommandWrapper.java       | 212 +++++++++++++++++++
 .../citrix/CitrixStopCommandWrapper.java        | 175 +++++++++++++++
 .../CitrixStorageSubSystemCommandWrapper.java   |  38 ++++
 .../citrix/CitrixUnPlugNicCommandWrapper.java   |  74 +++++++
 .../CitrixUpdateHostPasswordCommandWrapper.java |  36 ++++
 .../CitrixUpgradeSnapshotCommandWrapper.java    |  66 ++++++
 ...trixWatchConsoleProxyLoadCommandWrapper.java |  43 ++++
 .../wrapper/CitrixRequestWrapperTest.java       |   5 +-
 .../resource/wrapper/XcpServerWrapperTest.java  |   2 +-
 .../wrapper/XenServer56FP1WrapperTest.java      |   2 +-
 .../wrapper/XenServer56WrapperTest.java         |   2 +-
 .../wrapper/XenServer610WrapperTest.java        |   2 +-
 .../wrapper/XenServer620SP1WrapperTest.java     |   2 +-
 .../wrapper/XenServer620WrapperTest.java        |   2 +-
 130 files changed, 4672 insertions(+), 4671 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
index 6aaaf0e..720fca2 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
@@ -98,7 +98,7 @@ import com.cloud.agent.resource.virtualnetwork.VirtualRoutingResource;
 import com.cloud.exception.InternalErrorException;
 import com.cloud.host.Host.Type;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.hypervisor.xenserver.resource.wrapper.CitrixRequestWrapper;
+import com.cloud.hypervisor.xenserver.resource.wrapper.citrix.CitrixRequestWrapper;
 import com.cloud.network.Networks;
 import com.cloud.network.Networks.BroadcastDomainType;
 import com.cloud.network.Networks.TrafficType;
@@ -4940,4 +4940,4 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
             }
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixAttachIsoCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixAttachIsoCommandWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixAttachIsoCommandWrapper.java
deleted file mode 100644
index 22fc1ac..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixAttachIsoCommandWrapper.java
+++ /dev/null
@@ -1,136 +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.hypervisor.xenserver.resource.wrapper;
-
-import java.util.Set;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.AttachIsoCommand;
-import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
-import com.cloud.resource.CommandWrapper;
-import com.cloud.resource.ResourceWrapper;
-import com.cloud.utils.exception.CloudRuntimeException;
-import com.xensource.xenapi.Connection;
-import com.xensource.xenapi.SR;
-import com.xensource.xenapi.Types;
-import com.xensource.xenapi.Types.XenAPIException;
-import com.xensource.xenapi.VBD;
-import com.xensource.xenapi.VDI;
-import com.xensource.xenapi.VM;
-
-@ResourceWrapper(handles =  AttachIsoCommand.class)
-public final class CitrixAttachIsoCommandWrapper extends CommandWrapper<AttachIsoCommand, Answer, CitrixResourceBase> {
-
-    private static final Logger s_logger = Logger.getLogger(CitrixAttachIsoCommandWrapper.class);
-
-    @Override
-    public Answer execute(final AttachIsoCommand command, final CitrixResourceBase citrixResourceBase) {
-        final Connection conn = citrixResourceBase.getConnection();
-        final boolean attach = command.isAttach();
-        final String vmName = command.getVmName();
-        final String isoURL = command.getIsoPath();
-
-        String errorMsg;
-        if (attach) {
-            errorMsg = "Failed to attach ISO";
-        } else {
-            errorMsg = "Failed to detach ISO";
-        }
-        try {
-            if (attach) {
-                VBD isoVBD = null;
-
-                // Find the VM
-                final VM vm = citrixResourceBase.getVM(conn, vmName);
-
-                // Find the ISO VDI
-                final VDI isoVDI = citrixResourceBase.getIsoVDIByURL(conn, vmName, isoURL);
-
-                // Find the VM's CD-ROM VBD
-                final Set<VBD> vbds = vm.getVBDs(conn);
-                for (final VBD vbd : vbds) {
-                    final String userDevice = vbd.getUserdevice(conn);
-                    final Types.VbdType type = vbd.getType(conn);
-
-                    if (userDevice.equals("3") && type == Types.VbdType.CD) {
-                        isoVBD = vbd;
-                        break;
-                    }
-                }
-
-                if (isoVBD == null) {
-                    throw new CloudRuntimeException("Unable to find CD-ROM VBD for VM: " + vmName);
-                } else {
-                    // If an ISO is already inserted, eject it
-                    if (isoVBD.getEmpty(conn) == false) {
-                        isoVBD.eject(conn);
-                    }
-
-                    // Insert the new ISO
-                    isoVBD.insert(conn, isoVDI);
-                }
-
-                return new Answer(command);
-            } else {
-                // Find the VM
-                final VM vm = citrixResourceBase.getVM(conn, vmName);
-                final String vmUUID = vm.getUuid(conn);
-
-                // Find the ISO VDI
-                final VDI isoVDI = citrixResourceBase.getIsoVDIByURL(conn, vmName, isoURL);
-
-                final SR sr = isoVDI.getSR(conn);
-
-                // Look up all VBDs for this VDI
-                final Set<VBD> vbds = isoVDI.getVBDs(conn);
-
-                // Iterate through VBDs, and if the VBD belongs the VM, eject
-                // the ISO from it
-                for (final VBD vbd : vbds) {
-                    final VM vbdVM = vbd.getVM(conn);
-                    final String vbdVmUUID = vbdVM.getUuid(conn);
-
-                    if (vbdVmUUID.equals(vmUUID)) {
-                        // If an ISO is already inserted, eject it
-                        if (!vbd.getEmpty(conn)) {
-                            vbd.eject(conn);
-                        }
-
-                        break;
-                    }
-                }
-
-                if (!sr.getNameLabel(conn).startsWith("XenServer Tools")) {
-                    citrixResourceBase.removeSR(conn, sr);
-                }
-
-                return new Answer(command);
-            }
-        } catch (final XenAPIException e) {
-            s_logger.warn(errorMsg + ": " + e.toString(), e);
-            return new Answer(command, false, e.toString());
-        } catch (final Exception e) {
-            s_logger.warn(errorMsg + ": " + e.toString(), e);
-            return new Answer(command, false, e.getMessage());
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixAttachVolumeCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixAttachVolumeCommandWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixAttachVolumeCommandWrapper.java
deleted file mode 100644
index 37d28b7..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixAttachVolumeCommandWrapper.java
+++ /dev/null
@@ -1,146 +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.hypervisor.xenserver.resource.wrapper;
-
-import java.util.Set;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.AttachVolumeAnswer;
-import com.cloud.agent.api.AttachVolumeCommand;
-import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
-import com.cloud.resource.CommandWrapper;
-import com.cloud.resource.ResourceWrapper;
-import com.xensource.xenapi.Connection;
-import com.xensource.xenapi.SR;
-import com.xensource.xenapi.Types;
-import com.xensource.xenapi.Types.XenAPIException;
-import com.xensource.xenapi.VBD;
-import com.xensource.xenapi.VDI;
-import com.xensource.xenapi.VM;
-
-@ResourceWrapper(handles =  AttachVolumeCommand.class)
-public final class CitrixAttachVolumeCommandWrapper extends CommandWrapper<AttachVolumeCommand, Answer, CitrixResourceBase> {
-
-    private static final Logger s_logger = Logger.getLogger(CitrixAttachVolumeCommandWrapper.class);
-
-    @Override
-    public Answer execute(final AttachVolumeCommand command, final CitrixResourceBase citrixResourceBase) {
-        final Connection conn = citrixResourceBase.getConnection();
-        final boolean attach = command.getAttach();
-        final String vmName = command.getVmName();
-        final String vdiNameLabel = vmName + "-DATA";
-        final Long deviceId = command.getDeviceId();
-
-        String errorMsg;
-        if (attach) {
-            errorMsg = "Failed to attach volume";
-        } else {
-            errorMsg = "Failed to detach volume";
-        }
-
-        try {
-            VDI vdi = null;
-
-            if (command.getAttach() && command.isManaged()) {
-                final SR sr = citrixResourceBase.getIscsiSR(conn, command.get_iScsiName(), command.getStorageHost(), command.get_iScsiName(), command.getChapInitiatorUsername(),
-                        command.getChapInitiatorPassword(), true);
-
-                vdi = citrixResourceBase.getVDIbyUuid(conn, command.getVolumePath(), false);
-
-                if (vdi == null) {
-                    vdi = citrixResourceBase.createVdi(sr, vdiNameLabel, command.getVolumeSize());
-                }
-            } else {
-                vdi = citrixResourceBase.getVDIbyUuid(conn, command.getVolumePath());
-            }
-
-            // Look up the VM
-            final VM vm = citrixResourceBase.getVM(conn, vmName);
-            if (attach) {
-                // Figure out the disk number to attach the VM to
-                String diskNumber = null;
-                if (deviceId != null) {
-                    if (deviceId.longValue() == 3) {
-                        final String msg = "Device 3 is reserved for CD-ROM, choose other device";
-                        return new AttachVolumeAnswer(command, msg);
-                    }
-                    if (citrixResourceBase.isDeviceUsed(conn, vm, deviceId)) {
-                        final String msg = "Device " + deviceId + " is used in VM " + vmName;
-                        return new AttachVolumeAnswer(command, msg);
-                    }
-                    diskNumber = deviceId.toString();
-                } else {
-                    diskNumber = citrixResourceBase.getUnusedDeviceNum(conn, vm);
-                }
-                // Create a new VBD
-                final VBD.Record vbdr = new VBD.Record();
-                vbdr.VM = vm;
-                vbdr.VDI = vdi;
-                vbdr.bootable = false;
-                vbdr.userdevice = diskNumber;
-                vbdr.mode = Types.VbdMode.RW;
-                vbdr.type = Types.VbdType.DISK;
-                vbdr.unpluggable = true;
-                final VBD vbd = VBD.create(conn, vbdr);
-
-                // Attach the VBD to the VM
-                vbd.plug(conn);
-
-                // Update the VDI's label to include the VM name
-                vdi.setNameLabel(conn, vdiNameLabel);
-
-                return new AttachVolumeAnswer(command, Long.parseLong(diskNumber), vdi.getUuid(conn));
-            } else {
-                // Look up all VBDs for this VDI
-                final Set<VBD> vbds = vdi.getVBDs(conn);
-
-                // Detach each VBD from its VM, and then destroy it
-                for (final VBD vbd : vbds) {
-                    final VBD.Record vbdr = vbd.getRecord(conn);
-
-                    if (vbdr.currentlyAttached) {
-                        vbd.unplug(conn);
-                    }
-
-                    vbd.destroy(conn);
-                }
-
-                // Update the VDI's label to be "detached"
-                vdi.setNameLabel(conn, "detached");
-
-                if (command.isManaged()) {
-                    citrixResourceBase.handleSrAndVdiDetach(command.get_iScsiName(), conn);
-                }
-
-                return new AttachVolumeAnswer(command);
-            }
-        } catch (final XenAPIException e) {
-            final String msg = errorMsg + " for uuid: " + command.getVolumePath() + "  due to " + e.toString();
-            s_logger.warn(msg, e);
-            return new AttachVolumeAnswer(command, msg);
-        } catch (final Exception e) {
-            final String msg = errorMsg + " for uuid: " + command.getVolumePath() + "  due to " + e.getMessage();
-            s_logger.warn(msg, e);
-            return new AttachVolumeAnswer(command, msg);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckConsoleProxyLoadCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckConsoleProxyLoadCommandWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckConsoleProxyLoadCommandWrapper.java
deleted file mode 100644
index 83f5a80..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckConsoleProxyLoadCommandWrapper.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 com.cloud.hypervisor.xenserver.resource.wrapper;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.Command;
-import com.cloud.agent.api.proxy.CheckConsoleProxyLoadCommand;
-import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
-import com.cloud.resource.ResourceWrapper;
-import com.cloud.resource.ServerResource;
-
-@ResourceWrapper(handles =  CheckConsoleProxyLoadCommand.class)
-public final class CitrixCheckConsoleProxyLoadCommandWrapper extends CitrixConsoleProxyLoadCommandWrapper<CheckConsoleProxyLoadCommand, Answer, CitrixResourceBase> {
-
-    @Override
-    public Answer execute(final Command command, final ServerResource serverResource) {
-        final CheckConsoleProxyLoadCommand cmd = (CheckConsoleProxyLoadCommand) command;
-
-        final long proxyVmId = cmd.getProxyVmId();
-        final String proxyVmName = cmd.getProxyVmName();
-        final String proxyManagementIp = cmd.getProxyManagementIp();
-        final int cmdPort = cmd.getProxyCmdPort();
-
-        return executeProxyLoadScan(command, proxyVmId, proxyVmName, proxyManagementIp, cmdPort);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckHealthCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckHealthCommandWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckHealthCommandWrapper.java
deleted file mode 100644
index 4e36ab7..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckHealthCommandWrapper.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 com.cloud.hypervisor.xenserver.resource.wrapper;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.CheckHealthAnswer;
-import com.cloud.agent.api.CheckHealthCommand;
-import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
-import com.cloud.resource.CommandWrapper;
-import com.cloud.resource.ResourceWrapper;
-
-@ResourceWrapper(handles =  CheckHealthCommand.class)
-public final class CitrixCheckHealthCommandWrapper extends CommandWrapper<CheckHealthCommand, Answer, CitrixResourceBase> {
-
-    @Override
-    public Answer execute(final CheckHealthCommand command, final CitrixResourceBase citrixResourceBase) {
-        final boolean result = citrixResourceBase.pingXAPI();
-        return new CheckHealthAnswer(command, result);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckNetworkCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckNetworkCommandWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckNetworkCommandWrapper.java
deleted file mode 100644
index ca55ab6..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckNetworkCommandWrapper.java
+++ /dev/null
@@ -1,96 +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.hypervisor.xenserver.resource.wrapper;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.CheckNetworkAnswer;
-import com.cloud.agent.api.CheckNetworkCommand;
-import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
-import com.cloud.network.PhysicalNetworkSetupInfo;
-import com.cloud.resource.CommandWrapper;
-import com.cloud.resource.ResourceWrapper;
-import com.xensource.xenapi.Types.XenAPIException;
-
-@ResourceWrapper(handles =  CheckNetworkCommand.class)
-public final class CitrixCheckNetworkCommandWrapper extends CommandWrapper<CheckNetworkCommand, Answer, CitrixResourceBase> {
-
-    private static final Logger s_logger = Logger.getLogger(CitrixCheckNetworkCommandWrapper.class);
-
-    @Override
-    public Answer execute(final CheckNetworkCommand command, final CitrixResourceBase citrixResourceBase) {
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Checking if network name setup is done on the resource");
-        }
-
-        final List<PhysicalNetworkSetupInfo> infoList = command.getPhysicalNetworkInfoList();
-
-        try {
-            boolean errorout = false;
-            String msg = "";
-            for (final PhysicalNetworkSetupInfo info : infoList) {
-                if (!citrixResourceBase.isNetworkSetupByName(info.getGuestNetworkName())) {
-                    msg =
-                            "For Physical Network id:" + info.getPhysicalNetworkId() + ", Guest Network is not configured on the backend by name " +
-                                    info.getGuestNetworkName();
-                    errorout = true;
-                    break;
-                }
-                if (!citrixResourceBase.isNetworkSetupByName(info.getPrivateNetworkName())) {
-                    msg =
-                            "For Physical Network id:" + info.getPhysicalNetworkId() + ", Private Network is not configured on the backend by name " +
-                                    info.getPrivateNetworkName();
-                    errorout = true;
-                    break;
-                }
-                if (!citrixResourceBase.isNetworkSetupByName(info.getPublicNetworkName())) {
-                    msg =
-                            "For Physical Network id:" + info.getPhysicalNetworkId() + ", Public Network is not configured on the backend by name " +
-                                    info.getPublicNetworkName();
-                    errorout = true;
-                    break;
-                }
-                /*if(!isNetworkSetupByName(info.getStorageNetworkName())){
-                    msg = "For Physical Network id:"+ info.getPhysicalNetworkId() + ", Storage Network is not configured on the backend by name " + info.getStorageNetworkName();
-                    errorout = true;
-                    break;
-                }*/
-            }
-            if (errorout) {
-                s_logger.error(msg);
-                return new CheckNetworkAnswer(command, false, msg);
-            } else {
-                return new CheckNetworkAnswer(command, true, "Network Setup check by names is done");
-            }
-
-        } catch (final XenAPIException e) {
-            final String msg = "CheckNetworkCommand failed with XenAPIException:" + e.toString() + " host:" + citrixResourceBase.getHost().getUuid();
-            s_logger.warn(msg, e);
-            return new CheckNetworkAnswer(command, false, msg);
-        } catch (final Exception e) {
-            final String msg = "CheckNetworkCommand failed with Exception:" + e.getMessage() + " host:" + citrixResourceBase.getHost().getUuid();
-            s_logger.warn(msg, e);
-            return new CheckNetworkAnswer(command, false, msg);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckOnHostCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckOnHostCommandWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckOnHostCommandWrapper.java
deleted file mode 100644
index ffe1195..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckOnHostCommandWrapper.java
+++ /dev/null
@@ -1,36 +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.hypervisor.xenserver.resource.wrapper;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.CheckOnHostAnswer;
-import com.cloud.agent.api.CheckOnHostCommand;
-import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
-import com.cloud.resource.CommandWrapper;
-import com.cloud.resource.ResourceWrapper;
-
-@ResourceWrapper(handles =  CheckOnHostCommand.class)
-public final class CitrixCheckOnHostCommandWrapper extends CommandWrapper<CheckOnHostCommand, Answer, CitrixResourceBase> {
-
-    @Override
-    public Answer execute(final CheckOnHostCommand command, final CitrixResourceBase citrixResourceBase) {
-        return new CheckOnHostAnswer(command, "Not Implmeneted");
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckSshCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckSshCommandWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckSshCommandWrapper.java
deleted file mode 100644
index 64a4a3f..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckSshCommandWrapper.java
+++ /dev/null
@@ -1,65 +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.hypervisor.xenserver.resource.wrapper;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.check.CheckSshAnswer;
-import com.cloud.agent.api.check.CheckSshCommand;
-import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
-import com.cloud.resource.CommandWrapper;
-import com.cloud.resource.ResourceWrapper;
-import com.xensource.xenapi.Connection;
-
-@ResourceWrapper(handles =  CheckSshCommand.class)
-public final class CitrixCheckSshCommandWrapper extends CommandWrapper<CheckSshCommand, Answer, CitrixResourceBase> {
-
-    private static final Logger s_logger = Logger.getLogger(CitrixCheckSshCommandWrapper.class);
-
-    @Override
-    public Answer execute(final CheckSshCommand command, final CitrixResourceBase citrixResourceBase) {
-        final Connection conn = citrixResourceBase.getConnection();
-        final String vmName = command.getName();
-        final String privateIp = command.getIp();
-        final int cmdPort = command.getPort();
-
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Ping command port, " + privateIp + ":" + cmdPort);
-        }
-
-        try {
-            final String result = citrixResourceBase.connect(conn, command.getName(), privateIp, cmdPort);
-            if (result != null) {
-                return new CheckSshAnswer(command, "Can not ping System vm " + vmName + "due to:" + result);
-            }
-            //Do not destroy the disk here! It will stio the patching process. Please, don't!
-            //destroyPatchVbd(conn, vmName);
-        } catch (final Exception e) {
-            return new CheckSshAnswer(command, e);
-        }
-
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Ping command port succeeded for vm " + vmName);
-        }
-
-        return new CheckSshAnswer(command);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckVirtualMachineCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckVirtualMachineCommandWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckVirtualMachineCommandWrapper.java
deleted file mode 100644
index a1954f4..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCheckVirtualMachineCommandWrapper.java
+++ /dev/null
@@ -1,50 +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.hypervisor.xenserver.resource.wrapper;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.CheckVirtualMachineAnswer;
-import com.cloud.agent.api.CheckVirtualMachineCommand;
-import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
-import com.cloud.resource.CommandWrapper;
-import com.cloud.resource.ResourceWrapper;
-import com.cloud.vm.VirtualMachine.PowerState;
-import com.xensource.xenapi.Connection;
-
-@ResourceWrapper(handles =  CheckVirtualMachineCommand.class)
-public final class CitrixCheckVirtualMachineCommandWrapper extends CommandWrapper<CheckVirtualMachineCommand, Answer, CitrixResourceBase> {
-
-    private static final Logger s_logger = Logger.getLogger(CitrixCheckVirtualMachineCommandWrapper.class);
-
-    @Override
-    public Answer execute(final CheckVirtualMachineCommand command, final CitrixResourceBase citrixResourceBase) {
-        final Connection conn = citrixResourceBase.getConnection();
-        final String vmName = command.getVmName();
-        final PowerState powerState = citrixResourceBase.getVmState(conn, vmName);
-        final Integer vncPort = null;
-        if (powerState == PowerState.PowerOn) {
-            s_logger.debug("3. The VM " + vmName + " is in Running state");
-        }
-
-        return new CheckVirtualMachineAnswer(command, powerState, vncPort);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCleanupNetworkRulesCmdWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCleanupNetworkRulesCmdWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCleanupNetworkRulesCmdWrapper.java
deleted file mode 100644
index 4b2d5d3..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCleanupNetworkRulesCmdWrapper.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 com.cloud.hypervisor.xenserver.resource.wrapper;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.CleanupNetworkRulesCmd;
-import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
-import com.cloud.resource.CommandWrapper;
-import com.cloud.resource.ResourceWrapper;
-import com.xensource.xenapi.Connection;
-
-@ResourceWrapper(handles =  CleanupNetworkRulesCmd.class)
-public final class CitrixCleanupNetworkRulesCmdWrapper extends CommandWrapper<CleanupNetworkRulesCmd, Answer, CitrixResourceBase> {
-
-    private static final Logger s_logger = Logger.getLogger(CitrixCleanupNetworkRulesCmdWrapper.class);
-
-    @Override
-    public Answer execute(final CleanupNetworkRulesCmd command, final CitrixResourceBase citrixResourceBase) {
-        if (!citrixResourceBase.canBridgeFirewall()) {
-            return new Answer(command, true, null);
-        }
-        final Connection conn = citrixResourceBase.getConnection();
-
-        final String result = citrixResourceBase.callHostPlugin(conn, "vmops", "cleanup_rules", "instance", citrixResourceBase.getVMInstanceName());
-        final int numCleaned = Integer.parseInt(result);
-
-        if (result == null || result.isEmpty() || numCleaned < 0) {
-            s_logger.warn("Failed to cleanup rules for host " + citrixResourceBase.getHost().getIp());
-            return new Answer(command, false, result);
-        }
-
-        if (numCleaned > 0) {
-            s_logger.info("Cleaned up rules for " + result + " vms on host " + citrixResourceBase.getHost().getIp());
-        }
-        return new Answer(command, true, result);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixClusterVMMetaDataSyncCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixClusterVMMetaDataSyncCommandWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixClusterVMMetaDataSyncCommandWrapper.java
deleted file mode 100644
index 84bbf98..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixClusterVMMetaDataSyncCommandWrapper.java
+++ /dev/null
@@ -1,59 +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.hypervisor.xenserver.resource.wrapper;
-
-import java.util.HashMap;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.ClusterVMMetaDataSyncAnswer;
-import com.cloud.agent.api.ClusterVMMetaDataSyncCommand;
-import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
-import com.cloud.resource.CommandWrapper;
-import com.cloud.resource.ResourceWrapper;
-import com.xensource.xenapi.Connection;
-import com.xensource.xenapi.Host;
-import com.xensource.xenapi.Pool;
-
-@ResourceWrapper(handles =  ClusterVMMetaDataSyncCommand.class)
-public final class CitrixClusterVMMetaDataSyncCommandWrapper extends CommandWrapper<ClusterVMMetaDataSyncCommand, Answer, CitrixResourceBase> {
-
-    private static final Logger s_logger = Logger.getLogger(CitrixClusterVMMetaDataSyncCommandWrapper.class);
-
-    @Override
-    public Answer execute(final ClusterVMMetaDataSyncCommand command, final CitrixResourceBase citrixResourceBase) {
-        final Connection conn = citrixResourceBase.getConnection();
-        //check if this is master
-        try {
-            final Pool pool = Pool.getByUuid(conn, citrixResourceBase.getHost().getPool());
-            final Pool.Record poolr = pool.getRecord(conn);
-            final Host.Record hostr = poolr.master.getRecord(conn);
-            if (!citrixResourceBase.getHost().getUuid().equals(hostr.uuid)) {
-                return new ClusterVMMetaDataSyncAnswer(command.getClusterId(), null);
-            }
-        } catch (final Throwable e) {
-            s_logger.warn("Check for master failed, failing the Cluster sync VMMetaData command");
-            return new ClusterVMMetaDataSyncAnswer(command.getClusterId(), null);
-        }
-        final HashMap<String, String> vmMetadatum = citrixResourceBase.clusterVMMetaDataSync(conn);
-        return new ClusterVMMetaDataSyncAnswer(command.getClusterId(), vmMetadatum);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixConsoleProxyLoadCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixConsoleProxyLoadCommandWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixConsoleProxyLoadCommandWrapper.java
deleted file mode 100644
index 4e71b0e..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixConsoleProxyLoadCommandWrapper.java
+++ /dev/null
@@ -1,83 +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.hypervisor.xenserver.resource.wrapper;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.net.URLConnection;
-import java.nio.charset.Charset;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.Command;
-import com.cloud.agent.api.proxy.ConsoleProxyLoadAnswer;
-import com.cloud.resource.CommandWrapper;
-import com.cloud.resource.ServerResource;
-
-public abstract class CitrixConsoleProxyLoadCommandWrapper<T extends Command, A extends Answer, R extends ServerResource> extends CommandWrapper<Command, Answer, ServerResource> {
-
-    private static final Logger s_logger = Logger.getLogger(CitrixConsoleProxyLoadCommandWrapper.class);
-
-    protected Answer executeProxyLoadScan(final Command cmd, final long proxyVmId, final String proxyVmName, final String proxyManagementIp, final int cmdPort) {
-        String result = null;
-
-        final StringBuffer sb = new StringBuffer();
-        sb.append("http://").append(proxyManagementIp).append(":" + cmdPort).append("/cmd/getstatus");
-
-        boolean success = true;
-        try {
-            final URL url = new URL(sb.toString());
-            final URLConnection conn = url.openConnection();
-
-            // setting TIMEOUTs to avoid possible waiting until death situations
-            conn.setConnectTimeout(5000);
-            conn.setReadTimeout(5000);
-
-            final InputStream is = conn.getInputStream();
-            final BufferedReader reader = new BufferedReader(new InputStreamReader(is, Charset.defaultCharset()));
-            final StringBuilder sb2 = new StringBuilder();
-            String line = null;
-            try {
-                while ((line = reader.readLine()) != null) {
-                    sb2.append(line + "\n");
-                }
-                result = sb2.toString();
-            } catch (final IOException e) {
-                success = false;
-            } finally {
-                try {
-                    is.close();
-                } catch (final IOException e) {
-                    s_logger.warn("Exception when closing , console proxy address : " + proxyManagementIp);
-                    success = false;
-                }
-            }
-        } catch (final IOException e) {
-            s_logger.warn("Unable to open console proxy command port url, console proxy address : " + proxyManagementIp);
-            success = false;
-        }
-
-        return new ConsoleProxyLoadAnswer(cmd, proxyVmId, proxyVmName, success, result);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCreateCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCreateCommandWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCreateCommandWrapper.java
deleted file mode 100644
index c658fd9..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCreateCommandWrapper.java
+++ /dev/null
@@ -1,84 +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.hypervisor.xenserver.resource.wrapper;
-
-import java.util.HashMap;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.storage.CreateAnswer;
-import com.cloud.agent.api.storage.CreateCommand;
-import com.cloud.agent.api.to.StorageFilerTO;
-import com.cloud.agent.api.to.VolumeTO;
-import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
-import com.cloud.resource.CommandWrapper;
-import com.cloud.resource.ResourceWrapper;
-import com.cloud.vm.DiskProfile;
-import com.xensource.xenapi.Connection;
-import com.xensource.xenapi.SR;
-import com.xensource.xenapi.Types;
-import com.xensource.xenapi.VDI;
-
-@ResourceWrapper(handles =  CreateCommand.class)
-public final class CitrixCreateCommandWrapper extends CommandWrapper<CreateCommand, Answer, CitrixResourceBase> {
-
-    private static final Logger s_logger = Logger.getLogger(CitrixCreateCommandWrapper.class);
-
-    @Override
-    public Answer execute(final CreateCommand command, final CitrixResourceBase citrixResourceBase) {
-        final Connection conn = citrixResourceBase.getConnection();
-        final StorageFilerTO pool = command.getPool();
-        final DiskProfile dskch = command.getDiskCharacteristics();
-
-        VDI vdi = null;
-        try {
-            final SR poolSr = citrixResourceBase.getStorageRepository(conn, pool.getUuid());
-            if (command.getTemplateUrl() != null) {
-                VDI tmpltvdi = null;
-
-                tmpltvdi = citrixResourceBase.getVDIbyUuid(conn, command.getTemplateUrl());
-                vdi = tmpltvdi.createClone(conn, new HashMap<String, String>());
-                vdi.setNameLabel(conn, dskch.getName());
-            } else {
-                final VDI.Record vdir = new VDI.Record();
-                vdir.nameLabel = dskch.getName();
-                vdir.SR = poolSr;
-                vdir.type = Types.VdiType.USER;
-
-                vdir.virtualSize = dskch.getSize();
-                vdi = VDI.create(conn, vdir);
-            }
-
-            VDI.Record vdir;
-            vdir = vdi.getRecord(conn);
-
-            s_logger.debug("Succesfully created VDI for " + command + ".  Uuid = " + vdir.uuid);
-
-            final VolumeTO vol =
-                    new VolumeTO(command.getVolumeId(), dskch.getType(), pool.getType(), pool.getUuid(), vdir.nameLabel, pool.getPath(), vdir.uuid, vdir.virtualSize, null);
-
-            return new CreateAnswer(command, vol);
-        } catch (final Exception e) {
-            s_logger.warn("Unable to create volume; Pool=" + pool + "; Disk: " + dskch, e);
-            return new CreateAnswer(command, e);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCreateStoragePoolCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCreateStoragePoolCommandWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCreateStoragePoolCommandWrapper.java
deleted file mode 100644
index 3098597..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCreateStoragePoolCommandWrapper.java
+++ /dev/null
@@ -1,59 +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.hypervisor.xenserver.resource.wrapper;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.CreateStoragePoolCommand;
-import com.cloud.agent.api.to.StorageFilerTO;
-import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
-import com.cloud.resource.CommandWrapper;
-import com.cloud.resource.ResourceWrapper;
-import com.cloud.storage.Storage.StoragePoolType;
-import com.xensource.xenapi.Connection;
-
-@ResourceWrapper(handles =  CreateStoragePoolCommand.class)
-public final class CitrixCreateStoragePoolCommandWrapper extends CommandWrapper<CreateStoragePoolCommand, Answer, CitrixResourceBase> {
-
-    private static final Logger s_logger = Logger.getLogger(CitrixCreateStoragePoolCommandWrapper.class);
-
-    @Override
-    public Answer execute(final CreateStoragePoolCommand command, final CitrixResourceBase citrixResourceBase) {
-        final Connection conn = citrixResourceBase.getConnection();
-        final StorageFilerTO pool = command.getPool();
-        try {
-            if (pool.getType() == StoragePoolType.NetworkFilesystem) {
-                citrixResourceBase.getNfsSR(conn, Long.toString(pool.getId()), pool.getUuid(), pool.getHost(), pool.getPath(), pool.toString());
-            } else if (pool.getType() == StoragePoolType.IscsiLUN) {
-                citrixResourceBase.getIscsiSR(conn, pool.getUuid(), pool.getHost(), pool.getPath(), null, null, false);
-            } else if (pool.getType() == StoragePoolType.PreSetup) {
-            } else {
-                return new Answer(command, false, "The pool type: " + pool.getType().name() + " is not supported.");
-            }
-            return new Answer(command, true, "success");
-        } catch (final Exception e) {
-            final String msg = "Catch Exception " + e.getClass().getName() + ", create StoragePool failed due to " + e.toString() + " on host:"
-                    + citrixResourceBase.getHost().getUuid() + " pool: " + pool.getHost() + pool.getPath();
-            s_logger.warn(msg, e);
-            return new Answer(command, false, msg);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCreateVMSnapshotCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCreateVMSnapshotCommandWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCreateVMSnapshotCommandWrapper.java
deleted file mode 100644
index 4b8d616..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixCreateVMSnapshotCommandWrapper.java
+++ /dev/null
@@ -1,190 +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.hypervisor.xenserver.resource.wrapper;
-
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.cloudstack.storage.to.VolumeObjectTO;
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.CreateVMSnapshotAnswer;
-import com.cloud.agent.api.CreateVMSnapshotCommand;
-import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
-import com.cloud.resource.CommandWrapper;
-import com.cloud.resource.ResourceWrapper;
-import com.cloud.vm.snapshot.VMSnapshot;
-import com.xensource.xenapi.Connection;
-import com.xensource.xenapi.Pool;
-import com.xensource.xenapi.SR;
-import com.xensource.xenapi.Task;
-import com.xensource.xenapi.Types;
-import com.xensource.xenapi.Types.VmPowerState;
-import com.xensource.xenapi.VBD;
-import com.xensource.xenapi.VDI;
-import com.xensource.xenapi.VM;
-
-@ResourceWrapper(handles =  CreateVMSnapshotCommand.class)
-public final class CitrixCreateVMSnapshotCommandWrapper extends CommandWrapper<CreateVMSnapshotCommand, Answer, CitrixResourceBase> {
-
-    private static final Logger s_logger = Logger.getLogger(CitrixCreateVMSnapshotCommandWrapper.class);
-
-    @Override
-    public Answer execute(final CreateVMSnapshotCommand command, final CitrixResourceBase citrixResourceBase) {
-        final String vmName = command.getVmName();
-        final String vmSnapshotName = command.getTarget().getSnapshotName();
-        final List<VolumeObjectTO> listVolumeTo = command.getVolumeTOs();
-
-        VmPowerState vmState = VmPowerState.HALTED;
-
-        final String guestOSType = command.getGuestOSType();
-        final String platformEmulator = command.getPlatformEmulator();
-
-        final boolean snapshotMemory = command.getTarget().getType() == VMSnapshot.Type.DiskAndMemory;
-        final long timeout = command.getWait();
-
-        final Connection conn = citrixResourceBase.getConnection();
-        VM vm = null;
-        VM vmSnapshot = null;
-        boolean success = false;
-
-        try {
-            // check if VM snapshot already exists
-            final Set<VM> vmSnapshots = VM.getByNameLabel(conn, command.getTarget().getSnapshotName());
-            if (vmSnapshots == null || vmSnapshots.size() > 0) {
-                return new CreateVMSnapshotAnswer(command, command.getTarget(), command.getVolumeTOs());
-            }
-
-            // check if there is already a task for this VM snapshot
-            Task task = null;
-            Set<Task> tasks = Task.getByNameLabel(conn, "Async.VM.snapshot");
-            if(tasks == null) {
-                tasks = new LinkedHashSet<>();
-            }
-            final Set<Task> tasksByName = Task.getByNameLabel(conn, "Async.VM.checkpoint");
-            if(tasksByName != null) {
-                tasks.addAll(tasksByName);
-            }
-            for (final Task taskItem : tasks) {
-                if (taskItem.getOtherConfig(conn).containsKey("CS_VM_SNAPSHOT_KEY")) {
-                    final String vmSnapshotTaskName = taskItem.getOtherConfig(conn).get("CS_VM_SNAPSHOT_KEY");
-                    if (vmSnapshotTaskName != null && vmSnapshotTaskName.equals(command.getTarget().getSnapshotName())) {
-                        task = taskItem;
-                    }
-                }
-            }
-
-            // create a new task if there is no existing task for this VM snapshot
-            if (task == null) {
-                try {
-                    vm = citrixResourceBase.getVM(conn, vmName);
-                    vmState = vm.getPowerState(conn);
-                } catch (final Exception e) {
-                    if (!snapshotMemory) {
-                        vm = citrixResourceBase.createWorkingVM(conn, vmName, guestOSType, platformEmulator, listVolumeTo);
-                    }
-                }
-
-                if (vm == null) {
-                    return new CreateVMSnapshotAnswer(command, false, "Creating VM Snapshot Failed due to can not find vm: " + vmName);
-                }
-
-                // call Xenserver API
-                if (!snapshotMemory) {
-                    task = vm.snapshotAsync(conn, vmSnapshotName);
-                } else {
-                    final Set<VBD> vbds = vm.getVBDs(conn);
-                    final Pool pool = Pool.getByUuid(conn, citrixResourceBase.getHost().getPool());
-                    for (final VBD vbd : vbds) {
-                        final VBD.Record vbdr = vbd.getRecord(conn);
-                        if (vbdr.userdevice.equals("0")) {
-                            final VDI vdi = vbdr.VDI;
-                            final SR sr = vdi.getSR(conn);
-                            // store memory image on the same SR with ROOT volume
-                            pool.setSuspendImageSR(conn, sr);
-                        }
-                    }
-                    task = vm.checkpointAsync(conn, vmSnapshotName);
-                }
-                task.addToOtherConfig(conn, "CS_VM_SNAPSHOT_KEY", vmSnapshotName);
-            }
-
-            citrixResourceBase.waitForTask(conn, task, 1000, timeout * 1000);
-            citrixResourceBase.checkForSuccess(conn, task);
-            final String result = task.getResult(conn);
-
-            // extract VM snapshot ref from result
-            final String ref = result.substring("<value>".length(), result.length() - "</value>".length());
-            vmSnapshot = Types.toVM(ref);
-            try {
-                Thread.sleep(5000);
-            } catch (final InterruptedException ex) {
-
-            }
-            // calculate used capacity for this VM snapshot
-            for (final VolumeObjectTO volumeTo : command.getVolumeTOs()) {
-                final long size = citrixResourceBase.getVMSnapshotChainSize(conn, volumeTo, command.getVmName());
-                volumeTo.setSize(size);
-            }
-
-            success = true;
-            return new CreateVMSnapshotAnswer(command, command.getTarget(), command.getVolumeTOs());
-        } catch (final Exception e) {
-            String msg = "";
-            if (e instanceof Types.BadAsyncResult) {
-                final String licenseKeyWord = "LICENCE_RESTRICTION";
-                final Types.BadAsyncResult errorResult = (Types.BadAsyncResult)e;
-                if (errorResult.shortDescription != null && errorResult.shortDescription.contains(licenseKeyWord)) {
-                    msg = licenseKeyWord;
-                }
-            } else {
-                msg = e.toString();
-            }
-            s_logger.warn("Creating VM Snapshot " + command.getTarget().getSnapshotName() + " failed due to: " + msg, e);
-            return new CreateVMSnapshotAnswer(command, false, msg);
-        } finally {
-            try {
-                if (!success) {
-                    if (vmSnapshot != null) {
-                        s_logger.debug("Delete exsisting VM Snapshot " + vmSnapshotName + " after making VolumeTO failed");
-                        final Set<VBD> vbds = vmSnapshot.getVBDs(conn);
-                        for (final VBD vbd : vbds) {
-                            final VBD.Record vbdr = vbd.getRecord(conn);
-                            if (vbdr.type == Types.VbdType.DISK) {
-                                final VDI vdi = vbdr.VDI;
-                                vdi.destroy(conn);
-                            }
-                        }
-                        vmSnapshot.destroy(conn);
-                    }
-                }
-                if (vmState == VmPowerState.HALTED) {
-                    if (vm != null) {
-                        vm.destroy(conn);
-                    }
-                }
-            } catch (final Exception e2) {
-                s_logger.error("delete snapshot error due to " + e2.getMessage());
-            }
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixDeleteStoragePoolCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixDeleteStoragePoolCommandWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixDeleteStoragePoolCommandWrapper.java
deleted file mode 100644
index 6d2054b..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixDeleteStoragePoolCommandWrapper.java
+++ /dev/null
@@ -1,54 +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.hypervisor.xenserver.resource.wrapper;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.DeleteStoragePoolCommand;
-import com.cloud.agent.api.to.StorageFilerTO;
-import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
-import com.cloud.resource.CommandWrapper;
-import com.cloud.resource.ResourceWrapper;
-import com.xensource.xenapi.Connection;
-import com.xensource.xenapi.SR;
-
-@ResourceWrapper(handles =  DeleteStoragePoolCommand.class)
-public final class CitrixDeleteStoragePoolCommandWrapper extends CommandWrapper<DeleteStoragePoolCommand, Answer, CitrixResourceBase> {
-
-    private static final Logger s_logger = Logger.getLogger(CitrixDeleteStoragePoolCommandWrapper.class);
-
-    @Override
-    public Answer execute(final DeleteStoragePoolCommand command, final CitrixResourceBase citrixResourceBase) {
-        final Connection conn = citrixResourceBase.getConnection();
-        final StorageFilerTO poolTO = command.getPool();
-        try {
-            final SR sr = citrixResourceBase.getStorageRepository(conn, poolTO.getUuid());
-            citrixResourceBase.removeSR(conn, sr);
-            final Answer answer = new Answer(command, true, "success");
-            return answer;
-        } catch (final Exception e) {
-            final String msg = "DeleteStoragePoolCommand XenAPIException:" + e.getMessage() + " host:" + citrixResourceBase.getHost().getUuid() + " pool: " + poolTO.getHost()
-                    + poolTO.getPath();
-            s_logger.warn(msg, e);
-            return new Answer(command, false, msg);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixDeleteVMSnapshotCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixDeleteVMSnapshotCommandWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixDeleteVMSnapshotCommandWrapper.java
deleted file mode 100644
index 4f9d57a..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixDeleteVMSnapshotCommandWrapper.java
+++ /dev/null
@@ -1,92 +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.hypervisor.xenserver.resource.wrapper;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.cloudstack.storage.to.VolumeObjectTO;
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.DeleteVMSnapshotAnswer;
-import com.cloud.agent.api.DeleteVMSnapshotCommand;
-import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
-import com.cloud.resource.CommandWrapper;
-import com.cloud.resource.ResourceWrapper;
-import com.cloud.vm.snapshot.VMSnapshot;
-import com.xensource.xenapi.Connection;
-import com.xensource.xenapi.Types;
-import com.xensource.xenapi.VBD;
-import com.xensource.xenapi.VDI;
-import com.xensource.xenapi.VM;
-
-@ResourceWrapper(handles =  DeleteVMSnapshotCommand.class)
-public final class CitrixDeleteVMSnapshotCommandWrapper extends CommandWrapper<DeleteVMSnapshotCommand, Answer, CitrixResourceBase> {
-
-    private static final Logger s_logger = Logger.getLogger(CitrixDeleteVMSnapshotCommandWrapper.class);
-
-    @Override
-    public Answer execute(final DeleteVMSnapshotCommand command, final CitrixResourceBase citrixResourceBase) {
-        final String snapshotName = command.getTarget().getSnapshotName();
-        final Connection conn = citrixResourceBase.getConnection();
-
-        try {
-            final List<VDI> vdiList = new ArrayList<VDI>();
-            final Set<VM> snapshots = VM.getByNameLabel(conn, snapshotName);
-            if (snapshots == null || snapshots.size() == 0) {
-                s_logger.warn("VM snapshot with name " + snapshotName + " does not exist, assume it is already deleted");
-                return new DeleteVMSnapshotAnswer(command, command.getVolumeTOs());
-            }
-            final VM snapshot = snapshots.iterator().next();
-            final Set<VBD> vbds = snapshot.getVBDs(conn);
-            for (final VBD vbd : vbds) {
-                if (vbd.getType(conn) == Types.VbdType.DISK) {
-                    final VDI vdi = vbd.getVDI(conn);
-                    vdiList.add(vdi);
-                }
-            }
-            if (command.getTarget().getType() == VMSnapshot.Type.DiskAndMemory) {
-                vdiList.add(snapshot.getSuspendVDI(conn));
-            }
-            snapshot.destroy(conn);
-            for (final VDI vdi : vdiList) {
-                vdi.destroy(conn);
-            }
-
-            try {
-                Thread.sleep(5000);
-            } catch (final InterruptedException ex) {
-
-            }
-            // re-calculate used capacify for this VM snapshot
-            for (final VolumeObjectTO volumeTo : command.getVolumeTOs()) {
-                final long size = citrixResourceBase.getVMSnapshotChainSize(conn, volumeTo, command.getVmName());
-                volumeTo.setSize(size);
-            }
-
-            return new DeleteVMSnapshotAnswer(command, command.getVolumeTOs());
-        } catch (final Exception e) {
-            s_logger.warn("Catch Exception: " + e.getClass().toString() + " due to " + e.toString(), e);
-            return new DeleteVMSnapshotAnswer(command, false, e.getMessage());
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixDestroyCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixDestroyCommandWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixDestroyCommandWrapper.java
deleted file mode 100644
index 15f9f1c..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixDestroyCommandWrapper.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.hypervisor.xenserver.resource.wrapper;
-
-import java.util.Set;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.storage.DestroyCommand;
-import com.cloud.agent.api.to.VolumeTO;
-import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
-import com.cloud.resource.CommandWrapper;
-import com.cloud.resource.ResourceWrapper;
-import com.xensource.xenapi.Connection;
-import com.xensource.xenapi.VBD;
-import com.xensource.xenapi.VDI;
-
-@ResourceWrapper(handles =  DestroyCommand.class)
-public final class CitrixDestroyCommandWrapper extends CommandWrapper<DestroyCommand, Answer, CitrixResourceBase> {
-
-    private static final Logger s_logger = Logger.getLogger(CitrixDestroyCommandWrapper.class);
-
-    @Override
-    public Answer execute(final DestroyCommand command, final CitrixResourceBase citrixResourceBase) {
-        final Connection conn = citrixResourceBase.getConnection();
-        final VolumeTO vol = command.getVolume();
-        // Look up the VDI
-        final String volumeUUID = vol.getPath();
-        VDI vdi = null;
-        try {
-            vdi = citrixResourceBase.getVDIbyUuid(conn, volumeUUID);
-        } catch (final Exception e) {
-            return new Answer(command, true, "Success");
-        }
-        Set<VBD> vbds = null;
-        try {
-            vbds = vdi.getVBDs(conn);
-        } catch (final Exception e) {
-            final String msg = "VDI getVBDS for " + volumeUUID + " failed due to " + e.toString();
-            s_logger.warn(msg, e);
-            return new Answer(command, false, msg);
-        }
-        for (final VBD vbd : vbds) {
-            try {
-                vbd.unplug(conn);
-                vbd.destroy(conn);
-            } catch (final Exception e) {
-                final String msg = "VM destroy for " + volumeUUID + "  failed due to " + e.toString();
-                s_logger.warn(msg, e);
-                return new Answer(command, false, msg);
-            }
-        }
-        try {
-            final Set<VDI> snapshots = vdi.getSnapshots(conn);
-            for (final VDI snapshot : snapshots) {
-                snapshot.destroy(conn);
-            }
-            vdi.destroy(conn);
-        } catch (final Exception e) {
-            final String msg = "VDI destroy for " + volumeUUID + " failed due to " + e.toString();
-            s_logger.warn(msg, e);
-            return new Answer(command, false, msg);
-        }
-
-        return new Answer(command, true, "Success");
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79d24ae2/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixGetHostStatsCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixGetHostStatsCommandWrapper.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixGetHostStatsCommandWrapper.java
deleted file mode 100644
index 02c3770..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/CitrixGetHostStatsCommandWrapper.java
+++ /dev/null
@@ -1,50 +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.hypervisor.xenserver.resource.wrapper;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.GetHostStatsAnswer;
-import com.cloud.agent.api.GetHostStatsCommand;
-import com.cloud.agent.api.HostStatsEntry;
-import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
-import com.cloud.resource.CommandWrapper;
-import com.cloud.resource.ResourceWrapper;
-import com.xensource.xenapi.Connection;
-
-@ResourceWrapper(handles =  GetHostStatsCommand.class)
-public final class CitrixGetHostStatsCommandWrapper extends CommandWrapper<GetHostStatsCommand, Answer, CitrixResourceBase> {
-
-    private static final Logger s_logger = Logger.getLogger(CitrixGetHostStatsCommandWrapper.class);
-
-    @Override
-    public Answer execute(final GetHostStatsCommand command, final CitrixResourceBase citrixResourceBase) {
-        final Connection conn = citrixResourceBase.getConnection();
-        try {
-            final HostStatsEntry hostStats = citrixResourceBase.getHostStats(conn, command, command.getHostGuid(), command.getHostId());
-            return new GetHostStatsAnswer(command, hostStats);
-        } catch (final Exception e) {
-            final String msg = "Unable to get Host stats" + e.toString();
-            s_logger.warn(msg, e);
-            return new GetHostStatsAnswer(command, null);
-        }
-    }
-}
\ No newline at end of file


Mime
View raw message