summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible
diff options
context:
space:
mode:
authorcarey.xu <carey.xuhan@huawei.com>2015-11-10 12:35:26 +0800
committercarey.xu <carey.xuhan@huawei.com>2015-11-10 12:35:26 +0800
commit1af586830a464edcac67e2c7bae601f38ada03d3 (patch)
tree9bed81ae2e3f898280d0069f59bc198d341b15d8 /deploy/adapters/ansible
parent2709a9bee6a562cc6acef75b394d7c4e9a3b3f3f (diff)
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 <carey.xuhan@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible')
-rw-r--r--deploy/adapters/ansible/roles/cinder-volume/files/create_img.sh2
-rw-r--r--deploy/adapters/ansible/roles/cinder-volume/files/get_var_size.sh2
2 files changed, 2 insertions, 2 deletions
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