示例#1
0
    def storage_setup(self, instance, root_path, ephemeral_path,
                      block_device_info):
        for system_bus in (constants.SYSTEM_BUS_SATA,
                           constants.SYSTEM_BUS_SCSI):
            vmutils.set_storage_controller(instance, system_bus)

        port = 0
        for disk_path in (root_path, ephemeral_path):
            if disk_path:
                self._volume.attach_storage(
                    instance=instance, port=port, device=0,
                    controller=constants.SYSTEM_BUS_SATA.upper(),
                    drive_type=constants.STORAGE_HDD, medium=disk_path
                )
                port = port + 1

        self._volume.attach_volumes(instance, block_device_info,
                                    ebs_root=root_path is None)
示例#2
0
    def storage_setup(self, instance, root_path, ephemeral_path,
                      block_device_info):
        for system_bus in (constants.SYSTEM_BUS_SATA,
                           constants.SYSTEM_BUS_SCSI):
            vmutils.set_storage_controller(instance, system_bus)

        port = 0
        for disk_path in (root_path, ephemeral_path):
            if disk_path:
                self._volume.attach_storage(
                    instance=instance,
                    port=port,
                    device=0,
                    controller=constants.SYSTEM_BUS_SATA.upper(),
                    drive_type=constants.STORAGE_HDD,
                    medium=disk_path)
                port = port + 1

        self._volume.attach_volumes(instance,
                                    block_device_info,
                                    ebs_root=root_path is None)
    def test_set_storage_controller(self, mock_storage_ctl):
        vmutils.set_storage_controller(self._instance,
                                       constants.SYSTEM_BUS_SCSI)
        vmutils.set_storage_controller(self._instance,
                                       constants.SYSTEM_BUS_SATA)
        vmutils.set_storage_controller(self._instance,
                                       constants.SYSTEM_BUS_IDE)

        mock_storage_ctl.assert_has_calls([
            mock.call(
                self._instance, constants.DEFAULT_SCSI_CNAME,
                constants.SYSTEM_BUS_SCSI, constants.DEFAULT_SCSI_CONTROLLER),
            mock.call(
                self._instance, constants.DEFAULT_SATA_CNAME,
                constants.SYSTEM_BUS_SATA, constants.DEFAULT_SATA_CONTROLLER),
            mock.call(
                self._instance, constants.DEFAULT_IDE_CNAME,
                constants.SYSTEM_BUS_IDE, constants.DEFAULT_IDE_CONTROLLER),
        ])
示例#4
0
    def test_set_storage_controller(self, mock_storage_ctl):
        vmutils.set_storage_controller(self._instance,
                                       constants.SYSTEM_BUS_SCSI)
        vmutils.set_storage_controller(self._instance,
                                       constants.SYSTEM_BUS_SATA)
        vmutils.set_storage_controller(self._instance,
                                       constants.SYSTEM_BUS_IDE)

        mock_storage_ctl.assert_has_calls([
            mock.call(self._instance, constants.DEFAULT_SCSI_CNAME,
                      constants.SYSTEM_BUS_SCSI,
                      constants.DEFAULT_SCSI_CONTROLLER),
            mock.call(self._instance, constants.DEFAULT_SATA_CNAME,
                      constants.SYSTEM_BUS_SATA,
                      constants.DEFAULT_SATA_CONTROLLER),
            mock.call(self._instance, constants.DEFAULT_IDE_CNAME,
                      constants.SYSTEM_BUS_IDE,
                      constants.DEFAULT_IDE_CONTROLLER),
        ])