Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Build images on ubuntu 16.04 #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrewjjenkins
Copy link

Ubuntu 16.04 behaves slightly differently than 14.04. pvscan will not
activate the /dev/nbd* devices unless told specifically to examine and
activate them using "--cache".

Add some robustness by doing a partprobe after qemu-nbd but before using
the partitions. This helps races (the partprobe happens asynchronously
I think).

Ubuntu 16.04 behaves slightly differently than 14.04.  pvscan will not
activate the /dev/nbd* devices unless told specifically to examine and
activate them using "--cache".

Add some robustness by doing a partprobe after qemu-nbd but before using
the partitions.  This helps races (the partprobe happens asynchronously
I think).
@andrewjjenkins
Copy link
Author

I created an image using these:

  • ubuntu-16.04-server-cloudimg-amd64-20160420.3
  • BIGIP-11.6.0.6.0.442.ALL.qcow2.zip

Then I booted it and it "Openstacked" correctly: honored my passwords, SSH keys, MTU, everything.

Here's an excerpt from the console log around the parts I changed:

[  148.498258] cloud-init[1172]: + check_oldfile_full_path
[  148.499838] cloud-init[1172]: + '[' -f BIGIP-11.6.0.6.0.442.qcow2 ']'
[  148.501372] cloud-init[1172]: ++ basename BIGIP-11.6.0.6.0.442.qcow2
[  148.502893] cloud-init[1172]: + ofname=BIGIP-11.6.0.6.0.442.qcow2
[  148.504370] cloud-init[1172]: + '[' -z os_ready-BIGIP-11.6.0.6.0.442.qcow2 ']'
[  148.505155] cloud-init[1172]: + cp BIGIP-11.6.0.6.0.442.qcow2 /home/imageprep/os_ready-BIGIP-11.6.0.6.0.442.qcow2
[  155.116511] cloud-init[1172]: + sleep 2
[  157.156489] cloud-init[1172]: + qemu-nbd -d /dev/nbd0
[  157.302910] cloud-init[1172]: + sleep 2
[  159.304808] cloud-init[1172]: + qemu-nbd --connect=/dev/nbd0 /home/imageprep/os_ready-BIGIP-11.6.0.6.0.442.qcow2
[  159.617027] cloud-init[1172]: + sleep 2
[  161.618746] cloud-init[1172]: + partprobe /dev/nbd0
[  162.478500] cloud-init[1172]: + for part in '${qcow_device}*'
[  162.480443] cloud-init[1172]: + pvscan --cache /dev/nbd0
[  162.841948] cloud-init[1172]: + for part in '${qcow_device}*'
[  162.843782] cloud-init[1172]: + pvscan --cache /dev/nbd0p1
[  162.850781] cloud-init[1172]: + for part in '${qcow_device}*'
[  162.852638] cloud-init[1172]: + pvscan --cache /dev/nbd0p2
[  162.861921] cloud-init[1172]: + for part in '${qcow_device}*'
[  162.863546] cloud-init[1172]: + pvscan --cache /dev/nbd0p3
[  162.867876] cloud-init[1172]: + pvscan
[  162.997557] cloud-init[1172]: + sleep 2
[  164.999400] cloud-init[1172]: + echo 'The following command may cause '\''Can'\''t deactivate'\'' messages.'
[  165.002543] cloud-init[1172]: + echo 'These do not necessarily indicate a problem.'
[  165.004525] cloud-init[1172]: + vgchange -ay
[  165.191810] cloud-init[1172]: + sleep 2
[  167.194623] cloud-init[1172]: + mkdir -p /mnt/bigip-config
[  167.202083] cloud-init[1172]: + '[' -n '' ']'
[  167.202390] cloud-init[1172]: + echo 'Waiting 15 seconds'
[  167.202681] cloud-init[1172]: + sleep 15
[  182.205441] cloud-init[1172]: + umount /mnt/bigip-config
[  182.219304] cloud-init[1172]: umount: /mnt/bigip-config: not mounted
[  182.219789] cloud-init[1172]: + '[' 32 -eq 1 ']'
[  182.220627] cloud-init[1172]: + umount /mnt/bigip-shared
[  182.224402] cloud-init[1172]: umount: /mnt/bigip-shared: mountpoint not found
[  182.224762] cloud-init[1172]: + '[' 32 -eq 1 ']'
[  182.225288] cloud-init[1172]: ++ get_dev set.1._config
[  182.225824] cloud-init[1172]: ++ ls -l /dev/vg-db-hda
[  182.226421] cloud-init[1172]: ++ cut '-d>' -f2
[  182.226631] cloud-init[1172]: ++ grep set.1._config
[  182.227070] cloud-init[1172]: ++ cut -d/ -f2-
[  182.258434] cloud-init[1172]: + mount /dev/dm-6 /mnt/bigip-config
[  182.274943] cloud-init[1172]: + inject_files

@pjbreaux
Copy link
Contributor

Excellent. Good fix. Testing on Ubuntu 14.04.

@pjbreaux
Copy link
Contributor

Does this look sane to you on Ubuntu 14.04. Haven't attempted to boot the image yet.

+ qemu-nbd --connect=/dev/nbd0 /home/imageprep/os_ready-BIGIP-11.6.0.0.0.401.qcow2
+ sleep 2
+ partprobe /dev/nbd0
+ for part in '${qcow_device}*'
+ pvscan --cache /dev/nbd0
  Command failed with status code 5.
+ for part in '${qcow_device}*'
+ pvscan --cache /dev/nbd0p1
  Command failed with status code 5.
+ for part in '${qcow_device}*'
+ pvscan --cache /dev/nbd0p2
  Command failed with status code 5.
+ for part in '${qcow_device}*'
+ pvscan --cache /dev/nbd0p3
  Command failed with status code 5.
+ pvscan

@pjbreaux
Copy link
Contributor

@andrewjjenkins: Check the question above. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants