diff options
author | Zuul <zuul@review.opendev.org> | 2019-07-12 10:26:28 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2019-07-12 10:26:28 +0000 |
commit | f51729509207e81bee07a8e41ad740b15f78da4f (patch) | |
tree | b639b88945f342d60bef1b0283ea99a91d8cd3ee | |
parent | 65a63c5fd89a3eec4ad6de9b9fa9efb528ca2f1d (diff) | |
parent | 704bf8f18f504796b4e10fd84246f42816961721 (diff) | |
download | ironic-f51729509207e81bee07a8e41ad740b15f78da4f.tar.gz |
Merge "Ansible module: fix configdrive partition creation step" into stable/queens
-rwxr-xr-x | ironic/drivers/modules/ansible/playbooks/roles/deploy/files/partition_configdrive.sh | 24 | ||||
-rw-r--r-- | releasenotes/notes/bug-2005764-15f45e11b9f9c96d.yaml | 8 |
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 |