Search in sources :

Example 1 with HostMultipathInfoLogicalUnitPolicy

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);
    }
}
Also used : HostStorageSystem(com.vmware.vim25.mo.HostStorageSystem) HostMultipathInfoLogicalUnitPolicy(com.vmware.vim25.HostMultipathInfoLogicalUnitPolicy) RuntimeFault(com.vmware.vim25.RuntimeFault) RemoteException(java.rmi.RemoteException) HostConfigFault(com.vmware.vim25.HostConfigFault) NotFound(com.vmware.vim25.NotFound)

Example 2 with HostMultipathInfoLogicalUnitPolicy

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;
    }
}
Also used : HostMultipathInfoLogicalUnitPolicy(com.vmware.vim25.HostMultipathInfoLogicalUnitPolicy) HostMultipathInfoFixedLogicalUnitPolicy(com.vmware.vim25.HostMultipathInfoFixedLogicalUnitPolicy)

Aggregations

HostMultipathInfoLogicalUnitPolicy (com.vmware.vim25.HostMultipathInfoLogicalUnitPolicy)2 HostConfigFault (com.vmware.vim25.HostConfigFault)1 HostMultipathInfoFixedLogicalUnitPolicy (com.vmware.vim25.HostMultipathInfoFixedLogicalUnitPolicy)1 NotFound (com.vmware.vim25.NotFound)1 RuntimeFault (com.vmware.vim25.RuntimeFault)1 HostStorageSystem (com.vmware.vim25.mo.HostStorageSystem)1 RemoteException (java.rmi.RemoteException)1