tools/setup_{RedHat,Debian}.sh can try to process multiple loop devices
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
kolla |
Fix Released
|
Wishlist
|
Dave Walker |
Bug Description
I'm not quite sure how this happened, it would seem logical that it is due to running tools/setup_
Either way, it would be good if the script was idempotent. The losetup isn't safe from this and neither is the $DEV assignment.
Currently the parted command is passed multiple loop devices, which is failing.
Seeing this from the output:
{{
sudo dd if=/dev/zero of=/docker bs=1M count=20480
20480+0 records in
20480+0 records out
21474836480 bytes (21 GB) copied, 48.1589 s, 446 MB/s
+ losetup -f /docker
++ awk -F: '/\/docker/ {print $1}'
++ losetup -a
+ DEV='/dev/loop0
/dev/loop2
/dev/loop3'
+ sudo parted /dev/loop0 /dev/loop2 /dev/loop3 -s -- mklabel msdos
Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]
Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND(s) are given, run in
interactive mode.
OPTIONs:
-h, --help displays this help message
-l, --list lists partition layout on all block devices
-m, --machine displays machine parseable output
-s, --script never prompts for user intervention
-v, --version displays the version
-a, --align=
COMMANDs:
align-check TYPE N check partition N for TYPE(min|opt) alignment
help [COMMAND] print general help, or help on COMMAND
mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
mkpart PART-TYPE [FS-TYPE] START END make a partition
name NUMBER NAME name partition NUMBER as NAME
print [devices|
quit exit program
rescue START END rescue a lost partition near START and END
rm NUMBER delete partition NUMBER
select DEVICE choose the device to edit
disk_set FLAG STATE change the FLAG on selected device
disk_toggle [FLAG] toggle the state of FLAG on selected device
set NUMBER FLAG STATE change the FLAG on partition NUMBER
toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER
unit UNIT set the default unit to UNIT
version display the version number and copyright information of GNU Parted
Report bugs to <email address hidden>
+ sudo rm -rf /var/lib/docker
+ sudo mkdir /var/lib/docker
+ sudo mkfs.btrfs -f /dev/loop0 /dev/loop2 /dev/loop3
btrfs-progs v3.19.1
See http://
Performing full device TRIM (20.00GiB) ...
Turning ON incompat feature 'extref': increased hardlink limit per file to 65536
Turning ON incompat feature 'skinny-metadata': reduced-size metadata extent refs
skipping duplicate device /dev/loop2 in FS
skipping duplicate device /dev/loop3 in FS
not enough free space
}}
This is caused by:
{{
# DEV=$(losetup -a | awk -F: '/\/docker/ {print $1}')
# echo $DEV
/dev/loop0 /dev/loop2 /dev/loop3
# losetup -a
/dev/loop0: [64768]:397121 (/docker)
/dev/loop2: [64768]:397121 (/docker)
/dev/loop3: [64768]:397121 (/docker)
}}
summary: |
- tools/setup_RedHat.sh can try to process multiple loop devices + tools/setup_{RedHat,Debian}.sh can try to process multiple loop devices |
Changed in kolla: | |
importance: | Undecided → Wishlist |
milestone: | none → newton-2 |
assignee: | nobody → Dave Walker (daviey-walker) |
Reviewed: https:/ /review. openstack. org/326347 /git.openstack. org/cgit/ openstack/ kolla/commit/ ?id=334ef7d540f cfe6957b6872cda 3f080d0b4b65ab
Committed: https:/
Submitter: Jenkins
Branch: master
commit 334ef7d540fcfe6 957b6872cda3f08 0d0b4b65ab
Author: Dave Walker (Daviey) <email address hidden>
Date: Tue Jun 7 10:49:19 2016 +0100
setup_ {RedHat, Debian} .sh, make more idempotent
Previously, when either setup_{ RedHat, Debian} .sh was ran
multiple times a mess was created due to multiple loop
devices being setup.
This change now looks to see if '/docker' or '/swapfile'
already exist, and not re-create them if they do.
*However*, /var/lib/docker (/docker) is still wiped - but it
means that the script can run and bring the system into a
constant vanilla state.
Change-Id: I169662fa04c2bf 644672ca75c3ee5 79795943727
Closes-Bug: #1586563
Signed-off-by: Dave Walker (Daviey) <email address hidden>