Details
-
Bug
-
Status: Resolved (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
Jenkins v1.609.1
OpenStack Cloud plugin v2.3
OS: SLES 11 SP3
Description
I've set up and configured the OpenStack Cloud plugin with one template. When I try to launch a slave based on that template (via Manage nodes) all I get is: "Error. Boot failed".
After studying the logs and the network traffic I found the cause. The plugin tries to resolve the image ID based on the Image name that I configured. (See jenkins.plugins.openstack.compute.internal.OpenStack.getImageIdFor(String name)).
This results is an API call to the images API:
HTTP/1.1 GET v1/images?status=ACTIVE&name=My_Image
The API however expects a lowercase status instead of uppercase (see also http://developer.openstack.org/api-ref-image-v1.html). So the response body is:
{"images": []}.
The result of this is that the plugin tries to provision an instance via the API without providing an imageRef.
So there are essentially two issues:
1. The plugin makes the wrong API call
2. The plugin doesn't handle the situation where no images are returned correctly.
This bug was introduced with commit 50dd47d798bcd79a99ebfb62e51cb2c2d057777f.
Thanks for reporting this. It is strange but my openstack does not eliminate the images because of case mismatch in status field. Can you run Jenkins.instance.clouds[0].openstack.@client.images().listAll(['status':'active']) (vs. ACTIVE) from JENKINS_URL/script to verify?
You are right that there si a lot to catch up in case a mandatory field is left null. Plugin should at least report (if not abort the provisioning) in case some of the required fields is not configured (or resolved as in this case).