cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthon...@apache.org
Subject [2/2] git commit: updated refs/heads/master to e0e2268
Date Wed, 23 Apr 2014 22:38:04 GMT
CLOUDSTACK-6438
CLOUDSTACK-6442
  XAPI plugins must be copied to XS master first.


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

Branch: refs/heads/master
Commit: e0e226869d83189dcdb69e3c18b24c47e2b8f1fe
Parents: 2ff2b6c
Author: Anthony Xu <anthony.xu@citrix.com>
Authored: Wed Apr 23 15:30:36 2014 -0700
Committer: Anthony Xu <anthony.xu@citrix.com>
Committed: Wed Apr 23 15:32:36 2014 -0700

----------------------------------------------------------------------
 .../hypervisor/xen/resource/CitrixResourceBase.java | 16 ++++++++++------
 .../xen/resource/Xenserver625Resource.java          |  5 +++--
 2 files changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e0e22686/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 ba8be91..65d5a0e 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
@@ -4663,8 +4663,16 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
 
     protected SetupAnswer execute(SetupCommand cmd) {
         Connection conn = getConnection();
-        setupServer(conn);
         try {
+            Map<Pool, Pool.Record> poolRecs = Pool.getAllRecords(conn);
+            if (poolRecs.size() != 1) {
+                throw new CloudRuntimeException("There are " + poolRecs.size() + " pool for
host :" + _host.uuid);
+            }
+            Host master = poolRecs.values().iterator().next().master;
+            setupServer(conn, master);
+            Host host = Host.getByUuid(conn, _host.uuid);
+            setupServer(conn, host);
+
             if (!setIptables(conn)) {
                 s_logger.warn("set xenserver Iptable failed");
                 return null;
@@ -4687,7 +4695,6 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
                 return null;
             }
             cleanupTemplateSR(conn);
-            Host host = Host.getByUuid(conn, _host.uuid);
             try {
                 if (cmd.useMultipath()) {
                     // the config value is set to true
@@ -4801,14 +4808,11 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
     }
 
     /* return : if setup is needed */
-    protected boolean setupServer(Connection conn) {
+    protected boolean setupServer(Connection conn, Host host) {
         String packageVersion = CitrixResourceBase.class.getPackage().getImplementationVersion();
         String version = this.getClass().getName() + "-" + (packageVersion == null ? Long.toString(System.currentTimeMillis())
: packageVersion);
 
         try {
-            Host host = Host.getByUuid(conn, _host.uuid);
-            /* enable host in case it is disabled somehow */
-            host.enable(conn);
             /* push patches to XenServer */
             Host.Record hr = host.getRecord(conn);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e0e22686/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625Resource.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625Resource.java
index b1442de..4014364 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625Resource.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625Resource.java
@@ -30,6 +30,7 @@ import org.apache.xmlrpc.XmlRpcException;
 import com.xensource.xenapi.Connection;
 import com.xensource.xenapi.Types;
 import com.xensource.xenapi.VM;
+import com.xensource.xenapi.Host;
 
 import org.apache.cloudstack.hypervisor.xenserver.XenServerResourceNewBase;
 
@@ -107,7 +108,7 @@ public class Xenserver625Resource extends XenServerResourceNewBase {
     }
 
     @Override
-    protected boolean setupServer(Connection conn) {
+    protected boolean setupServer(Connection conn,Host host) {
         com.trilead.ssh2.Connection sshConnection = new com.trilead.ssh2.Connection(_host.ip,
22);
         try {
             sshConnection.connect(null, 60000, 60000);
@@ -131,7 +132,7 @@ public class Xenserver625Resource extends XenServerResourceNewBase {
         } finally {
             sshConnection.close();
         }
-        return super.setupServer(conn);
+        return super.setupServer(conn, host);
     }
 
     @Override


Mime
View raw message