Exemplo n.º 1
0
    def setUp(self):
        super(TestImageCache, self).setUp()
        self.mock_vg = mock.MagicMock(virtual_disks=[])
        # Initialize the ImageManager
        self.adpt = mock.MagicMock()
        self.vg_uuid = 'vg_uuid'
        self.vios_uuid = 'vios_uuid'
        self.img_cache = imagecache.ImageManager(self.vios_uuid, self.vg_uuid,
                                                 self.adpt)

        # Setup virtual_disks to be used later
        self.inst1 = pvm_stor.VDisk.bld(None, 'b_inst1', 10)
        self.inst2 = pvm_stor.VDisk.bld(None, 'b_inst2', 10)
        self.image = pvm_stor.VDisk.bld(None, 'i_bf8446e4_4f52', 10)
Exemplo n.º 2
0
    def __init__(self, adapter, host_uuid):
        super(LocalStorage, self).__init__(adapter, host_uuid)

        # Query to get the Volume Group UUID
        if not CONF.powervm.volume_group_name:
            raise npvmex.OptRequiredIfOtherOptValue(
                if_opt='disk_driver', if_value='localdisk',
                then_opt='volume_group_name')
        self.vg_name = CONF.powervm.volume_group_name
        self._vios_uuid, self.vg_uuid = tsk_stg.find_vg(self.vg_name)
        self.image_cache_mgr = imagecache.ImageManager(self._vios_uuid,
                                                       self.vg_uuid, adapter)
        self.cache_lock = lockutils.ReaderWriterLock()
        LOG.info(_LI("Local Storage driver initialized: volume group: '%s'"),
                 self.vg_name)
Exemplo n.º 3
0
    def __init__(self, adapter, host_uuid):
        super(LocalStorage, self).__init__(adapter, host_uuid)

        # Query to get the Volume Group UUID
        if not CONF.powervm.volume_group_name:
            raise npvmex.OptRequiredIfOtherOptValue(
                if_opt='disk_driver',
                if_value='localdisk',
                then_opt='volume_group_name')
        self.vg_name = CONF.powervm.volume_group_name
        vios_w, vg_w = tsk_stg.find_vg(adapter, self.vg_name)
        self._vios_uuid = vios_w.uuid
        self.vg_uuid = vg_w.uuid
        self.image_cache_mgr = imagecache.ImageManager(self._vios_uuid,
                                                       self.vg_uuid, adapter)
        self.cache_lock = lockutils.ReaderWriterLock()
        # Set the 'snapshot' capability dynamically.  If we're hosting I/O on
        # the management partition, we can snapshot.  If we're hosting I/O on
        # traditional VIOS, we are limited by the fact that a VSCSI device
        # can't be mapped to two partitions (the VIOS and the management) at
        # once.
        self.capabilities['snapshot'] = self.mp_uuid == self._vios_uuid
        LOG.info("Local Storage driver initialized: volume group: '%s'",
                 self.vg_name)