Examples of safePowerOff()


Examples of com.cloud.hypervisor.vmware.mo.VirtualMachineMO.safePowerOff()

            VirtualMachineMO vmMo = hyperHost.findVmOnHyperHost(vmName);
            if (vmMo != null) {
                s_logger.info("VM " + vmName + " already exists, tear down devices for reconfiguration");
                if (getVmState(vmMo) != State.Stopped)
                    vmMo.safePowerOff(_shutdown_waitMs);
                vmMo.tearDownDevices(new Class<?>[] { VirtualDisk.class, VirtualEthernetCard.class });
                vmMo.ensureScsiDeviceController();
            } else {
                ManagedObjectReference morDc = hyperHost.getHyperHostDatacenter();
                assert (morDc != null);
View Full Code Here

Examples of com.cloud.hypervisor.vmware.mo.VirtualMachineMO.safePowerOff()

                    }

                    takeVmFromOtherHyperHost(hyperHost, vmName);

                    if (getVmState(vmMo) != State.Stopped)
                        vmMo.safePowerOff(_shutdown_waitMs);
                    vmMo.tearDownDevices(new Class<?>[] { VirtualDisk.class, VirtualEthernetCard.class });
                    vmMo.ensureScsiDeviceController();
                } else {
                    int ramMb = (int) (vmSpec.getMinRam() / (1024 * 1024));
                    Pair<ManagedObjectReference, DatastoreMO> rootDiskDataStoreDetails = null;
View Full Code Here

Examples of com.cloud.hypervisor.vmware.mo.VirtualMachineMO.safePowerOff()

                       
                        // before we stop VM, remove all possible snapshots on the VM to let
                        // disk chain be collapsed
                        s_logger.info("Remove all snapshot before stopping VM " + cmd.getVmName());
                        vmMo.removeAllSnapshots();
                        if (vmMo.safePowerOff(_shutdown_waitMs)) {
                            state = State.Stopped;
                            return new StopAnswer(cmd, "Stop VM " + cmd.getVmName() + " Succeed", 0, true);
                        } else {
                          String msg = "Have problem in powering off VM " + cmd.getVmName() + ", let the process continue";
                          s_logger.warn(msg);
View Full Code Here

Examples of com.cloud.hypervisor.vmware.mo.VirtualMachineMO.safePowerOff()

                        HostMO hostMo = vmMo.getRunningHost();
                        List<NetworkDetails> networks = vmMo.getNetworksWithDetails();
                       
                        // tear down all devices first before we destroy the VM to avoid accidently delete disk backing files
                        if (getVmState(vmMo) != State.Stopped)
                          vmMo.safePowerOff(_shutdown_waitMs);
                        vmMo.tearDownDevices(new Class<?>[] { VirtualDisk.class, VirtualEthernetCard.class });
                        vmMo.destroy();
                       
                        for (NetworkDetails netDetails : networks) {
                            if (netDetails.getGCTag() != null && netDetails.getGCTag().equalsIgnoreCase("true")) {
View Full Code Here

Examples of com.cloud.hypervisor.vmware.mo.VirtualMachineMO.safePowerOff()

            VirtualMachineDiskInfoBuilder diskInfoBuilder = null;
            VirtualMachineMO vmMo = hyperHost.findVmOnHyperHost(vmInternalCSName);
            if (vmMo != null) {
                s_logger.info("VM " + vmInternalCSName + " already exists, tear down devices for reconfiguration");
                if (getVmState(vmMo) != State.Stopped)
                    vmMo.safePowerOff(_shutdown_waitMs);
            
                // retrieve disk information before we tear down
                diskInfoBuilder = vmMo.getDiskInfoBuilder();
                vmMo.tearDownDevices(new Class<?>[] { VirtualDisk.class, VirtualEthernetCard.class });
                vmMo.ensureScsiDeviceController();
View Full Code Here

Examples of com.cloud.hypervisor.vmware.mo.VirtualMachineMO.safePowerOff()

                    }

                    takeVmFromOtherHyperHost(hyperHost, vmInternalCSName);

                    if (getVmState(vmMo) != State.Stopped)
                        vmMo.safePowerOff(_shutdown_waitMs);
                   
                    diskInfoBuilder = vmMo.getDiskInfoBuilder();
                    vmMo.tearDownDevices(new Class<?>[] { VirtualDisk.class, VirtualEthernetCard.class });
                    vmMo.ensureScsiDeviceController();
                } else {
View Full Code Here

Examples of com.cloud.hypervisor.vmware.mo.VirtualMachineMO.safePowerOff()

                try {
                    vmMo.setCustomFieldValue(CustomFieldConstants.CLOUD_NIC_MASK, "0");

                    if (getVmState(vmMo) != State.Stopped) {
                        if (vmMo.safePowerOff(_shutdown_waitMs)) {
                            state = State.Stopped;
                            return new StopAnswer(cmd, "Stop VM " + cmd.getVmName() + " Succeed", 0, true);
                        } else {
                            String msg = "Have problem in powering off VM " + cmd.getVmName() + ", let the process continue";
                            s_logger.warn(msg);
View Full Code Here

Examples of com.cloud.hypervisor.vmware.mo.VirtualMachineMO.safePowerOff()

                        HostMO hostMo = vmMo.getRunningHost();
                        List<NetworkDetails> networks = vmMo.getNetworksWithDetails();

                        // tear down all devices first before we destroy the VM to avoid accidently delete disk backing files
                        if (getVmState(vmMo) != State.Stopped)
                            vmMo.safePowerOff(_shutdown_waitMs);
                        vmMo.tearDownDevices(new Class<?>[] { VirtualDisk.class, VirtualEthernetCard.class });
                        vmMo.destroy();

                        for (NetworkDetails netDetails : networks) {
                            if (netDetails.getGCTag() != null && netDetails.getGCTag().equalsIgnoreCase("true")) {
View Full Code Here

Examples of com.cloud.hypervisor.vmware.mo.VirtualMachineMO.safePowerOff()

                        HostMO hostMo = vmMo.getRunningHost();
                        List<NetworkDetails> networks = vmMo.getNetworksWithDetails();

                        // tear down all devices first before we destroy the VM to avoid accidently delete disk backing files
                        if (resource.getVmState(vmMo) != State.Stopped) {
                            vmMo.safePowerOff(_shutdown_waitMs);
                        }
                       
                        List<String> detachedDisks = vmMo.detachAllDisksExcept(vol.getPath(), diskInfo != null ? diskInfo.getDiskDeviceBusName() : null);
                        VmwareStorageLayoutHelper.moveVolumeToRootFolder(new DatacenterMO(context, morDc), detachedDisks);
View Full Code Here

Examples of com.cloud.hypervisor.vmware.mo.VirtualMachineMO.safePowerOff()

            VirtualMachineMO vmMo = hyperHost.findVmOnHyperHost(vmInternalCSName);
            boolean hasSnapshot = false;
            if (vmMo != null) {
                s_logger.info("VM " + vmInternalCSName + " already exists, tear down devices for reconfiguration");
                if (getVmPowerState(vmMo) != PowerState.PowerOff)
                    vmMo.safePowerOff(_shutdown_waitMs);

                // retrieve disk information before we tear down
                diskInfoBuilder = vmMo.getDiskInfoBuilder();
                hasSnapshot = vmMo.hasSnapshot();
                if(!hasSnapshot)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.