From b86a9480c3c39f357b862c6a57ca6a2eb092558c Mon Sep 17 00:00:00 2001 From: Taylor Jakobson Date: Mon, 14 May 2018 15:53:40 -0500 Subject: [PATCH] Use the new loop backstore type for fileio Use the new loop backstore type when mapping fileio volumes. The compute node will mount the file as a loop device and map that to the VM. This is to increase performance. Change-Id: Ic75890265aa033e906bc038dabc55cf36cfc547e --- nova_powervm/tests/virt/powervm/volume/test_fileio.py | 4 ++-- nova_powervm/virt/powervm/volume/fileio.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nova_powervm/tests/virt/powervm/volume/test_fileio.py b/nova_powervm/tests/virt/powervm/volume/test_fileio.py index d12fd17c..43279954 100644 --- a/nova_powervm/tests/virt/powervm/volume/test_fileio.py +++ b/nova_powervm/tests/virt/powervm/volume/test_fileio.py @@ -98,7 +98,7 @@ class TestFileIOVolumeAdapter(test_vol.TestVolumeAdapter): # Validate mock_file_bld.assert_called_once_with( self.adpt, 'fake_path', - backstore_type=pvm_stg.BackStoreType.FILE_IO, tag='a_vol_id') + backstore_type=pvm_stg.BackStoreType.LOOP, tag='a_vol_id') self.assertEqual(1, mock_build_map.call_count) self.assertEqual(1, mock_udid_to_map.call_count) @@ -130,7 +130,7 @@ class TestFileIOVolumeAdapter(test_vol.TestVolumeAdapter): # Validate mock_file_bld.assert_called_once_with( self.adpt, 'fake_path', - backstore_type=pvm_stg.BackStoreType.FILE_IO, tag='a_vol_id') + backstore_type=pvm_stg.BackStoreType.LOOP, tag='a_vol_id') self.assertEqual(0, mock_build_map.call_count) @mock.patch('pypowervm.tasks.partition.get_mgmt_partition', autospec=True) diff --git a/nova_powervm/virt/powervm/volume/fileio.py b/nova_powervm/virt/powervm/volume/fileio.py index b462ea11..2c31fc1f 100644 --- a/nova_powervm/virt/powervm/volume/fileio.py +++ b/nova_powervm/virt/powervm/volume/fileio.py @@ -97,7 +97,7 @@ class FileIOVolumeAdapter(v_driver.PowerVMVolumeAdapter): volid = self.connection_info['data']['volume_id'] fio = pvm_stg.FileIO.bld( self.adapter, path, - backstore_type=pvm_stg.BackStoreType.FILE_IO, tag=volid) + backstore_type=pvm_stg.BackStoreType.LOOP, tag=volid) def add_func(vios_w): # If the vios doesn't match, just return