summaryrefslogtreecommitdiffstats
path: root/deploy/adapters
diff options
context:
space:
mode:
authorJustin chi <chigang@huawei.com>2015-11-10 08:49:08 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2015-11-10 08:49:08 +0000
commit228b9531aa8aecf486aadc24c0d68aaf5b6cd04b (patch)
tree1d5e3c3eab8fc80760e9378809f0f55cdfde27d2 /deploy/adapters
parente314a19fdb051f21908668b176e3950f640ccfe4 (diff)
parent1af586830a464edcac67e2c7bae601f38ada03d3 (diff)
Merge "when using loop files for cinder volumes, the file size must be 512-byte alignment"
Diffstat (limited to 'deploy/adapters')
-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