Search in sources :

Example 1 with HostMountInfo

use of com.vmware.vim25.HostMountInfo in project cloudstack by apache.

the class DatastoreMO method isAccessibleToHost.

public boolean isAccessibleToHost(String hostValue) throws Exception {
    boolean isAccessible = true;
    List<DatastoreHostMount> hostMounts = getHostMounts();
    for (DatastoreHostMount hostMount : hostMounts) {
        String hostMountValue = hostMount.getKey().getValue();
        if (hostMountValue.equalsIgnoreCase(hostValue)) {
            HostMountInfo mountInfo = hostMount.getMountInfo();
            isAccessible = mountInfo.isAccessible();
            break;
        }
    }
    return isAccessible;
}
Also used : HostMountInfo(com.vmware.vim25.HostMountInfo) DatastoreHostMount(com.vmware.vim25.DatastoreHostMount)

Example 2 with HostMountInfo

use of com.vmware.vim25.HostMountInfo in project coprhd-controller by CoprHD.

the class VerifyDatastoreForRemoval method checkDatastoreAccessibility.

private void checkDatastoreAccessibility(DatastoreHostMount mount) {
    HostMountInfo mountInfo = mount.getMountInfo();
    if (mountInfo.getAccessible() == Boolean.FALSE) {
        HostSystem host = vcenter.lookupManagedEntity(mount.getKey());
        String hostName = host.getName();
        String reason = StringUtils.defaultIfBlank(mountInfo.getInaccessibleReason(), "unknown");
        logWarn("verify.datastore.removal.inaccessible", hostName, reason);
    }
}
Also used : HostMountInfo(com.vmware.vim25.HostMountInfo) HostSystem(com.vmware.vim25.mo.HostSystem)

Aggregations

HostMountInfo (com.vmware.vim25.HostMountInfo)2 DatastoreHostMount (com.vmware.vim25.DatastoreHostMount)1 HostSystem (com.vmware.vim25.mo.HostSystem)1