Пример #1
0
        "logical_free": 103364427776,
        "total_capacity": 516822138880,
        "used_capacity": 413457711104,
        "max_resource_logical_free": 103364427776,
        "max_resource_free_size_for_provisioning": 103364427776,
        "num_volumes": 2,
        "has_admin": True,
        "qos_max_iops": 0,
        "qos_max_mbps": 0
    },
]

FAKE_VOL_WWN = 'YYYYY'
FAKE_VOL_ID = 1
FAKE_VOL_NAME = 'NAME'
FAKE_VOL_CAPACITY = int(MiB(100).to_Byte().value)
FAKE_VOLUME_LIST = [
    {
        "scsi_identifier": FAKE_VOL_WWN,
        "array_type": "2810XIV",
        "array": "9835-415-6013800",
        "array_name": "a9000",
        "id": "6001738CFC9035E80000000000013489",
        "pool_name": "s1pool1",
        "pool_id": "6c6118900031",
        "max_extendable_size": 17397972992,
        "service_compliance": "True",
        "domain_name": "roei_domain",
        "service_name": "s1",
        "container_name": "Default_Space",
        "service_id": "145d5b94-d573-45da-abac-6d625cc6970d",
Пример #2
0
from twisted.python.filepath import FilePath
from twisted.python.components import proxyForInterface

from .blockdevice import (
    BlockDeviceVolume,
    IBlockDeviceAPI,
    UnknownInstanceID,
    AlreadyAttachedVolume,
    UnattachedVolume,
    allocated_size,
    get_blockdevice_volume,
)
from ...common.process import run_process

LOOPBACK_ALLOCATION_UNIT = int(MiB(1).to_Byte().value)
# Enough space for the ext4 journal:
LOOPBACK_MINIMUM_ALLOCATABLE_SIZE = int(MiB(16).to_Byte().value)


def _blockdevicevolume_from_dataset_id(dataset_id, size, attached_to=None):
    """
    Create a new ``BlockDeviceVolume`` with a ``blockdevice_id`` derived
    from the given ``dataset_id``.

    This is for convenience of implementation of the loopback backend (to
    avoid needing a separate data store for mapping dataset ids to block
    device ids and back again).

    Parameters accepted have the same meaning as the attributes of
    ``BlockDeviceVolume``.