diff --git a/deployment_scripts/compute_post_deployment.py b/deployment_scripts/compute_post_deployment.py index e69e19e..f290f63 100755 --- a/deployment_scripts/compute_post_deployment.py +++ b/deployment_scripts/compute_post_deployment.py @@ -382,7 +382,8 @@ def patch_compute_xenapi(): patchfile_list = ['%s/patchset/vif-plug.patch' % patchset_dir, '%s/patchset/nova-neutron-race-condition.patch' % patchset_dir, '%s/patchset/ovs-interim-bridge.patch' % patchset_dir, - '%s/patchset/neutron-security-group.patch' % patchset_dir] + '%s/patchset/neutron-security-group.patch' % patchset_dir, + '%s/patchset/speed-up-writing-config-drive.patch' % patchset_dir] for patch_file in patchfile_list: execute('patch', '-d', DIST_PACKAGES_DIR, '-p1', '-i', patch_file) diff --git a/deployment_scripts/patchset/speed-up-writing-config-drive.patch b/deployment_scripts/patchset/speed-up-writing-config-drive.patch new file mode 100644 index 0000000..539582d --- /dev/null +++ b/deployment_scripts/patchset/speed-up-writing-config-drive.patch @@ -0,0 +1,41 @@ +diff --git a/nova/tests/unit/virt/xenapi/test_vm_utils.py b/nova/tests/unit/virt/xenapi/test_vm_utils.py +index e15cc53..a777fcc 100644 +--- a/nova/tests/unit/virt/xenapi/test_vm_utils.py ++++ b/nova/tests/unit/virt/xenapi/test_vm_utils.py +@@ -189,7 +189,7 @@ class GenerateConfigDriveTestCase(VMUtilsTestBase): + '-publisher', mox.IgnoreArg(), '-quiet', + '-J', '-r', '-V', 'config-2', mox.IgnoreArg(), + attempts=1, run_as_root=False).AndReturn(None) +- utils.execute('dd', mox.IgnoreArg(), mox.IgnoreArg(), ++ utils.execute('dd', mox.IgnoreArg(), mox.IgnoreArg(), mox.IgnoreArg(), + mox.IgnoreArg(), run_as_root=True).AndReturn(None) + + self.mox.StubOutWithMock(vm_utils, 'create_vbd') +diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py +index c8fdc52..9bbf173 100644 +--- a/nova/virt/xenapi/vm_utils.py ++++ b/nova/virt/xenapi/vm_utils.py +@@ -138,6 +138,7 @@ MBR_SIZE_BYTES = MBR_SIZE_SECTORS * SECTOR_SIZE + KERNEL_DIR = '/boot/guest' + MAX_VDI_CHAIN_SIZE = 16 + PROGRESS_INTERVAL_SECONDS = 300 ++DD_BLOCKSIZE = 65536 + + # Fudge factor to allow for the VHD chain to be slightly larger than + # the partitioned space. Otherwise, legitimate images near their +@@ -1162,6 +1163,7 @@ def generate_configdrive(session, instance, vm_ref, userdevice, + utils.execute('dd', + 'if=%s' % tmp_file, + 'of=%s' % dev_path, ++ 'bs=%d' % DD_BLOCKSIZE, + 'oflag=direct,sync', + run_as_root=True) + +@@ -2429,6 +2431,7 @@ def _copy_partition(session, src_ref, dst_ref, partition, virtual_size): + utils.execute('dd', + 'if=%s' % src_path, + 'of=%s' % dst_path, ++ 'bs=%d' % DD_BLOCKSIZE, + 'count=%d' % num_blocks, + 'iflag=direct,sync', + 'oflag=direct,sync',