summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2019-07-12 10:26:28 +0000
committerGerrit Code Review <review@openstack.org>2019-07-12 10:26:28 +0000
commitf51729509207e81bee07a8e41ad740b15f78da4f (patch)
treeb639b88945f342d60bef1b0283ea99a91d8cd3ee
parent65a63c5fd89a3eec4ad6de9b9fa9efb528ca2f1d (diff)
parent704bf8f18f504796b4e10fd84246f42816961721 (diff)
downloadironic-f51729509207e81bee07a8e41ad740b15f78da4f.tar.gz
Merge "Ansible module: fix configdrive partition creation step" into stable/queens
-rwxr-xr-xironic/drivers/modules/ansible/playbooks/roles/deploy/files/partition_configdrive.sh24
-rw-r--r--releasenotes/notes/bug-2005764-15f45e11b9f9c96d.yaml8
2 files changed, 16 insertions, 16 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 a33ff22ee..24ae8e8ba 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
@@ -60,23 +60,15 @@ if [ -z $EXISTING_PARTITION ]; 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}"
- # Need to create new partition for config drive
- # Not all images have partion numbers in a sequential numbers. There are holes.
- # These holes get filled up when a new partition is created.
- TEMP_DIR="$(mktemp -d)"
- EXISTING_PARTITION_LIST=$TEMP_DIR/existing_partitions
- UPDATED_PARTITION_LIST=$TEMP_DIR/updated_partitions
-
- gdisk -l $DEVICE | grep -A$MAX_DISK_PARTITIONS "Number Start" | grep -v "Number Start" > $EXISTING_PARTITION_LIST
-
- # Create small partition at the end of the device
+ # Create small partition at the end of the device and label it to make
+ # identification below easier.
log "Adding configdrive partition to $DEVICE"
- sgdisk -n 0:-64MB:0 $DEVICE || fail "creating configdrive on ${DEVICE}"
-
- gdisk -l $DEVICE | grep -A$MAX_DISK_PARTITIONS "Number Start" | grep -v "Number Start" > $UPDATED_PARTITION_LIST
-
- CONFIG_PARTITION_ID=`diff $EXISTING_PARTITION_LIST $UPDATED_PARTITION_LIST | tail -n1 |awk '{print $2}'`
- ISO_PARTITION="${DEVICE}${CONFIG_PARTITION_ID}"
+ # Get a one shot partlabel, with a pseudo-random 5 chars chunk to avoid
+ # any conflict with any other pre-existing partlabel
+ PARTLABEL=config-$(< /dev/urandom tr -dc a-z0-9 | head -c 5)
+ sgdisk -n 0:-64MB:0 -c 0:$PARTLABEL $DEVICE || fail "creating configdrive on ${DEVICE}"
+ partprobe
+ ISO_PARTITION=/dev/disk/by-partlabel/$PARTLABEL
else
log "Working on MBR only device $DEVICE"
diff --git a/releasenotes/notes/bug-2005764-15f45e11b9f9c96d.yaml b/releasenotes/notes/bug-2005764-15f45e11b9f9c96d.yaml
new file mode 100644
index 000000000..a6704e215
--- /dev/null
+++ b/releasenotes/notes/bug-2005764-15f45e11b9f9c96d.yaml
@@ -0,0 +1,8 @@
+---
+fixes:
+ - |
+ Fixes a deployment issue encountered during deployment, more precisely
+ during the configdrive partition creation step. On some specific devices
+ like NVMe drives, the created configdrive partition could not be correctly
+ identified (required to dump data onto it afterward).
+ https://storyboard.openstack.org/#!/story/2005764