Ask Your Question
1

glance - unable to create image

asked 2015-08-14 17:45:11 -0500

windy150 gravatar image
cat centos-release
Red Hat enterprise Linux Server release 7.0 (Maipo)

openstack-glance.noarch                 2015.1.0-3.el7                 @openstack-kilo
python-glance.noarch                    2015.1.0-3.el7                 @openstack-kilo
python-glance-store.noarch              0.4.0-1.el7                    @openstack-kilo
python-glanceclient.noarch              1:0.17.0-2.el7                 @openstack-kilo
glances.noarch                          1.7.7-1.el7                    epel
openstack-glance-doc.noarch             2015.1.0-3.el7                 openstack-kilo
python-glanceclient-doc.noarch          1:0.17.0-2.el7                 openstack-kilo

I am following the kilo install guide and getting stuck when trying to create an image via glance (page 52). I get the following message:

glance image-create --name "cirros-0.3.4-x86_64" --file /tmp/images/cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --visibility public --progress
usage: glance [--version] [-d] [-v] [--get-schema] [--timeout TIMEOUT]
              [--no-ssl-compression] [-f] [--os-image-url OS_IMAGE_URL]
              [--os-image-api-version OS_IMAGE_API_VERSION]
              [--profile HMAC_KEY] [-k] [--os-cert OS_CERT]
              [--cert-file OS_CERT] [--os-key OS_KEY] [--key-file OS_KEY]
              [--os-cacert <ca-certificate-file>] [--ca-file OS_CACERT]
              [--os-username OS_USERNAME] [--os-user-id OS_USER_ID]
              [--os-user-domain-id OS_USER_DOMAIN_ID]
              [--os-user-domain-name OS_USER_DOMAIN_NAME]
              [--os-project-id OS_PROJECT_ID]
              [--os-project-name OS_PROJECT_NAME]
              [--os-project-domain-id OS_PROJECT_DOMAIN_ID]
              [--os-project-domain-name OS_PROJECT_DOMAIN_NAME]
              [--os-password OS_PASSWORD] [--os-tenant-id OS_TENANT_ID]
              [--os-tenant-name OS_TENANT_NAME] [--os-auth-url OS_AUTH_URL]
              [--os-region-name OS_REGION_NAME]
              [--os-auth-token OS_AUTH_TOKEN]
              [--os-service-type OS_SERVICE_TYPE]
              [--os-endpoint-type OS_ENDPOINT_TYPE]
              <subcommand> ...
glance: error: unrecognized arguments: --name --disk-format qcow2 --container-format bare --visibility public

I have also tried switching each option to a --property <flag>=<value> format, but get the following:

glance image-create --property name="cirros-0.3.4-x86_64" --file /tmp/images/cirros-0.3.4-x86_64-disk.img --property disk-format=qcow2 --property container-format=bare --property visibility=public --progress
usage: glance image-create [--property <key=value>] [--file <FILE>]
                           [--progress]
                           <unavailable>
glance image-create: error: too few arguments

I've seen some posts asking what the output of "glance image-list" is, so here it is:

glance image-list
Invalid OpenStack Identity credentials.

If I switch to OS_AUTH_URL=http://localhost:35357/v2.0

glance image-list
An auth plugin is required to fetch a token

Any help in determining why glance isn't recognizing the parameters?

edit retag flag offensive close merge delete

Comments

For me, Invalid OpenStack Identity credentials. came when I created the keystone user with a wrong password.

Christina_Jacob gravatar imageChristina_Jacob ( 2015-08-20 08:05:19 -0500 )edit

I have exactly the same problem following the same installation guide. I'm almost to the point of trying to write to the REST API myself, the app seems unusable.

swdweeb gravatar imageswdweeb ( 2015-08-26 12:26:26 -0500 )edit

5 answers

Sort by ยป oldest newest most voted
1

answered 2015-08-26 20:14:37 -0500

tiagoor gravatar image

updated 2015-08-27 16:23:26 -0500

I had the same error in post 1, did "apt-get install qemu" and puted "export OS_VOLUME_API_VERSION=2" in RC file. Here is a WARNING from /var/log/glance/glance-api.log":

WARNING keystonemiddleware.auth_token [-] Authorization failed for token
similar WARNING in "/var/log/keystone/admin.log" :
WARNING keystone.common.wsgi [-] Authorization failed. The request you have made requires authentication. from 127.0.0.1
edit flag offensive delete link more
0

answered 2015-08-26 16:15:12 -0500

dbaxps gravatar image

updated 2015-08-27 11:19:35 -0500

To get glance CLI working export admin credentials
[root@vfedora22wks root]# cat keystonerc_admin

unset OS_SERVICE_TOKEN
export OS_USERNAME=admin
export OS_PASSWORD=ea5c23c58f15494a
export OS_AUTH_URL=http://192.168.1.57:5000/v2.0
export PS1='[\u@\h \W(keystone_admin)]\$ '

export OS_TENANT_NAME=admin
export OS_REGION_NAME=RegionOne

Then

# source keystonerc_admin
# glance image-create --name "CentOS  7.1" --is-public true --disk-format qcow2 \
          --container-format bare \
          --file CentOS71.qcow2
edit flag offensive delete link more

Comments

Right, and where do I get a keystonerc_admin file to source? What's in it? The documentation has you create admin-openrc.sh and demo-openrc.sh files that can be sourced but nowhere in the document is keystonerc_admin mentioned.

Don't get me wrong, I really appreciate your response, I'm frustrated.

swdweeb gravatar imageswdweeb ( 2015-08-26 16:39:34 -0500 )edit

Abovt RC files, take a look here: http://docs.openstack.org/user-guide/common/cli_set_environment_variables_using_openstack_rc.html (http://docs.openstack.org/user-guide/...).

tiagoor gravatar imagetiagoor ( 2015-08-26 19:57:21 -0500 )edit

I found a version on a redhat site. There was only one additional environment variable than what I had. I added it and still cannot get it to run.

swdweeb gravatar imageswdweeb ( 2015-08-27 10:44:20 -0500 )edit

Thanks. I've done exactly as you suggested and get Invalid "OpenStack Identity credentials." Any attempt to add --debug to the command gets me "glance: error: unrecognized arguments: --debug" I'm sure it's a problem with a combination of environment variables and CLI args

swdweeb gravatar imageswdweeb ( 2015-08-27 12:09:26 -0500 )edit
0

answered 2015-08-27 02:31:27 -0500

Tobias Urdin gravatar image

How I do it.

cat openrc
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=yourpasswordhere
export OS_AUTH_URL=http://1.2.3.4:35357/v2.0
export OS_IMAGE_API_VERSION=2

source openrc

glance --os-endpoint-type internal image-create --name "cirros 0.3.4 x86_64" --file cirros-0.3.3-x86_64-disk.img --disk-format qcow2 --container-format bare --visibility public --progress

You can ignore the part where I force the usage of the internalURL catalog entry from keystone, you should try adding --debug to your glance image-create command and perhaps it will give you some more useful data.

Best regards

edit flag offensive delete link more

Comments

I have the same environment variables set. I ran glance --os-endpoint-type internal image-create --name "cirros-0.3.4" --is-public true --disk-format qcow2 --container-format bare -v --file test-images/cirros-0.3.4-x86_64-disk.img and got glance: error: unrecognized arguments: --name --is-public tru

swdweeb gravatar imageswdweeb ( 2015-08-27 10:41:58 -0500 )edit

glance: error: unrecognized arguments: --name --is-public true --disk-format qcow2 --container-format bare -v

I really do appreciate all of the responses!

swdweeb gravatar imageswdweeb ( 2015-08-27 10:42:36 -0500 )edit

I added --debug glance image-create --name cirros-0.3.4 --is-public true --disk-format qcow2 --container-format bare --debug --file /home/perry/test-images/cirros-0.3.4-x86_64-disk.img

got glance: error: unrecognized arguments: --debug

swdweeb gravatar imageswdweeb ( 2015-08-27 12:03:03 -0500 )edit
0

answered 2015-08-26 15:05:05 -0500

updated 2015-08-26 16:41:12 -0500

You can probably ignore what follows. I found that things simply broke shortly after this so I don't know if any of what follows is valid. (Although I think you've got to install qemu)

I don't have a complete answer yet, but I'm getting close... On a wild guess, I searched the internet for converting an img to qcow2 format. This led me to documentation that said to use qemu-img. I then installed qemu "apt-get install qemu". Just for grins I decided to try the documented command of

glance image-create --name "cirros-0.3.4-x86_64" --file test-images/cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --visibility public --progress

and got a different set of errors.

Then I ran into a, what I'm finding as typical, problem of environment variables, specifically OS_AUTH_TOKEN, OS_PASSWORD and OS_USERNAME not being set. Once having set those to valid/current values I had it narrowed down to one error--visibility public being called out as an invalid parameter.

I removed the "-visibility public" option/argument and managed to see this.

glance image-create --name "cirros-0.3.4-x86_64" --file test-images/cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --progress

[=============================>] 100%

Invalid OpenStack Identity credentials.

So I'm getting closer.

I have problems with the "glance" user that the doc has you create. I can't authenticate that user. That may be my problem, I'm not sure. I tried to run this as the admin user using the admin tenant/project rather than the "service" project they tell you to create.

Hopefully this helps someone get closer to solving the problem.

edit flag offensive delete link more

Comments

Hi,,are you able to resolve this issue after that? any other update.. i'm facing same issue..

Thanks, Pavan

Pavanasam R gravatar imagePavanasam R ( 2015-09-01 23:47:43 -0500 )edit
0

answered 2016-04-19 23:47:03 -0500

Jaesang Lee gravatar image

Hi,

I had the same error.

[root@controller ~]# glance image-create --name "cirros-0.3.4-x86_64" --file /tmp/images/cirros-0.3.4-x86_64-disk.img \
>   --disk-format qcow2 --container-format bare --visibility public --progress
usage: glance [--version] [-d] [-v] [--get-schema] [--timeout TIMEOUT]
              [--no-ssl-compression] [-f] [--os-image-url OS_IMAGE_URL]
              [--os-image-api-version OS_IMAGE_API_VERSION]
              [--profile HMAC_KEY] [-k] [--os-cert OS_CERT]
              [--cert-file OS_CERT] [--os-key OS_KEY] [--key-file OS_KEY]
              [--os-cacert <ca-certificate-file>] [--ca-file OS_CACERT]
              [--os-username OS_USERNAME] [--os-user-id OS_USER_ID]
              [--os-user-domain-id OS_USER_DOMAIN_ID]
              [--os-user-domain-name OS_USER_DOMAIN_NAME]
              [--os-project-id OS_PROJECT_ID]
              [--os-project-name OS_PROJECT_NAME]
              [--os-project-domain-id OS_PROJECT_DOMAIN_ID]
              [--os-project-domain-name OS_PROJECT_DOMAIN_NAME]
              [--os-password OS_PASSWORD] [--os-tenant-id OS_TENANT_ID]
              [--os-tenant-name OS_TENANT_NAME] [--os-auth-url OS_AUTH_URL]
              [--os-region-name OS_REGION_NAME]
              [--os-auth-token OS_AUTH_TOKEN]
              [--os-service-type OS_SERVICE_TYPE]
              [--os-endpoint-type OS_ENDPOINT_TYPE]
              <subcommand> ...
glance: error: unrecognized arguments: --name --disk-format qcow2 --container-format bare --visibility public

In my case, I miss configuration about keystone_authtoken configuration, I misspell a password about glance keystone account. When I fixed a keystone.conf with a right config, Above error was deleted.

[root@controller glanceclient]# glance image-create --name "cirros-0.3.4-x86_64" --file /tmp/images/cirros-0.3.4-x86_64-disk.img   --disk-format qcow2 --container-format bare --visibility public --progress
[=============================>] 100%
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | ee1eca47dc88f4879d8a229cc70a07c6     |
| container_format | bare                                 |
| created_at       | 2016-04-20T01:38:54Z                 |
| disk_format      | qcow2                                |
| id               | 7b9583ea-6539-4209-a151-2bc5d9d4c986 |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | cirros-0.3.4-x86_64                  |
| owner            | a159c559301a46cbbeb26b82e2342ef3     |
| protected        | False                                |
| size             | 13287936                             |
| status           | active                               |
| tags             | []                                   |
| updated_at       | 2016-04-20T01:38:54Z                 |
| virtual_size     | None                                 |
| visibility       | public                               |
+------------------+--------------------------------------+
edit flag offensive delete link more

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

3 followers

Stats

Asked: 2015-08-14 17:45:11 -0500

Seen: 10,988 times

Last updated: Apr 19 '16