Search in sources :

Example 6 with HostStorageAPI

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();
}
Also used : HostInternetScsiHba(com.vmware.vim25.HostInternetScsiHba) HostStorageAPI(com.iwave.ext.vmware.HostStorageAPI) HostHostBusAdapter(com.vmware.vim25.HostHostBusAdapter)

Example 7 with HostStorageAPI

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);
}
Also used : HostStorageAPI(com.iwave.ext.vmware.HostStorageAPI)

Example 8 with HostStorageAPI

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();
}
Also used : HostStorageAPI(com.iwave.ext.vmware.HostStorageAPI)

Example 9 with HostStorageAPI

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;
}
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 10 with HostStorageAPI

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();
    }
}
Also used : HostSystem(com.vmware.vim25.mo.HostSystem) HostStorageAPI(com.iwave.ext.vmware.HostStorageAPI)

Aggregations

HostStorageAPI (com.iwave.ext.vmware.HostStorageAPI)16 HostSystem (com.vmware.vim25.mo.HostSystem)8 HostScsiDisk (com.vmware.vim25.HostScsiDisk)5 RemoteException (java.rmi.RemoteException)5 Vcenter (com.emc.storageos.db.client.model.Vcenter)4 VcenterDataCenter (com.emc.storageos.db.client.model.VcenterDataCenter)4 VCenterAPI (com.iwave.ext.vmware.VCenterAPI)4 ComputeSystemControllerException (com.emc.storageos.computesystemcontroller.exceptions.ComputeSystemControllerException)3 CoordinatorException (com.emc.storageos.coordinator.exceptions.CoordinatorException)3 Host (com.emc.storageos.db.client.model.Host)3 ClientControllerException (com.emc.storageos.exceptions.ClientControllerException)3 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)3 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)3 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)3 ControllerException (com.emc.storageos.volumecontroller.ControllerException)3 WorkflowException (com.emc.storageos.workflow.WorkflowException)3 Datastore (com.vmware.vim25.mo.Datastore)3 BlockObject (com.emc.storageos.db.client.model.BlockObject)2 ExportGroup (com.emc.storageos.db.client.model.ExportGroup)2 VMWareException (com.iwave.ext.vmware.VMWareException)2