create multiple instances using python sdk

asked 2019-03-25 09:13:24 -0500

najeh gravatar image

updated 2019-03-30 12:02:44 -0500

I tried to create more than one instance at time using OpenStack python SDK with min_count and max_count. I cited below my code that creates just one instance, where is the problem?

def create_instance(instance_name, image_id, flavor_id, security_group_name, key_name, min_count, max_count):                                                                                           testing_instance = conn.compute.create_server(name=instance_name, image_id=image_id, flavor_id=flavor_id, 
                                           security_group_name=security_group_name, key_name=key_name, 
                                           min_count=min_count, max_count=max_count)                                                 testing_instance = conn.compute.wait_for_server(testing_instance)                                                     create_instance('vm', '43d8bf3b-1fcc-4796-ab83-16b1c2591367', '2', 'default', 'mkey', '2', '2')
edit retag flag offensive close merge delete