use of com.vmware.vim25.ManagedObjectReference in project CloudStack-archive by CloudStack-extras.
the class HostMO method getHyperHostOwnerResourcePool.
@Override
public ManagedObjectReference getHyperHostOwnerResourcePool() throws Exception {
ServiceUtil serviceUtil = _context.getServiceUtil();
ManagedObjectReference morComputerResource = (ManagedObjectReference) serviceUtil.getDynamicProperty(_mor, "parent");
return (ManagedObjectReference) serviceUtil.getDynamicProperty(morComputerResource, "resourcePool");
}
use of com.vmware.vim25.ManagedObjectReference in project CloudStack-archive by CloudStack-extras.
the class HostMO method getHostFirewallSystemMO.
public HostFirewallSystemMO getHostFirewallSystemMO() throws Exception {
HostConfigManager configMgr = getHostConfigManager();
ManagedObjectReference morFirewall = configMgr.getFirewallSystem();
// only ESX hosts have firewall manager
if (morFirewall != null)
return new HostFirewallSystemMO(_context, morFirewall);
return null;
}
use of com.vmware.vim25.ManagedObjectReference in project CloudStack-archive by CloudStack-extras.
the class HostMO method getLocalDatastoreOnHost.
public List<Pair<ManagedObjectReference, String>> getLocalDatastoreOnHost() throws Exception {
List<Pair<ManagedObjectReference, String>> dsList = new ArrayList<Pair<ManagedObjectReference, String>>();
ObjectContent[] ocs = getDatastorePropertiesOnHyperHost(new String[] { "name", "summary" });
if (ocs != null) {
for (ObjectContent oc : ocs) {
DatastoreSummary dsSummary = (DatastoreSummary) VmwareHelper.getPropValue(oc, "summary");
if (dsSummary.getMultipleHostAccess() == false && dsSummary.isAccessible() && dsSummary.getType().equalsIgnoreCase("vmfs")) {
ManagedObjectReference morDs = oc.getObj();
String name = (String) VmwareHelper.getPropValue(oc, "name");
dsList.add(new Pair<ManagedObjectReference, String>(morDs, name));
}
}
}
return dsList;
}
use of com.vmware.vim25.ManagedObjectReference in project CloudStack-archive by CloudStack-extras.
the class HostMO method importVmFromOVF.
@Override
public void importVmFromOVF(String ovfFilePath, String vmName, DatastoreMO dsMo, String diskOption) throws Exception {
ManagedObjectReference morRp = getHyperHostOwnerResourcePool();
assert (morRp != null);
HypervisorHostHelper.importVmFromOVF(this, ovfFilePath, vmName, dsMo, diskOption, morRp, _mor);
}
use of com.vmware.vim25.ManagedObjectReference in project CloudStack-archive by CloudStack-extras.
the class HostMO method getHostLocalDatastore.
public ManagedObjectReference[] getHostLocalDatastore() throws Exception {
ServiceUtil serviceUtil = _context.getServiceUtil();
ManagedObjectReference[] datastores = (ManagedObjectReference[]) serviceUtil.getDynamicProperty(_mor, "datastore");
List<ManagedObjectReference> l = new ArrayList<ManagedObjectReference>();
if (datastores != null) {
for (ManagedObjectReference mor : datastores) {
DatastoreSummary summary = (DatastoreSummary) serviceUtil.getDynamicProperty(mor, "summary");
if (summary.getType().equalsIgnoreCase("VMFS") && !summary.getMultipleHostAccess())
l.add(mor);
}
}
return l.toArray(new ManagedObjectReference[1]);
}
Aggregations