use of com.vmware.vim25.ManagedObjectReference in project CloudStack-archive by CloudStack-extras.
the class HypervisorHostHelper method waitForNetworkReady.
public static ManagedObjectReference waitForNetworkReady(HostMO hostMo, String networkName, long timeOutMs) throws Exception {
ManagedObjectReference morNetwork = null;
// if portGroup is just created, getNetwork may fail to retrieve it, we
// need to retry
long startTick = System.currentTimeMillis();
while (System.currentTimeMillis() - startTick <= timeOutMs) {
morNetwork = hostMo.getNetworkMor(networkName);
if (morNetwork != null) {
break;
}
s_logger.info("Waiting for network " + networkName + " to be ready");
Thread.sleep(1000);
}
return morNetwork;
}
use of com.vmware.vim25.ManagedObjectReference in project CloudStack-archive by CloudStack-extras.
the class VirtualDiskManagerMO method extendVirtualDisk.
public void extendVirtualDisk(String name, ManagedObjectReference morDc, long newCapacityKb, boolean eagerZero) throws Exception {
ManagedObjectReference morTask = _context.getService().extendVirtualDisk_Task(_mor, name, morDc, newCapacityKb, eagerZero);
String result = _context.getServiceUtil().waitForTask(morTask);
if (!result.equals("sucess"))
throw new Exception("Unable to extend virtual disk " + name + " due to " + TaskMO.getTaskFailureInfo(_context, morTask));
_context.waitForTaskProgressDone(morTask);
}
use of com.vmware.vim25.ManagedObjectReference in project CloudStack-archive by CloudStack-extras.
the class VirtualDiskManagerMO method zeroFillVirtualDisk.
public void zeroFillVirtualDisk(String name, ManagedObjectReference morDc) throws Exception {
ManagedObjectReference morTask = _context.getService().zeroFillVirtualDisk_Task(_mor, name, morDc);
String result = _context.getServiceUtil().waitForTask(morTask);
if (!result.equals("sucess"))
throw new Exception("Unable to zero fill virtual disk " + name + " due to " + TaskMO.getTaskFailureInfo(_context, morTask));
_context.waitForTaskProgressDone(morTask);
}
use of com.vmware.vim25.ManagedObjectReference in project CloudStack-archive by CloudStack-extras.
the class VirtualDiskManagerMO method deleteVirtualDisk.
public void deleteVirtualDisk(String name, ManagedObjectReference morDc) throws Exception {
ManagedObjectReference morTask = _context.getService().deleteVirtualDisk_Task(_mor, name, morDc);
String result = _context.getServiceUtil().waitForTask(morTask);
if (!result.equals("sucess"))
throw new Exception("Unable to delete virtual disk " + name + " due to " + TaskMO.getTaskFailureInfo(_context, morTask));
_context.waitForTaskProgressDone(morTask);
}
use of com.vmware.vim25.ManagedObjectReference in project CloudStack-archive by CloudStack-extras.
the class VirtualDiskManagerMO method moveVirtualDisk.
public void moveVirtualDisk(String srcName, ManagedObjectReference morSrcDc, String destName, ManagedObjectReference morDestDc, boolean force) throws Exception {
ManagedObjectReference morTask = _context.getService().moveVirtualDisk_Task(_mor, srcName, morSrcDc, destName, morDestDc, force);
String result = _context.getServiceUtil().waitForTask(morTask);
if (!result.equals("sucess"))
throw new Exception("Unable to move virtual disk " + srcName + " to " + destName + " due to " + TaskMO.getTaskFailureInfo(_context, morTask));
_context.waitForTaskProgressDone(morTask);
}
Aggregations