Skip to content

Commit fe3200c

Browse files
committed
bug CS-14718: wait util xenserver join pool operation stablize.
status CS-14718: resolved fixed
1 parent d0c3e21 commit fe3200c

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3975,9 +3975,19 @@ public Type getType() {
39753975
protected boolean getHostInfo(Connection conn) throws IllegalArgumentException{
39763976
try {
39773977
Host myself = Host.getByUuid(conn, _host.uuid);
3978+
Set<HostCpu> hcs = null;
3979+
for (int i = 0; i < 10; i++) {
3980+
hcs = myself.getHostCPUs(conn);
3981+
_host.cpus = hcs.size();
3982+
if (_host.cpus > 0) {
3983+
break;
3984+
}
3985+
Thread.sleep(5000);
3986+
}
3987+
if (_host.cpus <= 0) {
3988+
throw new CloudRuntimeException("Cannot get the numbers of cpu from XenServer host " + _host.ip);
3989+
}
39783990

3979-
Set<HostCpu> hcs = myself.getHostCPUs(conn);
3980-
_host.cpus = hcs.size();
39813991
for (final HostCpu hc : hcs) {
39823992
_host.speed = hc.getSpeed(conn).intValue();
39833993
break;
@@ -4051,7 +4061,7 @@ protected boolean getHostInfo(Connection conn) throws IllegalArgumentException{
40514061
} catch (XenAPIException e) {
40524062
s_logger.warn("Unable to get host information for " + _host.ip, e);
40534063
return false;
4054-
} catch (XmlRpcException e) {
4064+
} catch (Exception e) {
40554065
s_logger.warn("Unable to get host information for " + _host.ip, e);
40564066
return false;
40574067
}

0 commit comments

Comments
 (0)