summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Glon <raphael.glon@ovh.net>2019-02-25 14:23:28 +0100
committerDmitry Tantsur <divius.inside@gmail.com>2019-04-15 11:54:11 +0000
commit01a7956c527b90c685a813d7060605990f55658a (patch)
tree610e50bc3cc8fb2f8360e7c56451fdf407f8770e
parentaaca6a270ba5d117d10f55682d262e21734a0795 (diff)
downloadironic-01a7956c527b90c685a813d7060605990f55658a.tar.gz
Ansible module: fix partition_configdrive.sh file
Images with GPT partition tables could not be deployed correctly The if condition could never be met due to an invalid syntax, leading to partitioning failure Change-Id: I11202b115f9b80e8c853dca36cc66ab0eb8f7dea Story: #2005357 Task: #30317 (cherry picked from commit 84741e94095e2a7c07ff880a17983e373c28eab0)
-rwxr-xr-xironic/drivers/modules/ansible/playbooks/roles/deploy/files/partition_configdrive.sh5
-rw-r--r--releasenotes/notes/bug-30317-a972c8d879c98941.yaml5
2 files changed, 8 insertions, 2 deletions
diff --git a/ironic/drivers/modules/ansible/playbooks/roles/deploy/files/partition_configdrive.sh b/ironic/drivers/modules/ansible/playbooks/roles/deploy/files/partition_configdrive.sh
index 056a8152c..a33ff22ee 100755
--- a/ironic/drivers/modules/ansible/playbooks/roles/deploy/files/partition_configdrive.sh
+++ b/ironic/drivers/modules/ansible/playbooks/roles/deploy/files/partition_configdrive.sh
@@ -54,8 +54,9 @@ partprobe $DEVICE || true
# Check for preexisting partition for configdrive
EXISTING_PARTITION=`/sbin/blkid -l -o device $DEVICE -t LABEL=config-2`
if [ -z $EXISTING_PARTITION ]; then
- # Check if it is GPT partition and needs to be re-sized
- if [ `partprobe $DEVICE print 2>&1 | grep "fix the GPT to use all of the space"` ]; then
+ # Check if it is GPT partition. Relocate the end table header to the end of
+ # disk (does not hurt if not needed anyway). Create the configdrive part
+ if parted -s $DEVICE print 2>&1 | grep -iq 'gpt'; then
log "Fixing GPT to use all of the space on device $DEVICE"
sgdisk -e $DEVICE || fail "move backup GPT data structures to the end of ${DEVICE}"
diff --git a/releasenotes/notes/bug-30317-a972c8d879c98941.yaml b/releasenotes/notes/bug-30317-a972c8d879c98941.yaml
new file mode 100644
index 000000000..793a5dc44
--- /dev/null
+++ b/releasenotes/notes/bug-30317-a972c8d879c98941.yaml
@@ -0,0 +1,5 @@
+---
+fixes:
+ - |
+ Fixes deployment with the ``ansible`` deploy interface and instance images with GPT partition
+ table.