private VirtualMachineSnapshot getCurrentSnapshotOrCreate(String snapshotName, String snapshotDescription, VirtualMachine master) throws InvalidName, VmConfigFault, SnapshotFault, TaskInProgress, FileFault, InvalidState, RuntimeFault, RemoteException { if (master.getSnapshot() == null) { Task task = master.createSnapshot_Task(snapshotName, snapshotDescription, false, false); try { if (task.waitForTask().equals(Task.SUCCESS)) { logger.debug(String.format("snapshot taken for '%s'", master.getName())); } } catch (Exception e) { logger.debug(String.format("Can't take snapshot for '%s'", master.getName()), e); throw propagate(e); } } else logger.debug(String.format("snapshot already available for '%s'", master.getName())); return master.getCurrentSnapShot(); }
/** * Remove the device. Make sure the VM is powered off before calling this method. * If destroyDeviceBacking is true, it deletes backings for example files in datastore. BE CAREFUL! */ public Task removeDevice(VirtualDevice device, boolean destroyDeviceBacking) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, RemoteException { ArrayList<VirtualDevice> deviceList = new ArrayList<VirtualDevice>(); deviceList.add(device); return removeDevices(deviceList, destroyDeviceBacking); }
/** * Create an instance of {@link JAXBElement }{@code <}{@link VmConfigFault }{@code >}} * */ @XmlElementDecl(namespace = "urn:pbm", name = "VmConfigFaultFault") public JAXBElement<VmConfigFault> createVmConfigFaultFault(VmConfigFault value) { return new JAXBElement<VmConfigFault>(_VmConfigFaultFault_QNAME, VmConfigFault.class, null, value); }
/** * @param floppyImagePath - i.e. "[storage1] myVM/myFloppy.flp" Note: there is a space after ]. */ public Task addFloppyDriveFromISO(String floppyImagePath, boolean startConnected) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, RemoteException { return addFloppyDrive(floppyImagePath, null, null, startConnected); }
/** * @param hostDevice - i.e. "/dev/fd0" */ public Task addFloppyDriveFromHost(String hostDevice, boolean startConnected) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, RemoteException { return addFloppyDrive(null, null, hostDevice, startConnected); }
public Task createFloppyDrive(String floppyImagePath, boolean startConnected) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, RemoteException { return addFloppyDrive(null, floppyImagePath, null, startConnected); }
public OvfCreateDescriptorResult createDescriptor(ManagedEntity obj, OvfCreateDescriptorParams cdp) throws TaskInProgress, VmConfigFault, ConcurrentAccess, FileFault, InvalidState, RuntimeFault, RemoteException { return getVimService().createDescriptor(getMOR(), obj.getMOR(), cdp); }
public OvfCreateImportSpecResult createImportSpec(String ovfDescriptor, ResourcePool resourcePool, Datastore datastore, OvfCreateImportSpecParams cisp) throws TaskInProgress, VmConfigFault, ConcurrentAccess, FileFault, InvalidState, InvalidDatastore, RuntimeFault, RemoteException { return getVimService().createImportSpec(getMOR(), ovfDescriptor, resourcePool.getMOR(), datastore.getMOR(), cisp); }
public OvfParseDescriptorResult parseDescriptor(String ovfDescriptor, OvfParseDescriptorParams pdp) throws TaskInProgress, VmConfigFault, ConcurrentAccess, FileFault, InvalidState, RuntimeFault, RemoteException { return getVimService().parseDescriptor(getMOR(), ovfDescriptor, pdp); }
public Task cloneVApp_Task(String name, ManagedObjectReference target, VAppCloneSpec spec) throws InvalidState, InvalidDatastore, TaskInProgress, VmConfigFault, FileFault, MigrationFault, InsufficientResourcesFault, RuntimeFault, RemoteException { ManagedObjectReference taskMor = getVimService().cloneVApp_Task(getMOR(), name, target, spec); return new Task(getServerConnection(), taskMor); }
public Task powerOnVApp_Task() throws TaskInProgress, InvalidState, InsufficientResourcesFault, VmConfigFault, VAppConfigFault, FileFault, RuntimeFault, RemoteException { ManagedObjectReference taskMor = getVimService().powerOnVApp_Task(getMOR()); return new Task(getServerConnection(), taskMor); }
public void updateVAppConfig(VAppConfigSpec spec) throws TaskInProgress, VmConfigFault, ConcurrentAccess, FileFault, InvalidName, DuplicateName, InvalidState, InsufficientResourcesFault, InvalidDatastore, RuntimeFault, RemoteException { getVimService().updateVAppConfig(getMOR(), spec); }