Sure, here is a short code sample that reproduces the problem for me:
from openstack import connection
#Adjust these credentials according to your openstack installation username = "demo" password = "openstack2016" auth_url_sdk = "http://10.10.0.1:5000/v3" user_domain_name = "Default" project_domain_name = "Default" project_name = "demo"
conn = connection.Connection( auth_url=auth_url_sdk, project_name=project_name, project_domain_name=project_domain_name, username=username, user_domain_name=user_domain_name, password=password) image_service = conn.image compute_service = conn.compute
#Using cirros image, which is usually pre-built with openstack/devstack image = image_service.find_image('cirros-0.3.4-x86_64-uec') flavor = compute_service.find_flavor('m1.tiny')
user_instance = compute_service.create_server( name="TEST", image_id=image.id, flavor_id=flavor.id) compute_service.wait_for_status(user_instance, status='ACTIVE')
compute_service.create_server_image(user_instance, "Snapshot") image = image_service.find_image("Snapshot") image_service.wait_for_status(image, 'active')
filename = "%s.img" % image.name with open(str(filename), 'w+') as imgFile: for chunk in image.download(conn.image.session): imgFile.write(chunk)
Sure, here is a short code sample that reproduces the problem for me:
from openstack import connection
#Adjust these credentials according to your openstack installation 10.10.0. 1:5000/ v3"
username = "demo"
password = "openstack2016"
auth_url_sdk = "http://
user_domain_name = "Default"
project_domain_name = "Default"
project_name = "demo"
conn = connection. Connection(
auth_url= auth_url_ sdk,
project_ name=project_ name,
project_ domain_ name=project_ domain_ name,
username= username,
user_domain_ name=user_ domain_ name,
password= password)
image_service = conn.image
compute_service = conn.compute
#Using cirros image, which is usually pre-built with openstack/devstack find_image( 'cirros- 0.3.4-x86_ 64-uec' ) service. find_flavor( 'm1.tiny' )
image = image_service.
flavor = compute_
user_instance = compute_ service. create_ server( id=flavor. id) service. wait_for_ status( user_instance, status='ACTIVE')
name="TEST",
image_id=image.id,
flavor_
compute_
compute_ service. create_ server_ image(user_ instance, "Snapshot") find_image( "Snapshot" ) wait_for_ status( image, 'active')
image = image_service.
image_service.
filename = "%s.img" % image.name conn.image. session) :
imgFile. write(chunk)
with open(str(filename), 'w+') as imgFile:
for chunk in image.download(