bug 6471: make sure VM start on host, it is supposed to run on

status 6471: resolved fixed
This commit is contained in:
anthony 2010-10-08 18:49:46 -07:00
parent 39b9a47b3b
commit f08afb2bae
1 changed files with 5 additions and 3 deletions

View File

@ -318,9 +318,6 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR
}
try {
if (isRefNull(record.affinity) || !record.affinity.getUuid(conn).equals(_host.uuid)) {
continue;
}
vmentry.getKey().destroy(conn);
} catch (Exception e) {
String msg = "VM destroy failed for " + record.nameLabel + " due to " + e.getMessage();
@ -2490,6 +2487,11 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR
vm.setActionsAfterCrash(conn, Types.OnCrashBehaviour.DESTROY);
vm.start(conn, false, true);
if(!vm.getResidentOn(conn).getUuid(conn).equals(_host.uuid)){
startvmfailhandle(vm, null);
throw new Exception("can not start VM " + cmd.getVmName() + " On host " + _host.ip);
}
if (_canBridgeFirewall) {
String result = callHostPlugin("default_network_rules",