Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [root@nailgun ~]# fuel --f
- DEPRECATION WARNING: /etc/fuel/client/config.yaml exists and will be used as the source for settings. This behavior is deprecated. Please specify the path to your custom settings file in the FUELCLIENT_CUSTOM_SETTINGS environment variable.
- api: '1.0'
- astute_sha: 6c5b73f93e24cc781c809db9159927655ced5012
- auth_required: true
- build_id: '301'
- build_number: '301'
- feature_groups:
- - mirantis
- fuel-agent_sha: 50e90af6e3d560e9085ff71d2950cfbcca91af67
- fuel-library_sha: 5d50055aeca1dd0dc53b43825dc4c8f7780be9dd
- fuel-nailgun-agent_sha: d7027952870a35db8dc52f185bb1158cdd3d1ebd
- fuel-ostf_sha: 2cd967dccd66cfc3a0abd6af9f31e5b4d150a11c
- fuelmain_sha: a65d453215edb0284a2e4761be7a156bb5627677
- nailgun_sha: 4162b0c15adb425b37608c787944d1983f543aa8
- openstack_version: 2015.1.0-7.0
- production: docker
- python-fuelclient_sha: 486bde57cda1badb68f915f66c61b544108606f3
- release: '7.0'
- release_versions:
- 2015.1.0-7.0:
- VERSION:
- api: '1.0'
- astute_sha: 6c5b73f93e24cc781c809db9159927655ced5012
- build_id: '301'
- build_number: '301'
- feature_groups:
- - mirantis
- fuel-agent_sha: 50e90af6e3d560e9085ff71d2950cfbcca91af67
- fuel-library_sha: 5d50055aeca1dd0dc53b43825dc4c8f7780be9dd
- fuel-nailgun-agent_sha: d7027952870a35db8dc52f185bb1158cdd3d1ebd
- fuel-ostf_sha: 2cd967dccd66cfc3a0abd6af9f31e5b4d150a11c
- fuelmain_sha: a65d453215edb0284a2e4761be7a156bb5627677
- nailgun_sha: 4162b0c15adb425b37608c787944d1983f543aa8
- openstack_version: 2015.1.0-7.0
- production: docker
- python-fuelclient_sha: 486bde57cda1badb68f915f66c61b544108606f3
- release: '7.0'
- Env details:
- root@node-1:~# nova image-list
- +--------------------------------------+--------+--------+--------+
- | ID | Name | Status | Server |
- +--------------------------------------+--------+--------+--------+
- | 94b9d222-dce4-4289-bd03-a4816d3e1c2c | TestVM | ACTIVE | |
- +--------------------------------------+--------+--------+--------+
- root@node-1:~# nova flavor-list | grep m1.micro
- | a717b418-c6eb-47f4-a8a1-eb89ac9fbdd7 | m1.micro | 64 | 0 | 0 | | 1 | 1.0 | True |
- root@node-1:~# neutron net-list
- +--------------------------------------+-----------+-------------------------------------------------------+
- | id | name | subnets |
- +--------------------------------------+-----------+-------------------------------------------------------+
- | 484fda23-4fa2-4213-b4c2-31f5c76f54a5 | net04_ext | 160c54d8-7747-4b25-bac0-a6fd40b475f6 10.177.6.0/24 |
- | 81931911-b050-44cd-b6fe-681c534a73fb | net04 | cc611f67-8903-413c-834d-db475102972d 192.168.111.0/24 |
- root@node-1:~# nova list --all-tenant
- +--------------------------------------+-------+----------------------------------+--------+------------+-------------+---------------------+
- | ID | Name | Tenant ID | Status | Task State | Power State | Networks |
- +--------------------------------------+-------+----------------------------------+--------+------------+-------------+---------------------+
- | b2c4db87-fdc4-4421-a2fb-7e7b5a50a576 | test | c1bf0d7c0a1c49c4a96ae3581f165ecf | ACTIVE | - | Running | net04=192.168.111.6 |
- | abf51202-8850-473b-adb6-33f11ec5176b | test1 | c1bf0d7c0a1c49c4a96ae3581f165ecf | ACTIVE | - | Running | net04=192.168.111.5 |
- +--------------------------------------+-------+----------------------------------+--------+------------+-------------+---------------------+
- root@node-1:~# nova hypervisor-list
- +----+--------------------------+-------+---------+
- | ID | Hypervisor hostname | State | Status |
- +----+--------------------------+-------+---------+
- | 2 | node-5.test.domain.local | up | enabled |
- | 5 | node-4.test.domain.local | up | enabled |
- +----+--------------------------+-------+---------+
- I use script attached in upstream desctiption with some modifications:
- #!/usr/bin/env python
- #__author__ = 'ankit.dddagrawal'
- import datetime
- import time
- from novaclient.client import Client
- flavor_id = "a717b418-c6eb-47f4-a8a1-eb89ac9fbdd7"
- image_id = "94b9d222-dce4-4289-bd03-a4816d3e1c2c" #Cirros
- net_id = "81931911-b050-44cd-b6fe-681c534a73fb"
- nova_client = Client('2',
- username="admin",
- api_key="admin",
- auth_url="http://10.177.6.3:5000/v2.0",
- project_id="admin")
- def resize_instance(api_no):
- print "start of api............", api_no
- instance = nova_client.servers.create(name="test_%s"%api_no,
- image=image_id,
- flavor=flavor_id,
- nics=[{'net-id': net_id}])
- def _resize_instance():
- instance_obj = nova_client.servers.get(instance)
- instance_status = instance_obj.status
- if instance_status == 'ACTIVE':
- print("Resize instance with flavor m1.tiny")
- nova_client.servers.resize(instance, 1)
- return
- elif instance_status == 'ERROR':
- instance_status = instance_obj.to_dict()['fault']
- print("Instance is in error state %s" %instance_status)
- else:
- time.sleep(2)
- _resize_instance()
- _resize_instance()
- def _delete_instance():
- instance_obj = nova_client.servers.get(instance)
- instance_dict = instance_obj.to_dict()
- task_state = instance_dict['OS-EXT-STS:task_state']
- vm_state = instance_dict['OS-EXT-STS:vm_state']
- if task_state == 'resize_migrated':
- print("deleting instance during resize")
- nova_client.servers.delete(instance)
- elif vm_state == 'resized':
- print("deleting unconfirmed resize instance")
- nova_client.servers.delete(instance)
- else:
- time.sleep(2)
- _delete_instance()
- _delete_instance()
- if __name__ == '__main__':
- start_time = datetime.datetime.now()
- duration = 60*240 #in seconds
- test_end_time = time.time() + duration
- total_count = 0
- #while 1:
- for _ in xrange(10):
- t = time.time()
- vm_count = len(nova_client.servers.list())
- if t >= test_end_time:
- print("---------end of api calls--------")
- break
- total_count += 1
- try:
- resize_instance(total_count)
- except Exception as e:
- print ("Exit on exception %s " %e)
- break
- print("Total instance delete attempts during resize = %s" % total_count)
- Script output:
- root@node-1:~# python ./test_resize.py
- start of api............ 1
- Resize instance with flavor m1.tiny
- deleting instance during resize
- start of api............ 2
- Resize instance with flavor m1.tiny
- deleting instance during resize
- start of api............ 3
- Resize instance with flavor m1.tiny
- deleting instance during resize
- start of api............ 4
- Resize instance with flavor m1.tiny
- deleting instance during resize
- start of api............ 5
- Resize instance with flavor m1.tiny
- deleting instance during resize
- start of api............ 6
- Resize instance with flavor m1.tiny
- deleting instance during resize
- start of api............ 7
- Resize instance with flavor m1.tiny
- deleting unconfirmed resize instance
- start of api............ 8
- Resize instance with flavor m1.tiny
- deleting instance during resize
- start of api............ 9
- Resize instance with flavor m1.tiny
- deleting instance during resize
- start of api............ 10
- Resize instance with flavor m1.tiny
- deleting instance during resize
- Total instance delete attempts during resize = 10
- Results:
- compute-4:
- root@node-4:~# ls -l /var/lib/nova/instances/
- total 4
- drwxr-xr-x 3 nova nova 94 Nov 2 15:51 0d58d3b6-11d6-4441-8ee9-4880a5493e77_del
- drwxr-xr-x 2 nova nova 69 Nov 2 15:48 0d58d3b6-11d6-4441-8ee9-4880a5493e77_resize
- drwxr-xr-x 2 nova nova 69 Nov 2 15:53 388eb8be-f3ac-4e7e-8af8-20e8688421fd_resize
- drwxr-xr-x 2 nova nova 17 Nov 2 15:52 9bd302a9-5775-4882-82bb-29f7bc5724f9_del
- drwxr-xr-x 2 nova nova 69 Nov 2 15:52 9bd302a9-5775-4882-82bb-29f7bc5724f9_resize
- drwxr-xr-x 2 nova nova 53 Sep 29 12:44 _base
- -rw-r--r-- 1 nova nova 46 Nov 2 15:17 compute_nodes
- drwxr-xr-x 2 nova nova 91 Sep 29 12:44 locks
- root@node-4:~# ls -l /var/lib/nova/instances/
- total 4
- drwxr-xr-x 2 nova nova 53 Sep 29 12:44 _base
- -rw-r--r-- 1 nova nova 46 Nov 2 15:17 compute_nodes
- drwxr-xr-x 2 nova nova 91 Sep 29 12:44 locks
- compute-5:
- root@node-5:~# ls -l /var/lib/nova/instances/
- total 4
- drwxr-xr-x 2 nova nova 69 Nov 2 14:44 abf51202-8850-473b-adb6-33f11ec5176b
- drwxr-xr-x 2 nova nova 69 Nov 2 15:30 b2c4db87-fdc4-4421-a2fb-7e7b5a50a576
- drwxr-xr-x 2 nova nova 53 Nov 2 14:44 _base
- -rw-r--r-- 1 nova nova 47 Nov 2 15:36 compute_nodes
- drwxr-xr-x 2 nova nova 91 Nov 2 14:44 locks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement