use of com.iwave.ext.vmware.HostStorageAPI in project coprhd-controller by CoprHD.
the class AddInternetScsiTargets method execute.
@Override
public void execute() throws Exception {
HostStorageAPI hostStorageAPI = new HostStorageAPI(host);
for (String iqn : hbas.keySet()) {
HostHostBusAdapter hba = hbas.get(iqn);
if (hba instanceof HostInternetScsiHba) {
debug("Adding iSCSI send targets %s for HBA %s [%s]", StringUtils.join(addresses, ", "), hba.getDevice(), iqn);
hostStorageAPI.addInternetScsiSendTargets((HostInternetScsiHba) hba, addresses);
}
}
hostStorageAPI.rescanHBAs();
}
use of com.iwave.ext.vmware.HostStorageAPI in project coprhd-controller by CoprHD.
the class FindHostScsiDiskForLun method attachDisk.
/**
* Attaches the scsi disk to the host
*
* @param disk the scsi disk to attach
*/
private void attachDisk(HostScsiDisk disk) {
logInfo("find.host.scsi.lun.esx.attach", lunDiskName, host.getName());
new HostStorageAPI(host).attachScsiLun(disk);
}
use of com.iwave.ext.vmware.HostStorageAPI in project coprhd-controller by CoprHD.
the class FindHostScsiDiskForLun method rescan.
private void rescan() {
pause(FIND_DISK_DELAY);
logInfo("find.host.scsi.lun.esx.rescan", host.getName());
new HostStorageAPI(host).rescanHBAs();
}
use of com.iwave.ext.vmware.HostStorageAPI 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.iwave.ext.vmware.HostStorageAPI in project coprhd-controller by CoprHD.
the class RefreshESXHosts method execute.
@Override
public void execute() throws Exception {
for (String hostName : hostNames) {
HostSystem host = vcenter.findHostSystem(datacenter, hostName);
if (host == null) {
throw stateException("RefreshESXHosts.illegalState.esxNotFound", hostName, datacenter);
}
debug("Refreshing storage on %s [%s]", hostName, datacenter);
HostStorageAPI hostStorageAPI = new HostStorageAPI(host);
hostStorageAPI.refreshStorage();
}
}
Aggregations