Class GenericISCSIPlugin

  • All Implemented Interfaces:
    com.abiquo.commons.plugin.Pluggable, Storage<Device>, Closeable, AutoCloseable

    @PluginMetadata(type="GENERIC_ISCSI",
                    friendlyName="generic iSCSI storage",
                    version="4.0.0",
                    supportedVersions="4.0.0")
    public class GenericISCSIPlugin
    extends Object
    implements Storage<Device>
    Simulates a Storage plugin to provide generic iSCSI storage functionallity.

    This plugin cannot not be used to create or manage volumes. It is only present to provide the common storage behavior for the generic iSCSI feature.

    Volumes will be manually created in the target storage pool and Abiquo will only assign them to the mock pool that is returned by the plugin.

    Author:
    Ignasi Barrera
    • Constructor Detail

      • GenericISCSIPlugin

        public GenericISCSIPlugin()
    • Method Detail

      • getConstraint

        public String getConstraint​(String key)
        Specified by:
        getConstraint in interface com.abiquo.commons.plugin.Pluggable
      • getPool

        public Pool getPool​(Device device,
                            String poolName)
                     throws com.abiquo.commons.plugin.exception.HypervisorPluginException
        Description copied from interface: Storage
        Get the information of the given pool.

        The storage pools are the containers for the volumes that will be created by Abiquo.

        Specified by:
        getPool in interface Storage<Device>
        Parameters:
        device - The storage device where to find the pool.
        poolName - The provider identifier of the pool where the volume is.
        Returns:
        The requested pool.
        Throws:
        com.abiquo.commons.plugin.exception.HypervisorPluginException - If the requested pool cannot be retrieved.
      • listPools

        public List<Pool> listPools​(Device device)
                             throws com.abiquo.commons.plugin.exception.HypervisorPluginException
        Description copied from interface: Storage
        Get all the pools defined in the given device.

        The storage pools are the containers for the volumes that will be created by Abiquo.

        Specified by:
        listPools in interface Storage<Device>
        Parameters:
        device - The storage device where to find the pools.
        Returns:
        The pools defined in the given device.
        Throws:
        com.abiquo.commons.plugin.exception.HypervisorPluginException - If the pools can not be enumerated.
      • createVolume

        @UnsupportedOperation
        public Volume createVolume​(Device device,
                                   String poolProviderId,
                                   Volume volume)
                            throws com.abiquo.commons.plugin.exception.HypervisorPluginException
        Description copied from interface: Storage
        Creates a new volume.

        Volumes are block devices that will be attached to the virtual machines.

        Specified by:
        createVolume in interface Storage<Device>
        Parameters:
        device - The device where the volumes will be created.
        poolProviderId - The provider identifier of the pool where the volume is.
        volume - The volume information.
        Returns:
        The information of the created volume.
        Throws:
        com.abiquo.commons.plugin.exception.HypervisorPluginException - If the volume cannot be created.
      • resizeVolume

        @UnsupportedOperation
        public Volume resizeVolume​(Device device,
                                   String poolProviderId,
                                   Volume volume)
                            throws com.abiquo.commons.plugin.exception.HypervisorPluginException
        Description copied from interface: Storage
        Updates an existing volume.

        Volumes are block devices that will be attached to the virtual machines.

        Specified by:
        resizeVolume in interface Storage<Device>
        Parameters:
        device - The device where the volumes is.
        poolProviderId - The provider identifier of the pool where the volume is.
        volume - The new volume information.
        Returns:
        The updated volume.
        Throws:
        com.abiquo.commons.plugin.exception.HypervisorPluginException - If the volume cannot be modified.
      • deleteVolume

        @UnsupportedOperation
        public void deleteVolume​(Device device,
                                 String poolProviderId,
                                 String uuid)
                          throws com.abiquo.commons.plugin.exception.HypervisorPluginException
        Description copied from interface: Storage
        Deletes the given volume.

        Volumes are block devices that will be attached to the virtual machines.

        Specified by:
        deleteVolume in interface Storage<Device>
        Parameters:
        device - The device where the volumes is.
        poolProviderId - The provider identifier of the pool where the volume is.
        uuid - The uuid of the volume to delete.
        Throws:
        com.abiquo.commons.plugin.exception.HypervisorPluginException - If the volume cannot be deleted.
      • listVolumes

        @UnsupportedOperation
        public List<Volume> listVolumes​(Device device,
                                        String poolProviderId)
                                 throws com.abiquo.commons.plugin.exception.HypervisorPluginException
        Description copied from interface: Storage
        Gets all the volumes in the given pool.

        Volumes are block devices that will be attached to the virtual machines.

        Specified by:
        listVolumes in interface Storage<Device>
        Parameters:
        device - The device where the volumes are.
        poolProviderId - The provider identifier of the pool where the volume is.
        Returns:
        The list of volumes in the pool.
        Throws:
        com.abiquo.commons.plugin.exception.HypervisorPluginException - If the volumes can not be enumerated.
      • listVolumesAllTiers

        @UnsupportedOperation
        public List<Volume> listVolumesAllTiers​(Device device)
                                         throws com.abiquo.commons.plugin.exception.HypervisorPluginException
        Description copied from interface: Storage
        Gets all the volumes from all tiers.

        Volumes are block devices that will be attached to the virtual machines.

        Specified by:
        listVolumesAllTiers in interface Storage<Device>
        Parameters:
        device - The device where the volumes are.
        Returns:
        The list of volumes in all the polls.
        Throws:
        com.abiquo.commons.plugin.exception.HypervisorPluginException - If the volumes can not be enumerated.
      • getVolume

        @UnsupportedOperation
        public Volume getVolume​(Device device,
                                String poolProviderId,
                                String uuid)
                         throws com.abiquo.commons.plugin.exception.HypervisorPluginException
        Description copied from interface: Storage
        Gets the information of the given volume.

        Volumes are block devices that will be attached to the virtual machines.

        Specified by:
        getVolume in interface Storage<Device>
        Parameters:
        device - The device where the volumes is.
        poolProviderId - The provider identifier of the pool where the volume is.
        uuid - The uuid of the volume to retrieve.
        Returns:
        The information of the given volume.
        Throws:
        com.abiquo.commons.plugin.exception.HypervisorPluginException - If the requested volume can not be retrieved.
      • grantAccess

        @UnsupportedOperation
        public Address grantAccess​(Device device,
                                   String poolProviderId,
                                   String volumeUuid,
                                   ClientDetails clientDetails)
                            throws com.abiquo.commons.plugin.exception.HypervisorPluginException
        Description copied from interface: Storage
        Allow the provided client to access the given volume.

        This method is used to grant access to the given client to the volume identified by the given UUID.

        Specified by:
        grantAccess in interface Storage<Device>
        Parameters:
        device - The device where the volumes is.
        poolProviderId - The provider identifier of the pool where the volume is.
        volumeUuid - The uuid of the volume.
        clientDetails - The details of the client accessing the volume.
        Returns:
        The address where the provided client initiator can reach the volume.
        Throws:
        com.abiquo.commons.plugin.exception.HypervisorPluginException - If the access to the volume cannot be granted.
      • revokeAccess

        @UnsupportedOperation
        public void revokeAccess​(Device device,
                                 String poolProviderId,
                                 String volumeUuid,
                                 ClientDetails clientDetails)
                          throws com.abiquo.commons.plugin.exception.HypervisorPluginException
        Description copied from interface: Storage
        Deny access for the provided client to the given volume.

        This method is used to revoke access for the given iSCSI client.

        Specified by:
        revokeAccess in interface Storage<Device>
        Parameters:
        device - The device where the volumes is.
        poolProviderId - The provider identifier of the pool where the volume is.
        volumeUuid - The uuid of the volume.
        clientDetails - The details of the client accessing the volume.
        Throws:
        com.abiquo.commons.plugin.exception.HypervisorPluginException - If the access to the volume cannot be granted.