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;
}
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);
}
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);
}
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;
}
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;
}
Aggregations