You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2013/12/06 03:39:19 UTC
git commit: updated refs/heads/4.2-workplace to ca2f844
Updated Branches:
refs/heads/4.2-workplace 305cfb0f3 -> ca2f84408
Finally, can start vm now.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ca2f8440
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ca2f8440
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ca2f8440
Branch: refs/heads/4.2-workplace
Commit: ca2f844085a5eef2d1ffe3cc7ca502bbe0d91d30
Parents: 305cfb0
Author: Edison Su <su...@gmail.com>
Authored: Thu Dec 5 18:38:00 2013 -0800
Committer: Edison Su <su...@gmail.com>
Committed: Thu Dec 5 18:38:00 2013 -0800
----------------------------------------------------------------------
.../xen/resource/CitrixResourceBase.java | 93 ++++++++++----------
.../xenserver/XenServerResourceNewBase.java | 3 +-
.../hypervisor/xenserver/cloud-plugin-snapshot | 6 +-
.../xenserver/copy_vhd_from_secondarystorage.sh | 2 +-
.../create_privatetemplate_from_snapshot.sh | 2 +-
.../vm/hypervisor/xenserver/upgrade_snapshot.sh | 2 +-
6 files changed, 52 insertions(+), 56 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ca2f8440/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index 889c0e5..4c6314f 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -51,6 +51,9 @@ import javax.naming.ConfigurationException;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+import org.apache.cloudstack.storage.command.StorageSubSystemCommand;
+import org.apache.cloudstack.storage.to.TemplateObjectTO;
+import org.apache.cloudstack.storage.to.VolumeObjectTO;
import org.apache.commons.codec.binary.Base64;
import org.apache.log4j.Logger;
import org.apache.xmlrpc.XmlRpcException;
@@ -60,46 +63,6 @@ import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
-import com.google.gson.Gson;
-import com.trilead.ssh2.SCPClient;
-import com.xensource.xenapi.Bond;
-import com.xensource.xenapi.Connection;
-import com.xensource.xenapi.Console;
-import com.xensource.xenapi.Host;
-import com.xensource.xenapi.HostCpu;
-import com.xensource.xenapi.HostMetrics;
-import com.xensource.xenapi.Network;
-import com.xensource.xenapi.PBD;
-import com.xensource.xenapi.PIF;
-import com.xensource.xenapi.PIF.Record;
-import com.xensource.xenapi.Pool;
-import com.xensource.xenapi.SR;
-import com.xensource.xenapi.Session;
-import com.xensource.xenapi.Task;
-import com.xensource.xenapi.Types;
-import com.xensource.xenapi.Types.BadAsyncResult;
-import com.xensource.xenapi.Types.BadServerResponse;
-import com.xensource.xenapi.Types.ConsoleProtocol;
-import com.xensource.xenapi.Types.IpConfigurationMode;
-import com.xensource.xenapi.Types.OperationNotAllowed;
-import com.xensource.xenapi.Types.SrFull;
-import com.xensource.xenapi.Types.VbdType;
-import com.xensource.xenapi.Types.VmBadPowerState;
-import com.xensource.xenapi.Types.VmPowerState;
-import com.xensource.xenapi.Types.XenAPIException;
-import com.xensource.xenapi.VBD;
-import com.xensource.xenapi.VBDMetrics;
-import com.xensource.xenapi.VDI;
-import com.xensource.xenapi.VIF;
-import com.xensource.xenapi.VLAN;
-import com.xensource.xenapi.VM;
-import com.xensource.xenapi.VMGuestMetrics;
-import com.xensource.xenapi.XenAPIObject;
-
-import org.apache.cloudstack.storage.command.StorageSubSystemCommand;
-import org.apache.cloudstack.storage.to.TemplateObjectTO;
-import org.apache.cloudstack.storage.to.VolumeObjectTO;
-
import com.cloud.agent.IAgentControl;
import com.cloud.agent.api.Answer;
import com.cloud.agent.api.AttachIsoCommand;
@@ -300,6 +263,41 @@ import com.cloud.utils.ssh.SSHCmdHelper;
import com.cloud.vm.DiskProfile;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.snapshot.VMSnapshot;
+import com.google.gson.Gson;
+import com.trilead.ssh2.SCPClient;
+import com.xensource.xenapi.Bond;
+import com.xensource.xenapi.Connection;
+import com.xensource.xenapi.Console;
+import com.xensource.xenapi.Host;
+import com.xensource.xenapi.HostCpu;
+import com.xensource.xenapi.HostMetrics;
+import com.xensource.xenapi.Network;
+import com.xensource.xenapi.PBD;
+import com.xensource.xenapi.PIF;
+import com.xensource.xenapi.PIF.Record;
+import com.xensource.xenapi.Pool;
+import com.xensource.xenapi.SR;
+import com.xensource.xenapi.Session;
+import com.xensource.xenapi.Task;
+import com.xensource.xenapi.Types;
+import com.xensource.xenapi.Types.BadAsyncResult;
+import com.xensource.xenapi.Types.BadServerResponse;
+import com.xensource.xenapi.Types.ConsoleProtocol;
+import com.xensource.xenapi.Types.IpConfigurationMode;
+import com.xensource.xenapi.Types.OperationNotAllowed;
+import com.xensource.xenapi.Types.SrFull;
+import com.xensource.xenapi.Types.VbdType;
+import com.xensource.xenapi.Types.VmBadPowerState;
+import com.xensource.xenapi.Types.VmPowerState;
+import com.xensource.xenapi.Types.XenAPIException;
+import com.xensource.xenapi.VBD;
+import com.xensource.xenapi.VBDMetrics;
+import com.xensource.xenapi.VDI;
+import com.xensource.xenapi.VIF;
+import com.xensource.xenapi.VLAN;
+import com.xensource.xenapi.VM;
+import com.xensource.xenapi.VMGuestMetrics;
+import com.xensource.xenapi.XenAPIObject;
/**
* CitrixResourceBase encapsulates the calls to the XenServer Xapi process
@@ -3798,7 +3796,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
wait = 2 * 60 * 60;
}
try {
- //task = vdi.copyAsync(conn, sr);
+ task = vdi.copyAsync(conn, sr, null, null);
// poll every 1 seconds , timeout after 2 hours
waitForTask(conn, task, 1000, wait * 1000);
checkForSuccess(conn, task);
@@ -3880,15 +3878,14 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
protected SR createFileSR(Connection conn, String path, String location) {
try {
- Map<String, String> deviceConfig = new HashMap<String, String>();
- deviceConfig.put("path", path);
+ Map<String, String> smConfig = new HashMap<String, String>();
+ smConfig.put("location", path);
Host host = Host.getByUuid(conn, _host.uuid);
- SR sr = SR.create(conn, host, deviceConfig, new Long(0), path, "file", "file", "file", false,
- new HashMap<String, String>());
- sr.setNameLabel(conn, path + "-File");
- sr.setNameDescription(conn, location);
+ String uuid = UUID.randomUUID().toString();
- sr.scan(conn);
+ SR sr = SR.introduce(conn,uuid, uuid, uuid, "file", "file", false, smConfig);
+
+ //sr.scan(conn);
return sr;
} catch (Exception e) {
String msg = "createFileSR failed! due to " + e.toString();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ca2f8440/plugins/hypervisors/xen/src/org/apache/cloudstack/hypervisor/xenserver/XenServerResourceNewBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/org/apache/cloudstack/hypervisor/xenserver/XenServerResourceNewBase.java b/plugins/hypervisors/xen/src/org/apache/cloudstack/hypervisor/xenserver/XenServerResourceNewBase.java
index 55d7e99..2ee45a3 100644
--- a/plugins/hypervisors/xen/src/org/apache/cloudstack/hypervisor/xenserver/XenServerResourceNewBase.java
+++ b/plugins/hypervisors/xen/src/org/apache/cloudstack/hypervisor/xenserver/XenServerResourceNewBase.java
@@ -94,8 +94,7 @@ public class XenServerResourceNewBase extends XenServer610Resource {
return cmds;
}
- @Override
- protected void waitForTask(Connection c, Task task, long pollInterval, long timeout) throws XenAPIException, XmlRpcException, TimeoutException {
+ protected void waitForTask2(Connection c, Task task, long pollInterval, long timeout) throws XenAPIException, XmlRpcException, TimeoutException {
long beginTime = System.currentTimeMillis();
if (s_logger.isTraceEnabled()) {
s_logger.trace("Task " + task.getNameLabel(c) + " (" + task.getType(c) + ") sent to " + c.getSessionReference() + " is pending completion with a " + timeout +
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ca2f8440/scripts/vm/hypervisor/xenserver/cloud-plugin-snapshot
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/cloud-plugin-snapshot b/scripts/vm/hypervisor/xenserver/cloud-plugin-snapshot
index 8da1485..7001987 100644
--- a/scripts/vm/hypervisor/xenserver/cloud-plugin-snapshot
+++ b/scripts/vm/hypervisor/xenserver/cloud-plugin-snapshot
@@ -1,4 +1,4 @@
- #!/usr/bin/python
+#!/usr/bin/python
# 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
@@ -349,7 +349,7 @@ def mountSnapshotsDir(secondaryStorageMountPath, localMountPointPath, path):
mount(snapshotsDir, localMountPointPath)
# Create accountId/instanceId dir on localMountPointPath, if it doesn't exist
- backupsDi = os.path.join(localMountPointPath, restDir)
+ backupsDir = os.path.join(localMountPointPath, restDir)
makedirs(backupsDir)
return backupsDir
@@ -379,7 +379,7 @@ def unmountSnapshotsDir(session, args):
@echo
def mountNfsSecondaryStorage(session, args):
remoteDir = args['remoteDir']
- localDir = args]'localDir']
+ localDir = args['localDir']
makedirs(localDir)
options = "soft,tcp,timeo=133,retrans=1"
try:
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ca2f8440/scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh b/scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh
index 2443891..eb52322 100755
--- a/scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh
+++ b/scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh
@@ -89,7 +89,7 @@ fi
-VHDUTIL="/opt/xensource/bin/vhd-util"
+VHDUTIL="vhd-util"
copyvhd()
{
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ca2f8440/scripts/vm/hypervisor/xenserver/create_privatetemplate_from_snapshot.sh
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/create_privatetemplate_from_snapshot.sh b/scripts/vm/hypervisor/xenserver/create_privatetemplate_from_snapshot.sh
index d39fc6e..6eefa5e 100755
--- a/scripts/vm/hypervisor/xenserver/create_privatetemplate_from_snapshot.sh
+++ b/scripts/vm/hypervisor/xenserver/create_privatetemplate_from_snapshot.sh
@@ -96,7 +96,7 @@ if [ $? -ne 0 ]; then
exit 0
fi
-VHDUTIL="/opt/cloud/bin/vhd-util"
+VHDUTIL="vhd-util"
copyvhd()
{
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ca2f8440/scripts/vm/hypervisor/xenserver/upgrade_snapshot.sh
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/upgrade_snapshot.sh b/scripts/vm/hypervisor/xenserver/upgrade_snapshot.sh
index 4cb2e30..ba7dffd 100755
--- a/scripts/vm/hypervisor/xenserver/upgrade_snapshot.sh
+++ b/scripts/vm/hypervisor/xenserver/upgrade_snapshot.sh
@@ -87,7 +87,7 @@ if [ $? -ne 0 ]; then
exit 0
fi
-VHDUTIL="/opt/cloud/bin/vhd-util"
+VHDUTIL="vhd-util"
upgradeSnapshot()
{