mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-6438
CLOUDSTACK-6442 XAPI plugins must be copied to XS master first.
This commit is contained in:
parent
52f40433b9
commit
33c0d6c7bb
|
|
@ -4666,8 +4666,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;
|
||||
|
|
@ -4690,7 +4698,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
|
||||
|
|
@ -4804,14 +4811,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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue