Revision history [back]

click to hide/show revision 1
initial version

Clarify something:

The "curl" and "swift" command works well on swift node: root@saio:/home/swiftdemo# export ST_AUTH=https://172.17.1.125:443/auth/v1.0 root@saio:/home/swiftdemo# export ST_USER=test:tester root@saio:/home/swiftdemo# export ST_KEY=testing root@saio:/home/swiftdemo# swift list builders gholt myfiles root@saio:/home/swiftdemo# swift stat -v StorageURL: https://172.17.1.125:443/v1/AUTH_3852a9fd-b1e5-4498-8aa4-3a557cebff2e Auth Token: AUTH_tk1a85a0af81364aa3ad104c9e035027c6 Account: AUTH_3852a9fd-b1e5-4498-8aa4-3a557cebff2e Containers: 3 Objects: 1 Bytes: 0 Accept-Ranges: bytes root@saio:/home/swiftdemo# root@saio:/home/swiftdemo# curl -k -v -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass: testing' https://172.17.1.125:443/auth/v1.0 * About to connect() to 172.17.1.125 port 443 (#0) * Trying 172.17.1.125... connected * Connected to 172.17.1.125 (172.17.1.125) port 443 (#0) * successfully set certificate verify locations: * CAfile: none CApath: /etc/ssl/certs * SSLv3, TLS handshake, Client hello (1): * SSLv3, TLS handshake, Server hello (2): * SSLv3, TLS handshake, CERT (11): * SSLv3, TLS handshake, Server finished (14): * SSLv3, TLS handshake, Client key exchange (16): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSL connection using AES256-SHA * Server certificate: * subject: C=CH; ST=SHANXIN; L=XIAN; O=Platform; OU=DEV; CN=172.17.1.125; emailAddress=gyliu@platform.com * start date: 2011-08-08 03:29:29 GMT * expire date: 2011-09-07 03:29:29 GMT * common name: 172.17.1.125 (matched) * issuer: C=CH; ST=SHANXIN; L=XIAN; O=Platform; OU=DEV; CN=172.17.1.125; emailAddress=gyliu@platform.com * SSL certificate verify result: self signed certificate (18), continuing anyway.

GET /auth/v1.0 HTTP/1.1 User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15 Host: 172.17.1.125 Accept: / X-Storage-User: test:tester X-Storage-Pass: testing

< HTTP/1.1 200 OK < X-Storage-Url: https://172.17.1.125:443/v1/AUTH_3852a9fd-b1e5-4498-8aa4-3a557cebff2e < X-Storage-Token: AUTH_tk1a85a0af81364aa3ad104c9e035027c6 < X-Auth-Token: AUTH_tk1a85a0af81364aa3ad104c9e035027c6 < Content-Length: 115 < Date: Wed, 10 Aug 2011 08:51:41 GMT < * Connection #0 to host 172.17.1.125 left intact * Closing connection #0 * SSLv3, TLS alert, Client hello (1):

{"storage": {"default": "local", "local": "https://172.17.1.125:443/v1/AUTH_3852a9fd-b1e5-4498-8aa4-3a557cebff2e"}}

Just make minor change on glance.conf, set log level to DEBUG,

========glance-api.conf================== default_store = swift swift_store_auth_address = 172.17.1.125:443/v1.0/ swift_store_user = test:tester swift_store_key = testing swift_store_container = glance swift_store_create_container_on_put = True

swift_enable_snet = False

root@glance-node:~# glance add name="s2" is_public=true < /tmp/test.iso Failed to add image. Got error: 400 Bad Request

The server could not comply with the request since it is either malformed or otherwise incorrect.

Error uploading image: global name 'swift_client' is not defined
Note: Your image metadata may still be in the registry, but the image's status will likely be 'killed'.

Log file of api.log: 2011-08-10 16:44:30 DEBUG [glance-api] ************************* 2011-08-10 16:44:30 DEBUG [glance-api] Configuration options gathered from config file: 2011-08-10 16:44:30 DEBUG [glance-api] /etc/glance/glance-api.conf 2011-08-10 16:44:30 DEBUG [glance-api] ================================================ 2011-08-10 16:44:30 DEBUG [glance-api] bind_host 0.0.0.0 2011-08-10 16:44:30 DEBUG [glance-api] bind_port 9292 2011-08-10 16:44:30 DEBUG [glance-api] debug True 2011-08-10 16:44:30 DEBUG [glance-api] default_store swift 2011-08-10 16:44:30 DEBUG [glance-api] delayed_delete False 2011-08-10 16:44:30 DEBUG [glance-api] filesystem_store_datadir /var/lib/glance/images/ 2011-08-10 16:44:30 DEBUG [glance-api] image_cache_datadir /var/lib/glance/image-cache/ 2011-08-10 16:44:30 DEBUG [glance-api] image_cache_enabled False 2011-08-10 16:44:30 DEBUG [glance-api] image_cache_stall_timeout 86400 2011-08-10 16:44:30 DEBUG [glance-api] log_file /var/log/glance/api.log 2011-08-10 16:44:30 DEBUG [glance-api] registry_host 0.0.0.0 2011-08-10 16:44:30 DEBUG [glance-api] registry_port 9191 2011-08-10 16:44:30 DEBUG [glance-api] s3_store_access_key <20-char AWS access key> 2011-08-10 16:44:30 DEBUG [glance-api] s3_store_bucket <lowercased 20-char="" aws="" access="" key="">glance 2011-08-10 16:44:30 DEBUG [glance-api] s3_store_create_bucket_on_put False 2011-08-10 16:44:30 DEBUG [glance-api] s3_store_host 127.0.0.1:8080/v1.0/ 2011-08-10 16:44:30 DEBUG [glance-api] s3_store_secret_key <40-char AWS secret key> 2011-08-10 16:44:30 DEBUG [glance-api] swift_enable_snet False 2011-08-10 16:44:30 DEBUG [glance-api] swift_store_auth_address 172.17.1.125:443/v1.0/ 2011-08-10 16:44:30 DEBUG [glance-api] swift_store_container glance 2011-08-10 16:44:30 DEBUG [glance-api] swift_store_create_container_on_put True 2011-08-10 16:44:30 DEBUG [glance-api] swift_store_key testing 2011-08-10 16:44:30 DEBUG [glance-api] swift_store_user test:tester 2011-08-10 16:44:30 DEBUG [glance-api] verbose True 2011-08-10 16:44:30 DEBUG [glance-api] ************************* 2011-08-10 16:44:30 DEBUG [routes.middleware] Initialized with method overriding = True, and path info altering = True 2011-08-10 16:44:30 DEBUG [eventlet.wsgi.server] (678) wsgi starting up on http://0.0.0.0:9292/ 2011-08-10 16:45:34 DEBUG [glance.api.middleware.version_negotiation] Processing request: POST /v1/images Accept: 2011-08-10 16:45:34 DEBUG [glance.api.middleware.version_negotiation] Matched versioned URI. Version: 1.0 2011-08-10 16:45:34 DEBUG [routes.middleware] Matched POST /images 2011-08-10 16:45:34 DEBUG [routes.middleware] Route path: 'images', defaults: {'action': u'create', 'controller': <glance.common.wsgi.resource object="" at="" 0x2999a50="">} 2011-08-10 16:45:34 DEBUG [routes.middleware] Match dict: {'action': u'create', 'controller': <glance.common.wsgi.resource object="" at="" 0x2999a50="">} 2011-08-10 16:45:34 DEBUG [glance.registry] Adding image metadata... 2011-08-10 16:45:34 DEBUG [glance.registry] container_format: ovf 2011-08-10 16:45:34 DEBUG [glance.registry] disk_format: raw 2011-08-10 16:45:34 DEBUG [glance.registry] is_public: True 2011-08-10 16:45:34 DEBUG [glance.registry] name: s2 2011-08-10 16:45:34 DEBUG [glance.registry] size: 0 2011-08-10 16:45:34 DEBUG [glance.registry] status: queued 2011-08-10 16:45:34 DEBUG [glance.registry] Returned image metadata from call to RegistryClient.add_image(): 2011-08-10 16:45:34 DEBUG [glance.registry] checksum: None 2011-08-10 16:45:34 DEBUG [glance.registry] container_format: ovf 2011-08-10 16:45:34 DEBUG [glance.registry] created_at: 2011-08-10T08:45:34.533024 2011-08-10 16:45:34 DEBUG [glance.registry] deleted: False 2011-08-10 16:45:34 DEBUG [glance.registry] deleted_at: None 2011-08-10 16:45:34 DEBUG [glance.registry] disk_format: raw 2011-08-10 16:45:34 DEBUG [glance.registry] id: 16 2011-08-10 16:45:34 DEBUG [glance.registry] is_public: True 2011-08-10 16:45:34 DEBUG [glance.registry] location: None 2011-08-10 16:45:34 DEBUG [glance.registry] name: s2 2011-08-10 16:45:34 DEBUG [glance.registry] owner: None 2011-08-10 16:45:34 DEBUG [glance.registry] size: 0 2011-08-10 16:45:34 DEBUG [glance.registry] status: queued 2011-08-10 16:45:34 DEBUG [glance.registry] updated_at: None 2011-08-10 16:45:34 DEBUG [glance.api.v1.images] Setting image 16 to status 'saving' 2011-08-10 16:45:34 DEBUG [glance.registry] Updating image metadata for image 16... 2011-08-10 16:45:34 DEBUG [glance.registry] status: saving 2011-08-10 16:45:34 DEBUG [glance.registry] Returned image metadata from call to RegistryClient.update_image(): 2011-08-10 16:45:34 DEBUG [glance.registry] checksum: None 2011-08-10 16:45:34 DEBUG [glance.registry] container_format: ovf 2011-08-10 16:45:34 DEBUG [glance.registry] created_at: 2011-08-10T08:45:34.533024 2011-08-10 16:45:34 DEBUG [glance.registry] deleted: False 2011-08-10 16:45:34 DEBUG [glance.registry] deleted_at: None 2011-08-10 16:45:34 DEBUG [glance.registry] disk_format: raw 2011-08-10 16:45:34 DEBUG [glance.registry] id: 16 2011-08-10 16:45:34 DEBUG [glance.registry] is_public: True 2011-08-10 16:45:34 DEBUG [glance.registry] location: None 2011-08-10 16:45:34 DEBUG [glance.registry] name: s2 2011-08-10 16:45:34 DEBUG [glance.registry] owner: None 2011-08-10 16:45:34 DEBUG [glance.registry] size: 0 2011-08-10 16:45:34 DEBUG [glance.registry] status: saving 2011-08-10 16:45:34 DEBUG [glance.registry] updated_at: 2011-08-10T08:45:34.629167 2011-08-10 16:45:34 DEBUG [glance.api.v1.images] Uploading image data for image 16 to swift store 2011-08-10 16:45:34 DEBUG [glance.store.swift] Creating Swift connection with (auth_address=https://172.17.1.125:443/v1.0/, user=test:tester, key=testing, snet=False) 2011-08-10 16:45:34 ERROR [glance.api.v1.images] Error uploading image: global name 'swift_client' is not defined 2011-08-10 16:45:34 DEBUG [glance.registry] Updating image metadata for image 16... 2011-08-10 16:45:34 DEBUG [glance.registry] status: killed 2011-08-10 16:45:34 DEBUG [glance.registry] Returned image metadata from call to RegistryClient.update_image(): 2011-08-10 16:45:34 DEBUG [glance.registry] checksum: None 2011-08-10 16:45:34 DEBUG [glance.registry] container_format: ovf 2011-08-10 16:45:34 DEBUG [glance.registry] created_at: 2011-08-10T08:45:34.533024 2011-08-10 16:45:34 DEBUG [glance.registry] deleted: False 2011-08-10 16:45:34 DEBUG [glance.registry] deleted_at: None 2011-08-10 16:45:34 DEBUG [glance.registry] disk_format: raw 2011-08-10 16:45:34 DEBUG [glance.registry] id: 16 2011-08-10 16:45:34 DEBUG [glance.registry] is_public: True 2011-08-10 16:45:34 DEBUG [glance.registry] location: None 2011-08-10 16:45:34 DEBUG [glance.registry] name: s2 2011-08-10 16:45:34 DEBUG [glance.registry] owner: None 2011-08-10 16:45:34 DEBUG [glance.registry] size: 0 2011-08-10 16:45:34 DEBUG [glance.registry] status: killed 2011-08-10 16:45:34 DEBUG [glance.registry] updated_at: 2011-08-10T08:45:34.709725 2011-08-10 16:45:34 DEBUG [eventlet.wsgi.server] 127.0.0.1 - - [10/Aug/2011 16:45:34] "POST /v1/images HTTP/1.1" 400 310 0.256314

Can any of you give some help? Thanks in advance!