Ask Your Question
0

Image doesn't contain os-distro field

asked 2015-07-01 05:54:27 -0600

I'm having issues trying to create a baymodel using Kubernetes as test. Server is running Ubuntu Server 14.04.2 LTS. Magnum running inside a virtenv.

# echo $NIC_ID $SINGLEDNS_SERVER 
4dc7c709-48c2-443f-8923-8984bf4036b9 8.8.8.8

# magnum baymodel-create --name k8sbaymodel --image-id fedora-21-atomic-3 --keypair-id testkey --external-network-id $NIC_ID --dns-nameserver $SINGLEDNS_SERVER --flavor-id m1.small --docker-volume-size 5 --coe kubernetes

This brings up an error:

ERROR: Image fedora-21-atomic-3 doesn't contain os-distro field. (HTTP 404)

So, let's hit the debug on the magnum-api output (running on another shell):

... x-openstack-request-id: req-req-2562723f-2f58-4efe-996f-39e232c8adb3

{"images": [{"status": "active", "name": "fedora-21-atomic-3", "os-distro": "fedora-atomic", "container_format": "bare", "created_at": "2015-06-30T10:08:49Z", "tags": [], "disk_format": "qcow2", "updated_at": "2015-06-30T10:09:24Z", "visibility": "public", "self": "/v2/images/2b7d500e-2dc9-42c0-a44a-767bf3952a5a", "min_disk": 0, "protected": false, "id": "2b7d500e-2dc9-42c0-a44a-767bf3952a5a", "size": 770179072, "file": "/v2/images/2b7d500e-2dc9-42c0-a44a-767bf3952a5a/file", "checksum": "d3b3da0e07743805dcc852785c7fc258", "owner": "d994498b6e6941f5a7bb39b878791f59", "virtual_size": null, "min_ram": 0, "schema": "/v2/schemas/image"}], "schema": "/v2/schemas/images", "first": "/v2/images?limit=20&name=fedora-21-atomic-3"} log_http_response /root/.venv/local/lib/python2.7/site-packages/glanceclient/common/http.py:136 2015-07-01 12:14:22.579 482 DEBUG wsme.api [req-3472f10a-444c-4396-8f5f-1b59d39c243f demo demo - - -] Client-side error: Image fedora-21-atomic-3 doesn't contain os-distro field. format_exception /root/.venv/local/lib/python2.7/site-packages/wsme/api.py:221

10.8.0.193 - - [01/Jul/2015 12:14:22] "POST /v1/baymodels HTTP/1.1" 404 149

Checking if it's really got the field:

# glance image-show $(glance image-list | awk '/ fedora-21-atomic-3 / {print $2}' ) | awk  '/ os-distro / {print $4}'
fedora-atomic

Magnum config: egrep -v '^#|^$' /etc/magnum/magnum.conf

[DEFAULT]
debug=true
verbose=true
[api]
host=controller
[bay]
[bay_heat]
[conductor]
[database]
connection=mysql://magnum:magnumpass@controller/magnum
[docker]
[heat_client]
[keystone_authtoken]
auth_uri=http://controller:5000/v2.0
identity_uri=http://controller:35357
admin_user=magnum
admin_password=magnumpass
admin_tenant_name = service
[kubernetes]
[matchmaker_redis]
host=controller
[matchmaker_ring]
[oslo_concurrency]
[oslo_messaging_amqp]
[oslo_messaging_qpid]
[oslo_messaging_rabbit]
rabbit_host=controller
rabbit_userid=openstack
rabbit_password=rabbitpass
[oslo_policy]
policy_file = policy.json

egrep -v '^#|^$' /etc/magnum/policy.json

{
    "context_is_admin":  "role:admin",
    "admin_or_owner":  "is_admin:True or project_id:%(project_id)s",
    "default": "rule:admin_or_owner",
    "admin_api": "is_admin:True",
    "bay:create": "rule:default",
    "bay:delete": "rule:default",
    "bay:detail": "rule:default",
    "bay:get": "rule:default",
    "bay:get_all": "rule:default",
    "bay:update": "rule:default",
    "baymodel:create": "rule:default",
    "baymodel:delete": "rule:default",
    "baymodel:detail": "rule:default",
    "baymodel:get": "rule:default",
    "baymodel:get_all": "rule:default",
    "baymodel:update": "rule:default"
}

Can anyone bring some light to this, please? :)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-07-02 05:58:19 -0600

updated 2015-07-02 08:30:30 -0600

Alright, even if debug says "os-distro" field not found... also docs say "os-distro" field... In file: magnum/magnum/api/controllers/v1/baymodel.py actually searches for "os_distro". So, when you add your fedora (or other) image to glance do it this way:

glance image-create --name fedora-21-atomic-3 --visibility public --disk-format qcow2 --property os_distro='fedora-atomic' --container-format bare --file fedora-21-atomic-3.qcow2 --progress
edit flag offensive delete link more

Comments

HINT: you can update metadata's image from horizon ;)

drober gravatar imagedrober ( 2015-07-02 08:38:27 -0600 )edit

https://bugs.launchpad.net/magnum/+bug/1470934 (https://bugs.launchpad.net/magnum/+bu...)

drober gravatar imagedrober ( 2015-07-03 06:23:45 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-07-01 05:54:27 -0600

Seen: 1,102 times

Last updated: Jul 02 '15