use of com.vmware.vim25.HostMultipathInfoLogicalUnitPolicy 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.HostMultipathInfoLogicalUnitPolicy in project coprhd-controller by CoprHD.
the class HostStorageAPI method createMultipathPolicy.
/**
* Create a multipath policy based on the passed policy name
*
* @param name policy name
* @return multipath policy
*/
public HostMultipathInfoLogicalUnitPolicy createMultipathPolicy(String name) {
if (StringUtils.equalsIgnoreCase(name, VMW_PSP_FIXED)) {
HostMultipathInfoFixedLogicalUnitPolicy policy = new HostMultipathInfoFixedLogicalUnitPolicy();
policy.setPolicy(name);
policy.setPrefer("");
return policy;
} else {
HostMultipathInfoLogicalUnitPolicy policy = new HostMultipathInfoLogicalUnitPolicy();
policy.setPolicy(name);
return policy;
}
}
Aggregations