132133134135136137138139140141142
// VirtualMachineSummary summary = (VirtualMachineSummary) (existingVm.getSummary()); if(vmOverwrite) { if (vsphereServer.isVmPoweredOn(existingVm)) { vsphereServer.powerOffVm(existingVm); } vsphereServer.destroyVm(existingVm); } else {
175176177178179180181182183184185
vsphereServer.powerOnVm(newVm); } //it is now in bios waiting , so we can power it off if (newVm!=null) { vsphereServer.powerOffVm(newVm); } //flip the enterbios flag vsphereServer.setEnterBiosVm(newVm,false);