virt images have changed names

Bug #1635345 reported by Jeff Lane 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox Provider - Base
Fix Released
Critical
Jeff Lane 

Bug Description

The image name for virtualization images (cloud) have changed as CPC has moved to a "One Image To Rule Them All" format. Thus, we need to modify the virtualization script and anything else that checks or downloads images from cloud-images.ubuntu.com.

Related branches

Jeff Lane  (bladernr)
Changed in plainbox-provider-certification-server:
assignee: nobody → Jeff Lane (bladernr)
importance: Undecided → Critical
status: New → In Progress
Revision history for this message
Jeff Lane  (bladernr) wrote :

Ok.. updates to the virtualization script. I've changed how URLs are constructed quite a bit and also added a bit more debugging code. I've also added a method for validating URLs before testing. If the URL is invalid, we retry with a slight alteration to the cloud image filename and if it fails a second time, we exit with an error message.

This is necessary because the Xenial and earlier filenames look like this:

$RELEASE-server-cloudimg-$ARCH-disk1.img

while Yakkety and later look like this:

$RELEASE-server-cloudimg-$ARCH.img

So the way the script works now, it checks the xenial format first, then changes to the yakkety format and re-validates the URL.

There are basically three different ways to specify a remote URL (I haven't changed how local files are handled, whether they are just a file name and path, or file:// URI formatted):

Default - user doesn't specify a url and we assume to pull from cloud-images.ubuntu.com

Relative - user specifies a url to a director (or with no directory), as in http://192.168.0.20/images. We assume that /images is a dir with copies of the official images from cloud-images, and thus follow the same naming conventions. (this assumes that the end of the URL does not end in .img)

Absolute - user specifies a url to an actual file such as http://192.168.0.20/images/yakkety-image.img, in which case we validate the absolute URL and go on about our day, or exit if it's invalid.

This will require images to end in .img, but we can just enforce that with policy and the error messages, as there's really no way to query a URL and determine if it's a File or a Directory.

Sample output will follow.

Revision history for this message
Jeff Lane  (bladernr) wrote :

Default URL:
bladernr@galactica:~/development/git/plainbox-provider-checkbox/bin$ ./virtualization kvm --debug
Executing KVM Test
DEBUG:root:Starting KVM Test
DEBUG:root:No image specified, downloading one now.
DEBUG:root:Acquiring cloud image from: http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img

bladernr@galactica:~/development/git/plainbox-provider-checkbox/bin$ ./virtualization kvm --debug
Executing KVM Test
DEBUG:root:Starting KVM Test
DEBUG:root:No image specified, downloading one now.
WARNING:root:Cloud Image URL not valid: http://cloud-images.ubuntu.com/yakkety/current/yakkety-server-cloudimg-amd64-disk1.img
WARNING:root: * This means we could not reach the remote file. We'll now try with a different filename schema.
DEBUG:root:Acquiring cloud image from: http://cloud-images.ubuntu.com/yakkety/current/yakkety-server-cloudimg-amd64.img

Note, the "Acquiring cloud image" message means the URL has validated and we're now proceeding to download. The script is set to exit before downloading for demo purposes.

Revision history for this message
Jeff Lane  (bladernr) wrote :

Relative URL:

bladernr@galactica:~/development/git/plainbox-provider-checkbox/bin$ ./virtualization kvm --debug -i http://192.168.0.20/
Executing KVM Test
DEBUG:root:Starting KVM Test
DEBUG:root:Cloud image location specified: http://192.168.0.20/.
WARNING:root:Cloud Image URL not valid: http://192.168.0.20/xenial-server-cloudimg-amd64-disk1.img
WARNING:root: * This means we could not reach the remote file. We'll now try with a different filename schema.
ERROR:root:Cloud URL is not valid: http://192.168.0.20/xenial-server-cloudimg-amd64.img
ERROR:root: * It appears that there is a problem finding the expected file. Check the URL noted above.

bladernr@galactica:~/development/git/plainbox-provider-checkbox/bin$ ./virtualization kvm --debug -i http://192.168.0.20/images
Executing KVM Test
DEBUG:root:Starting KVM Test
DEBUG:root:Cloud image location specified: http://192.168.0.20/images.
DEBUG:root:Acquiring cloud image from: http://192.168.0.20/images/xenial-server-cloudimg-amd64-disk1.img

bladernr@galactica:~/development/git/plainbox-provider-checkbox/bin$ ./virtualization kvm --debug -i http://192.168.0.20/images/
Executing KVM Test
DEBUG:root:Starting KVM Test
DEBUG:root:Cloud image location specified: http://192.168.0.20/images/.
DEBUG:root:Acquiring cloud image from: http://192.168.0.20/images/xenial-server-cloudimg-amd64-disk1.img

bladernr@galactica:~/development/git/plainbox-provider-checkbox/bin$ ./virtualization kvm --debug -i http://192.168.0.20/
Executing KVM Test
DEBUG:root:Starting KVM Test
DEBUG:root:Cloud image location specified: http://192.168.0.20/.
WARNING:root:Cloud Image URL not valid: http://192.168.0.20/yakkety-server-cloudimg-amd64-disk1.img
WARNING:root: * This means we could not reach the remote file. We'll now try with a different filename schema.
ERROR:root:Cloud URL is not valid: http://192.168.0.20/yakkety-server-cloudimg-amd64.img
ERROR:root: * It appears that there is a problem finding the expected file. Check the URL noted above.

bladernr@galactica:~/development/git/plainbox-provider-checkbox/bin$ ./virtualization kvm --debug -i http://192.168.0.20/images/
Executing KVM Test
DEBUG:root:Starting KVM Test
DEBUG:root:Cloud image location specified: http://192.168.0.20/images/.
WARNING:root:Cloud Image URL not valid: http://192.168.0.20/images/yakkety-server-cloudimg-amd64-disk1.img
WARNING:root: * This means we could not reach the remote file. We'll now try with a different filename schema.
DEBUG:root:Acquiring cloud image from: http://192.168.0.20/images/yakkety-server-cloudimg-amd64.img

bladernr@galactica:~/development/git/plainbox-provider-checkbox/bin$ ./virtualization kvm --debug -i http://192.168.0.20/images
Executing KVM Test
DEBUG:root:Starting KVM Test
DEBUG:root:Cloud image location specified: http://192.168.0.20/images.
WARNING:root:Cloud Image URL not valid: http://192.168.0.20/images/yakkety-server-cloudimg-amd64-disk1.img
WARNING:root: * This means we could not reach the remote file. We'll now try with a different filename schema.
DEBUG:root:Acquiring cloud image from: http://192.168.0.20/images/yakkety-server-cloudimg-amd64.img

Revision history for this message
Jeff Lane  (bladernr) wrote :

Absolute URL:

bladernr@galactica:~/development/git/plainbox-provider-checkbox/bin$ ./virtualization kvm --debug -i http://192.168.0.20/images/bogusimage.img
Executing KVM Test
DEBUG:root:Starting KVM Test
DEBUG:root:Cloud image location specified: http://192.168.0.20/images/bogusimage.img
ERROR:root:Cloud Image URL invalid: http://192.168.0.20/images/bogusimage.img
ERROR:root: * Check the URL and ensure it is correct

bladernr@galactica:~/development/git/plainbox-provider-checkbox/bin$ ./virtualization kvm --debug -i http://192.168.0.20/images/xenial-server-cloudimg-amd64-disk1.img
Executing KVM Test
DEBUG:root:Starting KVM Test
DEBUG:root:Cloud image location specified: http://192.168.0.20/images/xenial-server-cloudimg-amd64-disk1.img
DEBUG:root:Acquiring cloud image from: http://192.168.0.20/images/xenial-server-cloudimg-amd64-disk1.img

bladernr@galactica:~/development/git/plainbox-provider-checkbox/bin$ ./virtualization kvm --debug -i http://192.168.0.20/images/xenial-server-cloudimg-amd64.img
Executing KVM Test
DEBUG:root:Starting KVM Test
DEBUG:root:Cloud image location specified: http://192.168.0.20/images/xenial-server-cloudimg-amd64.img
ERROR:root:Cloud Image URL invalid: http://192.168.0.20/images/xenial-server-cloudimg-amd64.img
ERROR:root: * Check the URL and ensure it is correct

bladernr@galactica:~/development/git/plainbox-provider-checkbox/bin$ ./virtualization kvm --debug -i http://192.168.0.20/images/yakkety-server-cloudimg-amd64.img
Executing KVM Test
DEBUG:root:Starting KVM Test
DEBUG:root:Cloud image location specified: http://192.168.0.20/images/yakkety-server-cloudimg-amd64.img
DEBUG:root:Acquiring cloud image from: http://192.168.0.20/images/yakkety-server-cloudimg-amd64.img

Jeff Lane  (bladernr)
no longer affects: plainbox-provider-certification-server
tags: added: hwcert-server
Changed in plainbox-provider-checkbox:
milestone: none → 0.34.0
status: In Progress → Fix Committed
Changed in plainbox-provider-checkbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.