Can't create image with "default_store = vsphere"

Bug #1327154 reported by Kai Tong
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Glance
New
Undecided
Koichi Yoshigoe

Bug Description

-=======================================================================================================
Can't create image with "default_store = vsphere"

I have tried to create image using the vsphere as the default store in below 2 ways: both don't work.

1) touch /tmp/m.vmdk
glance image-create --name test_template  --is-public=True --container-format=bare --disk-format=vmdk --property vmware_disktype=thin --property template_name=<your template name in vCenter> < /tmp/m.vmdk

This is failing with

Request returned failure status.
500 Internal Server Error
GL-F9EE247 Failed to upload image ea14f049-1172-4167-bcb4-31e9bdcfc0bc
    (HTTP 500)

Below is the error stack:
2014-06-04 18:32:35.181 11151 ERROR glance.store.vmware_datastore [2e6bb6a1-e25e-4e74-811b-38ba14ee7b2e ed37da8c71184ac1a28da5e30e0a82c9 ad9aba13a40e473abfcbb69d2eda313d - - -] GL-6FC93E4 Failed to upload content of image 5011db19-04fc-4699-b850-6f6efe9439d7
2014-06-04 18:32:35.183 11151 ERROR glance.api.v1.upload_utils [2e6bb6a1-e25e-4e74-811b-38ba14ee7b2e ed37da8c71184ac1a28da5e30e0a82c9 ad9aba13a40e473abfcbb69d2eda313d - - -] GL-F9EE247 Failed to upload image 5011db19-04fc-4699-b850-6f6efe9439d7
2014-06-04 18:32:35.183 11151 TRACE glance.api.v1.upload_utils Traceback (most recent call last):
2014-06-04 18:32:35.183 11151 TRACE glance.api.v1.upload_utils File "/usr/lib/python2.6/site-packages/glance/api/v1/upload_utils.py", line 99, in upload_data_to_store
2014-06-04 18:32:35.183 11151 TRACE glance.api.v1.upload_utils store)
2014-06-04 18:32:35.183 11151 TRACE glance.api.v1.upload_utils File "/usr/lib/python2.6/site-packages/glance/store/__init__.py", line 382, in store_add_to_backend
2014-06-04 18:32:35.183 11151 TRACE glance.api.v1.upload_utils (location, size, checksum, metadata) = store.add(image_id, data, size)
2014-06-04 18:32:35.183 11151 TRACE glance.api.v1.upload_utils File "/usr/lib/python2.6/site-packages/glance/store/vmware_datastore.py", line 292, in add
2014-06-04 18:32:35.183 11151 TRACE glance.api.v1.upload_utils body=res.read())
2014-06-04 18:32:35.183 11151 TRACE glance.api.v1.upload_utils UnexpectedStatus: GL-ECBEA55 The request returned an unexpected status: 404.
2014-06-04 18:32:35.183 11151 TRACE glance.api.v1.upload_utils
2014-06-04 18:32:35.183 11151 TRACE glance.api.v1.upload_utils The response body:
2014-06-04 18:32:35.183 11151 TRACE glance.api.v1.upload_utils
2014-06-04 18:32:35.183 11151 TRACE glance.api.v1.upload_utils

2) glance image-create --name debian-2.6.32 --disk-format vmdk --container-format bare --is-public true --property vmware_adaptertype="lsiLogic" --property vmware_disktype="preallocated" --property hypervisor_type="vmware" --property vmware_ostype="ubuntu64Guest" < /images/debian-2.6.32-i686.vmdk

This is failing with

Request returned failure status.
400 Bad Request
GL-4314F1B Client disconnected before sending all data to backend
    (HTTP 400)
Below is the error stack:
2014-06-04 18:33:05.594 11151 ERROR glance.store.vmware_datastore [74fe0f17-92e8-421c-b573-97876cda64ad ed37da8c71184ac1a28da5e30e0a82c9 ad9aba13a40e473abfcbb69d2eda313d - - -] GL-6FC93E4 Failed to upload content of image 4b35fc6a-e60d-4194-8974-c37a9bec370b
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore Traceback (most recent call last):
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore File "/usr/lib/python2.6/site-packages/glance/store/vmware_datastore.py", line 276, in add
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore content=image_file)
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore File "/usr/lib/python2.6/site-packages/glance/store/vmware_datastore.py", line 408, in _get_http_conn
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore conn.request(method, url, content, headers)
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore File "/usr/lib64/python2.6/httplib.py", line 920, in request
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore self._send_request(method, url, body, headers)
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore File "/usr/lib64/python2.6/httplib.py", line 954, in _send_request
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore self.send(body)
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore File "/usr/lib64/python2.6/httplib.py", line 756, in send
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore self.sock.sendall(data)
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore File "/usr/lib/python2.6/site-packages/eventlet/green/ssl.py", line 131, in sendall
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore v = self.send(data[count:])
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore File "/usr/lib/python2.6/site-packages/eventlet/green/ssl.py", line 107, in send
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore super(GreenSSLSocket, self).send, data, flags)
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore File "/usr/lib/python2.6/site-packages/eventlet/green/ssl.py", line 77, in _call_trampolining
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore return func(*a, **kw)
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore File "/usr/lib64/python2.6/ssl.py", line 174, in send
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore v = self._sslobj.write(data)
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore error: [Errno 32] Broken pipe
2014-06-04 18:33:05.594 11151 TRACE glance.store.vmware_datastore

Revision history for this message
Robert Sander (gurubert) wrote :

Looks like a duplicate of bug #1240355

Revision history for this message
Kai Tong (tongkai) wrote :

Below is the configuration of glance-api.conf:
 # ============ VMware Datastore Store Options =====================

# ESX/ESXi or vCenter Server target system.
# The server value can be an IP address or a DNS name
# e.g. 127.0.0.1, 127.0.0.1:443, www.vmware-infra.com
vmware_server_host = 192.168.80.7

# Server username (string value)
vmware_server_username = Administrator

# Server password (string value)
vmware_server_password =  W0lCTTp2MV1DbmZmajBlcQ==

# Inventory path to a datacenter (string value)
# Value optional when vmware_server_ip is an ESX/ESXi host: if specified
# should be `ha-datacenter`.
vmware_datacenter_path = VCENTER_PVT2

# Datastore associated with the datacenter (string value)
vmware_datastore_name = PROV_PVT2/LUN36_PVT2

# The number of times we retry on failures
# e.g., socket error, etc (integer value)
vmware_api_retry_count = 10

# The interval used for polling remote tasks
# invoked on VMware ESX/VC server in seconds (integer value)
vmware_task_poll_interval = 5

# Absolute path of the folder containing the images in the datastore
# (string value)
vmware_store_image_dir = /VMWLinux16

# Allow to perform insecure SSL requests to the target system (boolean value)
vmware_api_insecure = false

Koichi Yoshigoe (degdoo)
Changed in glance:
assignee: nobody → Koichi Yoshigoe (degdoo)
Revision history for this message
Koichi Yoshigoe (degdoo) wrote :

Currently, If datastore is under folder/datastore-cluster, glance cannot recognize the datastore.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.