Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [root@nailgun ~]# cat /etc/fuel/version.yaml
- VERSION:
- feature_groups:
- - mirantis
- production: "docker"
- release: "8.0"
- api: "1.0"
- build_number: "429"
- build_id: "429"
- fuel-nailgun_sha: "12b15b2351e250af41cc0b10d63a50c198fe77d8"
- python-fuelclient_sha: "4f234669cfe88a9406f4e438b1e1f74f1ef484a5"
- fuel-agent_sha: "df16d41cd7a9445cf82ad9fd8f0d53824711fcd8"
- fuel-nailgun-agent_sha: "92ebd5ade6fab60897761bfa084aefc320bff246"
- astute_sha: "c7ca63a49216744e0bfdfff5cb527556aad2e2a5"
- fuel-library_sha: "3eaf4f4a9b88b287a10cc19e9ce6a62298cc4013"
- fuel-ostf_sha: "214e794835acc7aa0c1c5de936e93696a90bb57a"
- fuel-mirror_sha: "b62f3cce5321fd570c6589bc2684eab994c3f3f2"
- fuelmenu_sha: "85de57080a18fda18e5325f06eaf654b1b931592"
- shotgun_sha: "63645dea384a37dde5c01d4f8905566978e5d906"
- network-checker_sha: "9f0ba4577915ce1e77f5dc9c639a5ef66ca45896"
- fuel-upgrade_sha: "616a7490ec7199f69759e97e42f9b97dfc87e85b"
- fuelmain_sha: "e8e36cff332644576d7853c80b8a53d5b955420a"
- root@node-1:~# nova image-list
- +--------------------------------------+--------+--------+--------+
- | ID | Name | Status | Server |
- +--------------------------------------+--------+--------+--------+
- | d0b55629-c0f9-47b2-875d-e12633177fd3 | TestVM | ACTIVE | |
- +--------------------------------------+--------+--------+--------+
- root@node-1:~# nova flavor-list | grep m1.micro
- | ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e | m1.micro | 64 | 0 | 0 | | 1 | 1.0 | True |
- root@node-1:~# neutron net-list
- +--------------------------------------+--------------------+-------------------------------------------------------+
- | id | name | subnets |
- +--------------------------------------+--------------------+-------------------------------------------------------+
- | a1ee8588-817a-4428-b079-cbf3fb2cfee1 | admin_floating_net | 20a681d7-7fb2-4086-b256-f6a3c30bd1a5 10.177.8.0/24 |
- | fa550d0d-afde-49fb-8aca-a2f30abc8dc6 | admin_internal_net | 696d27d5-b65a-4510-a6a8-458c900124e4 192.168.111.0/24 |
- +--------------------------------------+--------------------+-------------------------------------------------------+
- root@node-1:~# nova hypervisor-list
- +----+--------------------------+-------+---------+
- | ID | Hypervisor hostname | State | Status |
- +----+--------------------------+-------+---------+
- | 1 | node-5.test.domain.local | up | enabled |
- | 4 | node-4.test.domain.local | up | enabled |
- +----+--------------------------+-------+---------+
- root@node-1:~# nova list --all-tenant
- +----+------+-----------+--------+------------+-------------+----------+
- | ID | Name | Tenant ID | Status | Task State | Power State | Networks |
- +----+------+-----------+--------+------------+-------------+----------+
- +----+------+-----------+--------+------------+-------------+----------+
- [root@nailgun ~]# for i in $(fuel node | awk '/compute/ {print $1}'); do ssh 2>/dev/null node-$i "ls -l /var/lib/nova/instances/" ; done
- total 4
- drwxr-xr-x 2 nova nova 53 Jan 21 13:45 _base
- -rw-r--r-- 1 nova nova 46 Jan 22 13:52 compute_nodes
- drwxr-xr-x 2 nova nova 91 Jan 21 13:45 locks
- total 4
- drwxr-xr-x 2 nova nova 53 Jan 22 13:47 _base
- -rw-r--r-- 1 nova nova 46 Jan 22 14:04 compute_nodes
- drwxr-xr-x 2 nova nova 91 Jan 22 13:47 locks
- root@node-1:~# cat ./test1.py
- #!/usr/bin/env python
- import datetime
- import time
- from novaclient.client import Client
- flavor_id = "ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e"
- image_id = "d0b55629-c0f9-47b2-875d-e12633177fd3" #Cirros
- net_id = "fa550d0d-afde-49fb-8aca-a2f30abc8dc6"
- nova_client = Client('2',
- username="admin",
- api_key="admin",
- auth_url="http://10.177.8.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 %s" % flavor_id)
- 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)
- root@node-1:~#
- root@node-1:~# python ./test1.py
- start of api............ 1
- Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
- deleting instance during resize
- start of api............ 2
- Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
- deleting instance during resize
- start of api............ 3
- Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
- deleting instance during resize
- start of api............ 4
- Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
- deleting unconfirmed resize instance
- start of api............ 5
- Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
- deleting instance during resize
- start of api............ 6
- Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
- deleting instance during resize
- start of api............ 7
- Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
- deleting instance during resize
- start of api............ 8
- Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
- deleting instance during resize
- start of api............ 9
- Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
- deleting instance during resize
- start of api............ 10
- Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
- deleting instance during resize
- Total instance delete attempts during resize = 10
- [root@nailgun ~]# date
- Fri Jan 22 14:37:57 UTC 2016
- [root@nailgun ~]# for i in $(fuel node | awk '/compute/ {print $1}'); do ssh 2>/dev/null node-$i "ls -l /var/lib/nova/instances/" ; done
- total 4
- drwxr-xr-x 2 nova nova 69 Jan 22 14:32 32b6b707-8e80-42bd-a46f-aeaf30d7a543_resize
- drwxr-xr-x 2 nova nova 17 Jan 22 14:34 41b74ea7-40b5-40d3-b362-f5dfe46b2293_del
- drwxr-xr-x 2 nova nova 69 Jan 22 14:34 41b74ea7-40b5-40d3-b362-f5dfe46b2293_resize
- drwxr-xr-x 2 nova nova 53 Jan 22 13:47 _base
- drwxr-xr-x 2 nova nova 69 Jan 22 14:33 c6d06fa3-c5c3-44f5-acb0-f05bc6a2ac49_resize
- -rw-r--r-- 1 nova nova 46 Jan 22 14:04 compute_nodes
- drwxr-xr-x 2 nova nova 91 Jan 22 13:47 locks
- total 4
- drwxr-xr-x 2 nova nova 69 Jan 22 14:34 143cdacb-143a-4a79-9a38-bca61a6fdb25_resize
- drwxr-xr-x 2 nova nova 17 Jan 22 14:37 179032b3-d700-4300-9b8e-c2aa893d45a8_del
- drwxr-xr-x 2 nova nova 69 Jan 22 14:37 179032b3-d700-4300-9b8e-c2aa893d45a8_resize
- drwxr-xr-x 2 nova nova 69 Jan 22 14:32 32b6b707-8e80-42bd-a46f-aeaf30d7a543
- drwxr-xr-x 2 nova nova 53 Jan 21 13:45 _base
- -rw-r--r-- 1 nova nova 47 Jan 22 14:33 compute_nodes
- drwxr-xr-x 2 nova nova 69 Jan 22 14:35 ff1f36ba-bd5c-4670-a5fb-0d9a9fd1d7bd_resize
- drwxr-xr-x 2 nova nova 91 Jan 21 13:45 locks
- [root@nailgun ~]# date
- Fri Jan 22 14:45:53 UTC 2016
- [root@nailgun ~]# for i in $(fuel node | awk '/compute/ {print $1}'); do ssh 2>/dev/null node-$i "ls -l /var/lib/nova/instances/" ; done
- total 4
- drwxr-xr-x 2 nova nova 53 Jan 22 13:47 _base
- -rw-r--r-- 1 nova nova 47 Jan 22 14:45 compute_nodes
- drwxr-xr-x 2 nova nova 91 Jan 22 13:47 locks
- total 4
- drwxr-xr-x 2 nova nova 53 Jan 21 13:45 _base
- -rw-r--r-- 1 nova nova 47 Jan 22 14:33 compute_nodes
- drwxr-xr-x 2 nova nova 91 Jan 21 13:45 locks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement