Refix ha start vm last host uuid
@@ -3875,6 +3875,7 @@ public class VmInstanceBase extends AbstractVmInstance {
FlowChain chain = getStartVmWorkFlowChain(inv);
setFlowMarshaller(chain);
+ String oldHostUuid = self.getHostUuid();
chain.setName(String.format("start-vm-%s", self.getUuid()));
chain.getData().put(VmInstanceConstant.Params.VmInstanceSpec.toString(), spec);
chain.done(new FlowDoneHandler(completion) {
@@ -3884,7 +3885,7 @@ public class VmInstanceBase extends AbstractVmInstance {
// reload self because some nics may have been deleted in start phase because a former L3Network deletion.
// reload to avoid JPA EntityNotFoundException
self = dbf.reload(self);
- self.setLastHostUuid(self.getHostUuid());
+ self.setLastHostUuid(oldHostUuid != null ? oldHostUuid:self.getHostUuid());
self.setHostUuid(spec.getDestHost().getUuid());
self.setClusterUuid(spec.getDestHost().getClusterUuid());
self.setZoneUuid(spec.getDestHost().getZoneUuid());
