(Kilo) Glance image-create missing parameters

Asked by Greg on 2015-08-04

I am on Ubuntu 14.04 LTS and am trying to set up Glance for the Kilo version. I get the following error when trying to verify that Glance works:

root@OSControl:~# 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

glance: error: unrecognized arguments: --name --disk-format qcow2 --container-format bare --visibility public

And when I go to see what parameters are available, I got this:

root@OSControl:~# glance image-create
usage: glance image-create [--property <key=value>] [--file <FILE>]
                           [--progress]
                           <unavailable>
glance image-create: error: too few arguments

I tried reinstalling it but always get stuck here

Question information

Language:
English Edit question
Status:
Solved
For:
Glance Edit question
Assignee:
No assignee Edit question
Solved by:
Fabrice Didierjean
Solved:
2015-10-01
Last query:
2015-10-01
Last reply:
2015-09-30

What do you see if you run the following?

$ glance image-create --disk-format qcow2 --container-format bare

Greg (greg-kinley) said : #2

root@OSControl:~# glance image-create --disk-format qcow2 --container-format bare
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: --disk-format --container-format bare

Weird.

How did you install the glance client?

What does glance --version show?

Greg (greg-kinley) said : #4

I installed it using

apt-get install -y glance python-glanceclient

the output of glance --version:

root@OSControl:~# glance --version
0.15.0

Greg (greg-kinley) said : #5

I switched to single quotes and used "=" in the syntax and got a different error:

root@OSControl:~# 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
Not Found (HTTP 404)

Dennis Beaugrand (d-beaugrand) said : #6

I have just encountered this same issue. I was wondering if you ever found an answer to your question? I have been going through the OpenStack Installation for Ubuntu 14.04 (kilo)

Greg (greg-kinley) said : #7

I have never gotten an answer yet

Dennis Beaugrand (d-beaugrand) said : #8

Thanks for the response. So did you just skip that section? Did this cause any issues later on in the installation \ configurations?

Greg (greg-kinley) said : #9

I haven't been able to resume yet. I would think it would not be an issue until I go to deploy, but not sure

Does adding '--debug' give any extra information about the 404 response?

glance --debug ...

Seems like there might be a issue with the parameters provided.

Please use --is-public or --is-protected instead of the --visibility flag and let us know if the issue persists.

Greg (greg-kinley) said : #12

Stuart,

there wasn't a debug option, but it did allow me to put "-d" however, that did not give me anything

Nikhil, changed the option and issue persisted

root@OSControl:~# glance -d 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
Not Found (HTTP 404)

On an Ubuntu 14.04 machine I checked out the 0.15.0 client code and pip installed it into a virtual env.
I had to make the following change to requirements.txt

$ git diff requirements.txt
diff --git a/requirements.txt b/requirements.txt
index 4e67c80..14f6a6e 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -10,4 +10,5 @@ pyOpenSSL>=0.11
 requests>=1.2.1,!=2.4.0
 warlock>=1.0.1,<2
 six>=1.7.0
-oslo.utils>=1.0.0 # Apache-2.0
+oslo.utils>=1.0.0,<=1.2.0 # Apache-2.0
+oslo.i18n<=1.3.0

I was able to run the following command to successfully upload an image:

$ glance --debug --os-tenant-name=<snip> --os-username=<snip> --os-auth-url=https://<snip>:35357/v2.0 --os-region <snip> image-create --name test_image --disk-format raw --container-format bare --file /tmp/smallfile --progress

This showed various debug output, including the various HTTP requests/responses.

$ glance --version
0.15.0

It's not clear why you don't see a --debug option.

Can you cut and paste the command above, substituting your credentials (unset any environment variables) and paste the output to this bug?

rajan433 (rajan433) said : #14

Hi Greg,

Any luck? I am having the same issue and stuck here.

rajan433 (rajan433) said : #15

All,

I have found a resolution. It appears glance is not parsing " correctly. Just remove quotation from the image name and it should be good to go.

[Tue Aug 18 12:45:16 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 [=============================>] 100% +------------------+--------------------------------------+ | Property | Value | +------------------+--------------------------------------+ | checksum | ee1eca47dc88f4879d8a229cc70a07c6 | | container_format | bare | | created_at | 2015-08-18T16:45:40Z | | disk_format | qcow2 | | id | 7e08d6ef-2f91-4fcc-a367-23b9c3ff8433 | | min_disk | 0 | | min_ram | 0 | | name | cirros-0.3.4-x86_64 | | owner | 1a47d9d15c7640d09901da74700ddbd0 | | protected | False | | size | 13287936 | | status | active | | tags | [] | | updated_at | 2015-08-18T16:45:41Z | | virtual_size | None | | visibility | public | +------------------+--------------------------------------+

Having quotes around the image name works fine for me.

I changed my command above to have:

 --name "test_image"

and it worked fine.

Unfortunately none of the above has resolved the issue for me. This is what i get when i run the glance create-image command. BTW i'm running version 0.19.0 of glance.

root@lab001-osctrl-svr001:~# glance image-create --name cirros-0.3.4-x86_64 --file /tmp/images/cirros-0.3.4-x86_64.img --disk-format qcow2 --container-format bare --visibility true
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 true

Also quotes or no quotes give same result.

What happens if -- as both myself and Nikhil have suggested -- you remove the '--visibility' flag?

ie cut and paste the following:

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

Unfortunately looks like the same result.

snippet of command and result:
root@lab001-osctrl-svr001:~# glance image-create --name cirros-0.3.4-x86_64 --file /tmp/images/cirros-0.3.4-x86_64.img --disk-format qcow2 --container-format bare
 ...
glance: error: unrecognized arguments: --name --disk-format qcow2 --container-format bare
root@lab001-osctrl-svr001:~#

Thanks. I have to confess I'm not sure what's happening here.

The exact same command works ok for me:

$ glance image-create --name cirros-0.3.4-x86_64 --file /tmp/images/cirros-0.3.4-x86_64.img --disk-format qcow2 --container-format bare
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | 764efa883dda1e11db47671c4a3bbd9e |
| container_format | bare |
| created_at | 2015-08-19T13:14:32.000000 |
| deleted | False |
| deleted_at | None |
| disk_format | qcow2 |
| id | dc96b93c-ba16-4415-9047-51aa46033ef5 |
| is_public | False |
| min_disk | 0 |
| min_ram | 0 |
| name | cirros-0.3.4-x86_64 |
| owner | 411423405e10431fb9c47ac5b2446557 |
| protected | False |
| size | 3 |
| status | active |
| updated_at | 2015-08-19T13:14:33.000000 |
| virtual_size | None |
+------------------+--------------------------------------+

Are you running glance 0.19.0 on Ubuntu 14.04? This is definitely frustrating. I'm going to go back and triple check the configuration of glance. I've been following the "OpenStack installation guide for Ubuntu 14.04" (KILO revision). So it's possible i've missed something.

Andrew (smileynewbie123) said : #22

Did any one resolved the issue?

openstak@myPC001:~$ ls /tmp/images/cirros-0.3.4-x86_64-disk.img
/tmp/images/cirros-0.3.4-x86_64-disk.img

openstakb@myPc001:~$ 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
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

FYI:
glance version 0.15.0
Ubuntu 14.04 - Trusty

Unfortunately I have not been able to get back to working on this project. So this issue still remains unresolved for me :(

Got this problem too. The error was due to glance endpoint not being registered in keystone

Greg (greg-kinley) said : #25

Have you been able to register it?

Hi, apparently this problem is related to authentication issues, as described here:

https://bugs.launchpad.net/glance/+bug/1467719
https://review.openstack.org/#/c/194076/

The problem is that the error message doesn't have anything to do with the problem itself. One thinks is a syntax problem and it isn't. It's an authentication problem. I'm still trying to solve this.

New developments:

Checking the log /var/log/glance/glance-api.log, I found these messages that confirm that this is exactly a problem about authenticantion.

glance 1541 WARNING keystonemiddleware.auth_token

This thread helped me fix the problem:

https://ask.openstack.org/en/question/60397/unable-to-get-version-info-from-keystone/

Greg (greg-kinley) said : #28

When I reran one of the commands I got a 404 error. This time "openstack image list --debug" actually worked. I noticed this error a couple of times:

WARNING: keystoneclient.auth.identity.generic.base Discovering versions from the identity service failed when creating the password plugin. Attempting to determine version from URL.
DEBUG: keystoneclient.auth.identity.v3 Making authentication request to http://OSControl:35357/v3/auth/tokens
DEBUG: urllib3.connectionpool Setting read timeout to None
DEBUG: urllib3.connectionpool "POST http://OSControl:35357/v3/auth/tokens HTTP/1.1" 404 619
DEBUG: keystoneclient.session Request returned failure status: 404
ERROR: openstack Not Found (HTTP 404)

Hello,

Just have the same problem, and found it was because i have define an http_proxy variable. ( in order to install glance package )

The proxy cannot acces the controler apache server.

I Just unset the http_proxy and everything went fine

Greg (greg-kinley) said : #30

That solved my problem. I unset the proxy after downloading the image and used the following command (i had tried different syntax)

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

root@OSControl:~# 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 | 2015-09-22T15:06:58Z |
| disk_format | qcow2 |
| id | 647a380f-5f72-4227-bfba-0bad5b253848 |
| min_disk | 0 |
| min_ram | 0 |
| name | cirros-0.3.4-x86_64 |
| owner | 0f560f49851145b19c82e7568583efef |
| protected | False |
| size | 13287936 |
| status | active |
| tags | [] |
| updated_at | 2015-09-22T15:06:59Z |
| virtual_size | None |
| visibility | public |
+------------------+--------------------------------------+

dico (bohli-dhekra) said : #31

hi how i can unset the proxy

Zunyi (ngaa) said : #32

Today, I have the same problem, and then I found "glance image-list" command was also error, it has error output. So I found my "glance-registry" service was stopped.

I started the service, then "glance image-create" is OK.

khashochir (khashochir) said : #33

i solved this problem, So i'm just set password for glance user "glancepassword"

Openstack install guide's default password was "password = GLANCE_PASS"

so just replace this password as your given glance user password in /etc/glance/glance-api.conf and /etc/glance/glance-registry.conf

From what I can tell, the ultimate issue here was (1) an authentication problem due to environment misconfiguration, combined with (2) a misleading error message from the python-glanceclient.

There are a multitude of ways (1) can occur; some of these are mentioned in the above discussion.

The misleading error message (2) was fixed in the openstack/python-glanceclient 1.1.1 release. The patch is:
    https://review.openstack.org/#/c/194076/
if you're curious.