summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJianghua Wang <jianghua.wang@citrix.com>2016-04-10 20:10:28 -0700
committerJianghua Wang <jianghua.wang@citrix.com>2016-04-10 20:17:03 -0700
commitc30bc7f8db2b98e41e6414a6c1abdc6be9de9e54 (patch)
treeaded8f9877ec28ded774cd936c020580fb7b7bf8
parent2556778917b31ffdff2b26e5e9bb2102c8dd77a7 (diff)
plugin-xenserver: Apply patch to speed up writing config drive
This is to apply a patch to address the following problem: bug: #1567857 When writing config drive, dd by default uses 512B as the block size. It costs more than 3mins to write the 64M config drive. It's longer than expected: Some health checking(fuel's heat checking) on XenServer may failed due to timeout. So we need improve the performance via specifying a bigger block size with dd. Change-Id: I97e121800567efbce66ce1de8f8cbf9c788d12e5
Notes
Notes (review): Code-Review+1: John Hua <john.hua@citrix.com> Code-Review+1: huan <huan.xie@citrix.com> Code-Review+2: Bob Ball <bob.ball@citrix.com> Workflow+1: Bob Ball <bob.ball@citrix.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Mon, 11 Apr 2016 08:21:36 +0000 Reviewed-on: https://review.openstack.org/303887 Project: openstack/fuel-plugin-xenserver Branch: refs/heads/master
-rwxr-xr-xdeployment_scripts/compute_post_deployment.py3
-rw-r--r--deployment_scripts/patchset/speed-up-writing-config-drive.patch41
2 files changed, 43 insertions, 1 deletions
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():
382 patchfile_list = ['%s/patchset/vif-plug.patch' % patchset_dir, 382 patchfile_list = ['%s/patchset/vif-plug.patch' % patchset_dir,
383 '%s/patchset/nova-neutron-race-condition.patch' % patchset_dir, 383 '%s/patchset/nova-neutron-race-condition.patch' % patchset_dir,
384 '%s/patchset/ovs-interim-bridge.patch' % patchset_dir, 384 '%s/patchset/ovs-interim-bridge.patch' % patchset_dir,
385 '%s/patchset/neutron-security-group.patch' % patchset_dir] 385 '%s/patchset/neutron-security-group.patch' % patchset_dir,
386 '%s/patchset/speed-up-writing-config-drive.patch' % patchset_dir]
386 for patch_file in patchfile_list: 387 for patch_file in patchfile_list:
387 execute('patch', '-d', DIST_PACKAGES_DIR, '-p1', '-i', patch_file) 388 execute('patch', '-d', DIST_PACKAGES_DIR, '-p1', '-i', patch_file)
388 389
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 @@
1diff --git a/nova/tests/unit/virt/xenapi/test_vm_utils.py b/nova/tests/unit/virt/xenapi/test_vm_utils.py
2index e15cc53..a777fcc 100644
3--- a/nova/tests/unit/virt/xenapi/test_vm_utils.py
4+++ b/nova/tests/unit/virt/xenapi/test_vm_utils.py
5@@ -189,7 +189,7 @@ class GenerateConfigDriveTestCase(VMUtilsTestBase):
6 '-publisher', mox.IgnoreArg(), '-quiet',
7 '-J', '-r', '-V', 'config-2', mox.IgnoreArg(),
8 attempts=1, run_as_root=False).AndReturn(None)
9- utils.execute('dd', mox.IgnoreArg(), mox.IgnoreArg(),
10+ utils.execute('dd', mox.IgnoreArg(), mox.IgnoreArg(), mox.IgnoreArg(),
11 mox.IgnoreArg(), run_as_root=True).AndReturn(None)
12
13 self.mox.StubOutWithMock(vm_utils, 'create_vbd')
14diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
15index c8fdc52..9bbf173 100644
16--- a/nova/virt/xenapi/vm_utils.py
17+++ b/nova/virt/xenapi/vm_utils.py
18@@ -138,6 +138,7 @@ MBR_SIZE_BYTES = MBR_SIZE_SECTORS * SECTOR_SIZE
19 KERNEL_DIR = '/boot/guest'
20 MAX_VDI_CHAIN_SIZE = 16
21 PROGRESS_INTERVAL_SECONDS = 300
22+DD_BLOCKSIZE = 65536
23
24 # Fudge factor to allow for the VHD chain to be slightly larger than
25 # the partitioned space. Otherwise, legitimate images near their
26@@ -1162,6 +1163,7 @@ def generate_configdrive(session, instance, vm_ref, userdevice,
27 utils.execute('dd',
28 'if=%s' % tmp_file,
29 'of=%s' % dev_path,
30+ 'bs=%d' % DD_BLOCKSIZE,
31 'oflag=direct,sync',
32 run_as_root=True)
33
34@@ -2429,6 +2431,7 @@ def _copy_partition(session, src_ref, dst_ref, partition, virtual_size):
35 utils.execute('dd',
36 'if=%s' % src_path,
37 'of=%s' % dst_path,
38+ 'bs=%d' % DD_BLOCKSIZE,
39 'count=%d' % num_blocks,
40 'iflag=direct,sync',
41 'oflag=direct,sync',