use of com.vmware.vim25.RuntimeFault in project coprhd-controller by CoprHD.
the class ComputeSystemControllerImpl method getWwnDatastoreMap.
/**
* Gets a map of volume wwn to datastore for all datastores that the host has access to
*
* @param host the host
* @return map of volume wwn to datastore
* @throws InvalidProperty
* @throws RuntimeFault
* @throws RemoteException
*/
public Map<String, Datastore> getWwnDatastoreMap(HostSystem host) throws InvalidProperty, RuntimeFault, RemoteException {
Map<String, Datastore> result = Maps.newHashMap();
HostStorageAPI hostApi = new HostStorageAPI(host);
for (Datastore datastore : host.getDatastores()) {
if (datastore.getInfo() instanceof VmfsDatastoreInfo) {
Collection<HostScsiDisk> disks = hostApi.getDisksByPartition(datastore).values();
for (HostScsiDisk disk : disks) {
result.put(VMwareUtils.getDiskWwn(disk), datastore);
}
}
}
return result;
}
use of com.vmware.vim25.RuntimeFault in project coprhd-controller by CoprHD.
the class HostStorageAPI method setMultipathPolicy.
/**
* Sets the multipath policy on the given lun
*
* @param lun the lun to set the policy on
* @param multipathPolicy name of the multipath policy
*/
public void setMultipathPolicy(HostScsiDisk lun, String multipathPolicy) {
try {
HostStorageSystem storageSystem = getStorageSystem();
HostMultipathInfoLogicalUnitPolicy policy = createMultipathPolicy(multipathPolicy);
storageSystem.setMultipathLunPolicy(lun.getUuid(), policy);
} catch (HostConfigFault e) {
throw new VMWareException(e);
} catch (NotFound e) {
throw new VMWareException(e);
} catch (RuntimeFault e) {
throw new VMWareException(e);
} catch (RemoteException e) {
throw new VMWareException(e);
}
}
use of com.vmware.vim25.RuntimeFault in project coprhd-controller by CoprHD.
the class HostStorageAPI method rescanHBAs.
/**
* Rescans the HBAs on the host.
*/
public void rescanHBAs() {
try {
HostStorageSystem storageSystem = getStorageSystem();
storageSystem.rescanAllHba();
} catch (HostConfigFault e) {
throw new VMWareException(e);
} catch (RuntimeFault e) {
throw new VMWareException(e);
} catch (RemoteException e) {
throw new VMWareException(e);
}
}
use of com.vmware.vim25.RuntimeFault in project coprhd-controller by CoprHD.
the class HostStorageAPI method mountDatastore.
/**
* Attaches the datastore.
*/
public void mountDatastore(Datastore datastore) {
try {
HostStorageSystem storageSystem = getStorageSystem();
String vmfsUuid = getVmfsVolumeUuid(datastore);
storageSystem.mountVmfsVolume(vmfsUuid);
} catch (HostConfigFault e) {
throw new VMWareException(e);
} catch (RuntimeFault e) {
throw new VMWareException(e);
} catch (RemoteException e) {
throw new VMWareException(e);
}
}
use of com.vmware.vim25.RuntimeFault in project cloudstack by apache.
the class VmwareResource method fillHostInfo.
protected void fillHostInfo(StartupRoutingCommand cmd) {
VmwareContext serviceContext = getServiceContext();
Map<String, String> details = cmd.getHostDetails();
if (details == null) {
details = new HashMap<String, String>();
}
try {
fillHostHardwareInfo(serviceContext, cmd);
fillHostNetworkInfo(serviceContext, cmd);
fillHostDetailsInfo(serviceContext, details);
} catch (RuntimeFaultFaultMsg e) {
s_logger.error("RuntimeFault while retrieving host info: " + e.toString(), e);
throw new CloudRuntimeException("RuntimeFault while retrieving host info");
} catch (RemoteException e) {
s_logger.error("RemoteException while retrieving host info: " + e.toString(), e);
invalidateServiceContext();
throw new CloudRuntimeException("RemoteException while retrieving host info");
} catch (Exception e) {
s_logger.error("Exception while retrieving host info: " + e.toString(), e);
invalidateServiceContext();
throw new CloudRuntimeException("Exception while retrieving host info: " + e.toString());
}
cmd.setHostDetails(details);
cmd.setName(_url);
cmd.setGuid(_guid);
cmd.setDataCenter(_dcId);
cmd.setIqn(getIqn());
cmd.setPod(_pod);
cmd.setCluster(_cluster);
cmd.setVersion(VmwareResource.class.getPackage().getImplementationVersion());
}
Aggregations