Search in sources :

Example 1 with HostVmfsVolume

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

the class CreateVmfsDatastore method tryExecute.

@Override
protected Datastore tryExecute() {
    Datastore datastore = hostStorageAPI.createVmfsDatastore(disk, datastoreName);
    HostVmfsVolume vmfs = VMwareUtils.getHostVmfsVolume(datastore);
    if (vmfs != null) {
        logInfo("create.vmfs.datastore", datastore.getName(), vmfs.getVersion());
    }
    return datastore;
}
Also used : Datastore(com.vmware.vim25.mo.Datastore) HostVmfsVolume(com.vmware.vim25.HostVmfsVolume)

Example 2 with HostVmfsVolume

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

the class ExpandVmfsDatastore method expandVmfsDatastore.

protected void expandVmfsDatastore() {
    HostVmfsVolume vmfs = VMwareUtils.getHostVmfsVolume(datastore);
    if (vmfs != null) {
        logInfo("expand.vmfs.datastore", vmfs.getVersion());
    }
    hostStorageAPI.expandVmfsDatastore(disk, datastore);
}
Also used : HostVmfsVolume(com.vmware.vim25.HostVmfsVolume)

Example 3 with HostVmfsVolume

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

the class ExtendVmfsDatastore method extendVmfsDatastore.

protected void extendVmfsDatastore() {
    HostVmfsVolume vmfs = VMwareUtils.getHostVmfsVolume(datastore);
    if (vmfs != null) {
        logInfo("extend.vmfs.datastore", vmfs.getVersion());
    }
    hostStorageAPI.extendVmfsDatastore(disk, datastore);
}
Also used : HostVmfsVolume(com.vmware.vim25.HostVmfsVolume)

Example 4 with HostVmfsVolume

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

the class MountDatastore method tryExecute.

@Override
protected Void tryExecute() {
    final String dataStoreName = datastore.getName();
    for (HostFileSystemMountInfo mount : new HostStorageAPI(host).getStorageSystem().getFileSystemVolumeInfo().getMountInfo()) {
        if (mount != null) {
            HostFileSystemVolume mountVolume = mount.getVolume();
            if (mountVolume == null) {
                warn("No volume attached to mount : " + mount.getMountInfo().getPath());
                continue;
            }
            if (mount.getVolume() != null && mount.getVolume() instanceof HostVmfsVolume && dataStoreName.equals(mount.getVolume().getName())) {
                HostVmfsVolume volume = (HostVmfsVolume) mountVolume;
                String vmfsUuid = volume.getUuid();
                info("Mounting volume : " + vmfsUuid);
                try {
                    new HostStorageAPI(host).getStorageSystem().mountVmfsVolume(vmfsUuid);
                } catch (RemoteException e) {
                    throw new VMWareException(e);
                }
            }
        }
    }
    return null;
}
Also used : HostVmfsVolume(com.vmware.vim25.HostVmfsVolume) HostFileSystemVolume(com.vmware.vim25.HostFileSystemVolume) RemoteException(java.rmi.RemoteException) HostStorageAPI(com.iwave.ext.vmware.HostStorageAPI) HostFileSystemMountInfo(com.vmware.vim25.HostFileSystemMountInfo) VMWareException(com.iwave.ext.vmware.VMWareException)

Example 5 with HostVmfsVolume

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

the class UnmountVmfsDatastore method tryExecute.

@Override
protected Void tryExecute() {
    final String dataStoreName = datastore.getName();
    for (HostFileSystemMountInfo mount : new HostStorageAPI(host).getStorageSystem().getFileSystemVolumeInfo().getMountInfo()) {
        HostFileSystemVolume mountVolume = mount.getVolume();
        if (mountVolume == null) {
            warn("No volume attached to mount : " + mount.getMountInfo().getPath());
            continue;
        }
        if (mount.getVolume() instanceof HostVmfsVolume && dataStoreName.equals(mount.getVolume().getName())) {
            HostVmfsVolume volume = (HostVmfsVolume) mountVolume;
            String vmfsUuid = volume.getUuid();
            info("Unmounting volume : " + vmfsUuid);
            try {
                new HostStorageAPI(host).getStorageSystem().unmountVmfsVolume(vmfsUuid);
            } catch (RemoteException e) {
                throw new VMWareException(e);
            }
        }
    }
    return null;
}
Also used : HostVmfsVolume(com.vmware.vim25.HostVmfsVolume) HostFileSystemVolume(com.vmware.vim25.HostFileSystemVolume) RemoteException(java.rmi.RemoteException) HostStorageAPI(com.iwave.ext.vmware.HostStorageAPI) HostFileSystemMountInfo(com.vmware.vim25.HostFileSystemMountInfo) VMWareException(com.iwave.ext.vmware.VMWareException)

Aggregations

HostVmfsVolume (com.vmware.vim25.HostVmfsVolume)8 HostStorageAPI (com.iwave.ext.vmware.HostStorageAPI)2 VMWareException (com.iwave.ext.vmware.VMWareException)2 HostFileSystemMountInfo (com.vmware.vim25.HostFileSystemMountInfo)2 HostFileSystemVolume (com.vmware.vim25.HostFileSystemVolume)2 HostScsiDiskPartition (com.vmware.vim25.HostScsiDiskPartition)2 RemoteException (java.rmi.RemoteException)2 InvalidArgumentFaultMsg (com.vmware.pbm.InvalidArgumentFaultMsg)1 PbmFaultFaultMsg (com.vmware.pbm.PbmFaultFaultMsg)1 PbmProfile (com.vmware.pbm.PbmProfile)1 PbmProfileId (com.vmware.pbm.PbmProfileId)1 PbmProfileResourceType (com.vmware.pbm.PbmProfileResourceType)1 PbmProfileResourceTypeEnum (com.vmware.pbm.PbmProfileResourceTypeEnum)1 VimNames (com.vmware.photon.controller.model.adapters.vsphere.util.VimNames)1 VimPath (com.vmware.photon.controller.model.adapters.vsphere.util.VimPath)1 BaseHelper (com.vmware.photon.controller.model.adapters.vsphere.util.connection.BaseHelper)1 Connection (com.vmware.photon.controller.model.adapters.vsphere.util.connection.Connection)1 GetMoRef (com.vmware.photon.controller.model.adapters.vsphere.util.connection.GetMoRef)1 Finder (com.vmware.photon.controller.model.adapters.vsphere.util.finders.Finder)1 FinderException (com.vmware.photon.controller.model.adapters.vsphere.util.finders.FinderException)1