Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.12 KB | None | 0 0
  1.  
  2. [root@nailgun ~]# cat /etc/fuel/version.yaml
  3. VERSION:
  4. feature_groups:
  5. - mirantis
  6. production: "docker"
  7. release: "8.0"
  8. api: "1.0"
  9. build_number: "429"
  10. build_id: "429"
  11. fuel-nailgun_sha: "12b15b2351e250af41cc0b10d63a50c198fe77d8"
  12. python-fuelclient_sha: "4f234669cfe88a9406f4e438b1e1f74f1ef484a5"
  13. fuel-agent_sha: "df16d41cd7a9445cf82ad9fd8f0d53824711fcd8"
  14. fuel-nailgun-agent_sha: "92ebd5ade6fab60897761bfa084aefc320bff246"
  15. astute_sha: "c7ca63a49216744e0bfdfff5cb527556aad2e2a5"
  16. fuel-library_sha: "3eaf4f4a9b88b287a10cc19e9ce6a62298cc4013"
  17. fuel-ostf_sha: "214e794835acc7aa0c1c5de936e93696a90bb57a"
  18. fuel-mirror_sha: "b62f3cce5321fd570c6589bc2684eab994c3f3f2"
  19. fuelmenu_sha: "85de57080a18fda18e5325f06eaf654b1b931592"
  20. shotgun_sha: "63645dea384a37dde5c01d4f8905566978e5d906"
  21. network-checker_sha: "9f0ba4577915ce1e77f5dc9c639a5ef66ca45896"
  22. fuel-upgrade_sha: "616a7490ec7199f69759e97e42f9b97dfc87e85b"
  23. fuelmain_sha: "e8e36cff332644576d7853c80b8a53d5b955420a"
  24.  
  25.  
  26. root@node-1:~# nova image-list
  27. +--------------------------------------+--------+--------+--------+
  28. | ID | Name | Status | Server |
  29. +--------------------------------------+--------+--------+--------+
  30. | d0b55629-c0f9-47b2-875d-e12633177fd3 | TestVM | ACTIVE | |
  31. +--------------------------------------+--------+--------+--------+
  32.  
  33. root@node-1:~# nova flavor-list | grep m1.micro
  34. | ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e | m1.micro | 64 | 0 | 0 | | 1 | 1.0 | True |
  35.  
  36. root@node-1:~# neutron net-list
  37. +--------------------------------------+--------------------+-------------------------------------------------------+
  38. | id | name | subnets |
  39. +--------------------------------------+--------------------+-------------------------------------------------------+
  40. | a1ee8588-817a-4428-b079-cbf3fb2cfee1 | admin_floating_net | 20a681d7-7fb2-4086-b256-f6a3c30bd1a5 10.177.8.0/24 |
  41. | fa550d0d-afde-49fb-8aca-a2f30abc8dc6 | admin_internal_net | 696d27d5-b65a-4510-a6a8-458c900124e4 192.168.111.0/24 |
  42. +--------------------------------------+--------------------+-------------------------------------------------------+
  43.  
  44. root@node-1:~# nova hypervisor-list
  45. +----+--------------------------+-------+---------+
  46. | ID | Hypervisor hostname | State | Status |
  47. +----+--------------------------+-------+---------+
  48. | 1 | node-5.test.domain.local | up | enabled |
  49. | 4 | node-4.test.domain.local | up | enabled |
  50. +----+--------------------------+-------+---------+
  51.  
  52. root@node-1:~# nova list --all-tenant
  53. +----+------+-----------+--------+------------+-------------+----------+
  54. | ID | Name | Tenant ID | Status | Task State | Power State | Networks |
  55. +----+------+-----------+--------+------------+-------------+----------+
  56. +----+------+-----------+--------+------------+-------------+----------+
  57.  
  58. [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
  59. total 4
  60. drwxr-xr-x 2 nova nova 53 Jan 21 13:45 _base
  61. -rw-r--r-- 1 nova nova 46 Jan 22 13:52 compute_nodes
  62. drwxr-xr-x 2 nova nova 91 Jan 21 13:45 locks
  63. total 4
  64. drwxr-xr-x 2 nova nova 53 Jan 22 13:47 _base
  65. -rw-r--r-- 1 nova nova 46 Jan 22 14:04 compute_nodes
  66. drwxr-xr-x 2 nova nova 91 Jan 22 13:47 locks
  67.  
  68. root@node-1:~# cat ./test1.py
  69. #!/usr/bin/env python
  70.  
  71. import datetime
  72. import time
  73.  
  74. from novaclient.client import Client
  75.  
  76. flavor_id = "ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e"
  77. image_id = "d0b55629-c0f9-47b2-875d-e12633177fd3" #Cirros
  78. net_id = "fa550d0d-afde-49fb-8aca-a2f30abc8dc6"
  79.  
  80. nova_client = Client('2',
  81. username="admin",
  82. api_key="admin",
  83. auth_url="http://10.177.8.3:5000/v2.0",
  84. project_id="admin")
  85.  
  86. def resize_instance(api_no):
  87. print "start of api............", api_no
  88. instance = nova_client.servers.create(name="test_%s"%api_no,
  89. image=image_id,
  90. flavor=flavor_id,
  91. nics=[{'net-id': net_id}])
  92. def _resize_instance():
  93. instance_obj = nova_client.servers.get(instance)
  94. instance_status = instance_obj.status
  95. if instance_status == 'ACTIVE':
  96. print("Resize instance with flavor %s" % flavor_id)
  97. nova_client.servers.resize(instance, 1)
  98. return
  99. elif instance_status == 'ERROR':
  100. instance_status = instance_obj.to_dict()['fault']
  101. print("Instance is in error state %s" %instance_status)
  102. else:
  103. time.sleep(2)
  104. _resize_instance()
  105. _resize_instance()
  106.  
  107. def _delete_instance():
  108. instance_obj = nova_client.servers.get(instance)
  109. instance_dict = instance_obj.to_dict()
  110. task_state = instance_dict['OS-EXT-STS:task_state']
  111. vm_state = instance_dict['OS-EXT-STS:vm_state']
  112. if task_state == 'resize_migrated':
  113. print("deleting instance during resize")
  114. nova_client.servers.delete(instance)
  115. elif vm_state == 'resized':
  116. print("deleting unconfirmed resize instance")
  117. nova_client.servers.delete(instance)
  118. else:
  119. time.sleep(2)
  120. _delete_instance()
  121. _delete_instance()
  122.  
  123. if __name__ == '__main__':
  124. start_time = datetime.datetime.now()
  125. duration = 60*240 #in seconds
  126. test_end_time = time.time() + duration
  127. total_count = 0
  128. #while 1:
  129. for _ in xrange(10):
  130. t = time.time()
  131. vm_count = len(nova_client.servers.list())
  132. if t >= test_end_time:
  133. print("---------end of api calls--------")
  134. break
  135. total_count += 1
  136. try:
  137. resize_instance(total_count)
  138. except Exception as e:
  139. print ("Exit on exception %s " %e)
  140. break
  141.  
  142. print("Total instance delete attempts during resize = %s" % total_count)
  143. root@node-1:~#
  144.  
  145.  
  146. root@node-1:~# python ./test1.py
  147. start of api............ 1
  148. Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
  149. deleting instance during resize
  150. start of api............ 2
  151. Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
  152. deleting instance during resize
  153. start of api............ 3
  154. Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
  155. deleting instance during resize
  156. start of api............ 4
  157. Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
  158. deleting unconfirmed resize instance
  159. start of api............ 5
  160. Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
  161. deleting instance during resize
  162. start of api............ 6
  163. Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
  164. deleting instance during resize
  165. start of api............ 7
  166. Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
  167. deleting instance during resize
  168. start of api............ 8
  169. Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
  170. deleting instance during resize
  171. start of api............ 9
  172. Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
  173. deleting instance during resize
  174. start of api............ 10
  175. Resize instance with flavor ab5ebc25-3727-4c3d-a5e9-8fdf0e40d41e
  176. deleting instance during resize
  177. Total instance delete attempts during resize = 10
  178.  
  179.  
  180. [root@nailgun ~]# date
  181. Fri Jan 22 14:37:57 UTC 2016
  182. [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
  183. total 4
  184. drwxr-xr-x 2 nova nova 69 Jan 22 14:32 32b6b707-8e80-42bd-a46f-aeaf30d7a543_resize
  185. drwxr-xr-x 2 nova nova 17 Jan 22 14:34 41b74ea7-40b5-40d3-b362-f5dfe46b2293_del
  186. drwxr-xr-x 2 nova nova 69 Jan 22 14:34 41b74ea7-40b5-40d3-b362-f5dfe46b2293_resize
  187. drwxr-xr-x 2 nova nova 53 Jan 22 13:47 _base
  188. drwxr-xr-x 2 nova nova 69 Jan 22 14:33 c6d06fa3-c5c3-44f5-acb0-f05bc6a2ac49_resize
  189. -rw-r--r-- 1 nova nova 46 Jan 22 14:04 compute_nodes
  190. drwxr-xr-x 2 nova nova 91 Jan 22 13:47 locks
  191. total 4
  192. drwxr-xr-x 2 nova nova 69 Jan 22 14:34 143cdacb-143a-4a79-9a38-bca61a6fdb25_resize
  193. drwxr-xr-x 2 nova nova 17 Jan 22 14:37 179032b3-d700-4300-9b8e-c2aa893d45a8_del
  194. drwxr-xr-x 2 nova nova 69 Jan 22 14:37 179032b3-d700-4300-9b8e-c2aa893d45a8_resize
  195. drwxr-xr-x 2 nova nova 69 Jan 22 14:32 32b6b707-8e80-42bd-a46f-aeaf30d7a543
  196. drwxr-xr-x 2 nova nova 53 Jan 21 13:45 _base
  197. -rw-r--r-- 1 nova nova 47 Jan 22 14:33 compute_nodes
  198. drwxr-xr-x 2 nova nova 69 Jan 22 14:35 ff1f36ba-bd5c-4670-a5fb-0d9a9fd1d7bd_resize
  199. drwxr-xr-x 2 nova nova 91 Jan 21 13:45 locks
  200.  
  201. [root@nailgun ~]# date
  202. Fri Jan 22 14:45:53 UTC 2016
  203. [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
  204. total 4
  205. drwxr-xr-x 2 nova nova 53 Jan 22 13:47 _base
  206. -rw-r--r-- 1 nova nova 47 Jan 22 14:45 compute_nodes
  207. drwxr-xr-x 2 nova nova 91 Jan 22 13:47 locks
  208. total 4
  209. drwxr-xr-x 2 nova nova 53 Jan 21 13:45 _base
  210. -rw-r--r-- 1 nova nova 47 Jan 22 14:33 compute_nodes
  211. drwxr-xr-x 2 nova nova 91 Jan 21 13:45 locks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement