I'm new to openstack and i'm trying to access openstack services using python SDK . I tried to upload an image to openstack using create function with data (image to be written) of the image included as parameter , the script executed and there wasn't any error , but when I logged in and navigated to images tab in the openstack dashboard, image has been created but status of image was always in queued . I tried adding the upload function from openstack library , this time the image's status changed to Active but size of the image was only in bytes (The original size of the image was 12 MB). I'm not understanding where the data is getting missed . I even tried logging in using keystone identity library , still the same scenario continues to happen . Any help would be greatly useful. Thanks in advance
def upload_image():
# imagefile = 'CirrOS.qcow2'
# loader = loading.get_plugin_loader('password')
auth = v3.Password(user_domain_name='******',
username='***',
password='***',
project_domain_name='******',
project_name='***',
auth_url='http://*.*.*.**:****/v3')
sess = session.Session(auth=auth)
glance = client.Client(session=sess)
# with open(imagefile, 'rb'):
image = glance.images.create(name="my_image", is_public='True', disk_format="qcow2",
container_format="bare", data='CirrOS.qcow2')
glance.images.upload(image.id, image_data='CirrOS.qcow2')