From 1af586830a464edcac67e2c7bae601f38ada03d3 Mon Sep 17 00:00:00 2001 From: "carey.xu" Date: Tue, 10 Nov 2015 12:35:26 +0800 Subject: when using loop files for cinder volumes, the file size must be 512-byte alignment JIRA: COMPASS-145 Change-Id: I7aa08eba8856e5ada65a6a71d5a10452cac564c3 Signed-off-by: carey.xu --- deploy/adapters/ansible/roles/cinder-volume/files/create_img.sh | 2 +- deploy/adapters/ansible/roles/cinder-volume/files/get_var_size.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'deploy/adapters/ansible/roles/cinder-volume') diff --git a/deploy/adapters/ansible/roles/cinder-volume/files/create_img.sh b/deploy/adapters/ansible/roles/cinder-volume/files/create_img.sh index b69db0ed..2e734188 100644 --- a/deploy/adapters/ansible/roles/cinder-volume/files/create_img.sh +++ b/deploy/adapters/ansible/roles/cinder-volume/files/create_img.sh @@ -1,3 +1,3 @@ if [[ ! -f /var/cinder.img ]]; then - dd if=/dev/zero of=/var/cinder.img bs=1 count=1 seek=$1 + dd if=/dev/zero of=/var/cinder.img bs=1 count=0 seek=$1 fi diff --git a/deploy/adapters/ansible/roles/cinder-volume/files/get_var_size.sh b/deploy/adapters/ansible/roles/cinder-volume/files/get_var_size.sh index 9670da12..55041c6e 100644 --- a/deploy/adapters/ansible/roles/cinder-volume/files/get_var_size.sh +++ b/deploy/adapters/ansible/roles/cinder-volume/files/get_var_size.sh @@ -2,5 +2,5 @@ size=`df /var | awk '$3 ~ /[0-9]+/ { print $4 }'`; if [[ $size -gt 2000000000 ]]; then echo -n 2000000000000; else - echo -n $((size * 1000)); + echo -n $((size * 1000 / 512 * 512)); fi -- cgit 1.2.3-korg