summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hua <john.hua@citrix.com>2015-11-03 15:43:12 +0800
committerJohn Hua <john.hua@citrix.com>2015-11-12 18:43:58 +0800
commit382ba2fee5b48a425ed885ae21a0f1077ce0b6df (patch)
tree65c4a0adcb82b93edbbd8577276ccc6d99b253b1
parentb02c85b3ec08b2a5912678afe08d158eb58619e9 (diff)
Trigger an error when hotfix is not installed or password is wrong6.1
Hotfix XS65ESP1013 is to fix Cinder volume when iSCSI is used. It is necessary to check whether this hotfix is installed and exit deployment if not. And docs are also updated to make sure user will do so in advance. Besides, if password of XenServer is wrong, an alert with error message will also be needed. Change-Id: I2b7d5b1b127e8a0e232537a4baa5f401f9be0854 Closes-Bug: #1508474 Closes-Bug: #1508996 (cherry picked from commit c80ded539c4be64a3d4fb3a6231083a97a09f835)
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Bob Ball <bob.ball@citrix.com> Workflow+1: Bob Ball <bob.ball@citrix.com> Code-Review+1: John Hua <john.hua@citrix.com> Submitted-by: Jenkins Submitted-at: Wed, 18 Nov 2015 09:03:27 +0000 Reviewed-on: https://review.openstack.org/244467 Project: openstack/fuel-plugin-xenserver Branch: refs/heads/6.1
-rwxr-xr-xdeployment_scripts/compute_post_deployment.py22
-rw-r--r--doc/content/description.rst8
-rw-r--r--doc/content/guide.rst2
-rw-r--r--doc/user-guide.pdf56
-rw-r--r--metadata.yaml2
5 files changed, 50 insertions, 40 deletions
diff --git a/deployment_scripts/compute_post_deployment.py b/deployment_scripts/compute_post_deployment.py
index e459da8..072d6e2 100755
--- a/deployment_scripts/compute_post_deployment.py
+++ b/deployment_scripts/compute_post_deployment.py
@@ -35,10 +35,12 @@ def execute(*cmd, **kwargs):
35 35
36 if out: 36 if out:
37 debug(out) 37 debug(out)
38 if err: 38
39 if proc.returncode != 0:
39 warning(err) 40 warning(err)
41 raise Exception(err)
40 42
41 return (out, err) 43 return out
42 44
43 45
44def ssh(host, username, password, *cmd, **kwargs): 46def ssh(host, username, password, *cmd, **kwargs):
@@ -102,8 +104,8 @@ def init_eth():
102 the IP addresses of local host and XenServer. 104 the IP addresses of local host and XenServer.
103 """ 105 """
104 106
105 domid, err = execute('xenstore-read', 'domid') 107 domid = execute('xenstore-read', 'domid')
106 himn_mac, err = execute( 108 himn_mac = execute(
107 'xenstore-read', 109 'xenstore-read',
108 '/local/domain/%s/vm-data/himn_mac' % domid) 110 '/local/domain/%s/vm-data/himn_mac' % domid)
109 info('himn_mac: %s' % himn_mac) 111 info('himn_mac: %s' % himn_mac)
@@ -144,6 +146,13 @@ def init_eth():
144 return None, None, None 146 return None, None, None
145 147
146 148
149def check_hotfix_exists(himn, username, password, hotfix):
150 out = ssh(himn_xs, username, password,
151 'xe patch-list name-label=%s' % hotfix)
152 if not out:
153 raise Exception('Hotfix %s has not been installed' % hotfix)
154
155
147def install_xenapi_sdk(): 156def install_xenapi_sdk():
148 """Install XenAPI Python SDK""" 157 """Install XenAPI Python SDK"""
149 execute('cp', 'XenAPI.py', '/usr/lib/python2.7/dist-packages/') 158 execute('cp', 'XenAPI.py', '/usr/lib/python2.7/dist-packages/')
@@ -177,7 +186,7 @@ def restart_nova_services():
177 186
178def route_to_compute(endpoints, himn_xs, himn_local, username, password): 187def route_to_compute(endpoints, himn_xs, himn_local, username, password):
179 """Route storage/mgmt requests to compute nodes. """ 188 """Route storage/mgmt requests to compute nodes. """
180 (out, err) = ssh(himn_xs, username, password, 'route', '-n') 189 out = ssh(himn_xs, username, password, 'route', '-n')
181 _net = lambda ip: '.'.join(ip.split('.')[:-1] + ['0']) 190 _net = lambda ip: '.'.join(ip.split('.')[:-1] + ['0'])
182 _mask = lambda cidr: inet_ntoa(pack( 191 _mask = lambda cidr: inet_ntoa(pack(
183 '>I', 0xffffffff ^ (1 << 32 - int(cidr)) - 1)) 192 '>I', 0xffffffff ^ (1 << 32 - int(cidr)) - 1))
@@ -208,7 +217,7 @@ def install_suppack(himn, username, password):
208 """Install xapi driver supplemental pack. """ 217 """Install xapi driver supplemental pack. """
209 # TODO: check if installed 218 # TODO: check if installed
210 scp(himn, username, password, '/tmp/', 'novaplugins.iso') 219 scp(himn, username, password, '/tmp/', 'novaplugins.iso')
211 (out, err) = ssh( 220 out = ssh(
212 himn, username, password, 'xe-install-supplemental-pack', 221 himn, username, password, 'xe-install-supplemental-pack',
213 '/tmp/novaplugins.iso', prompt='Y\n') 222 '/tmp/novaplugins.iso', prompt='Y\n')
214 ssh(himn, username, password, 'rm', '/tmp/novaplugins.iso') 223 ssh(himn, username, password, 'rm', '/tmp/novaplugins.iso')
@@ -245,6 +254,7 @@ if __name__ == '__main__':
245 endpoints = get_endpoints(astute) 254 endpoints = get_endpoints(astute)
246 eth, himn_local, himn_xs = init_eth() 255 eth, himn_local, himn_xs = init_eth()
247 if username and password and endpoints and himn_local and himn_xs: 256 if username and password and endpoints and himn_local and himn_xs:
257 check_hotfix_exists(himn_xs, username, password, 'XS65ESP1013')
248 route_to_compute( 258 route_to_compute(
249 endpoints, himn_xs, himn_local, username, password) 259 endpoints, himn_xs, himn_local, username, password)
250 if install_xapi: 260 if install_xapi:
diff --git a/doc/content/description.rst b/doc/content/description.rst
index 3b918f0..7a3a4e0 100644
--- a/doc/content/description.rst
+++ b/doc/content/description.rst
@@ -22,13 +22,13 @@ guide
22Requirements 22Requirements
23------------ 23------------
24 24
25========================= =============== 25========================= ============================
26Requirement Version/Comment 26Requirement Version/Comment
27========================= =============== 27========================= ============================
28Fuel 6.1 28Fuel 6.1
29XenServer 6.5 SP1 29XenServer 6.5 SP1 + Hotfix XS65ESP1013
30XenServer plugin for Fuel 1.0.1 30XenServer plugin for Fuel 1.0.1
31========================= =============== 31========================= ============================
32 32
33* This plugin will not install XenServer or configure the Virtual 33* This plugin will not install XenServer or configure the Virtual
34 Machines used to run the OpenStack services. Installation of 34 Machines used to run the OpenStack services. Installation of
diff --git a/doc/content/guide.rst b/doc/content/guide.rst
index 89ff188..e5727a7 100644
--- a/doc/content/guide.rst
+++ b/doc/content/guide.rst
@@ -18,7 +18,7 @@ Prepare infrastructure
18 18
19 - Other service nodes (e.g. storage node) can also be created as virtual machines, but this is not required 19 - Other service nodes (e.g. storage node) can also be created as virtual machines, but this is not required
20 20
212. Download and install XenServer 6.5 with SP1 and HIMN tool, a XenServer plugin, as install guide mentioned. Use it for future VM creation and network configuration. 212. Download and install XenServer 6.5 with SP1, Hotfix XS65ESP1013 and HIMN tool, a XenServer plugin, as install guide mentioned. Use it for future VM creation and network configuration.
22 22
233. While many networking setups are expected to work, the following setup is known to work: 233. While many networking setups are expected to work, the following setup is known to work:
24 24
diff --git a/doc/user-guide.pdf b/doc/user-guide.pdf
index 932ae4d..ce089be 100644
--- a/doc/user-guide.pdf
+++ b/doc/user-guide.pdf
@@ -91,7 +91,7 @@ endobj
91<< /A << /S /URI /Type /Action /URI (https://docs.mirantis.com/openstack/fuel/fuel-6.1/user-guide.html#deploy-changes) >> /Border [ 0 0 0 ] /Rect [ 114.0329 184.5972 178.5129 196.5972 ] /Subtype /Link /Type /Annot >> 91<< /A << /S /URI /Type /Action /URI (https://docs.mirantis.com/openstack/fuel/fuel-6.1/user-guide.html#deploy-changes) >> /Border [ 0 0 0 ] /Rect [ 114.0329 184.5972 178.5129 196.5972 ] /Subtype /Link /Type /Annot >>
92endobj 92endobj
9325 0 obj 9325 0 obj
94<< /Annots [ 21 0 R 23 0 R 24 0 R ] /Contents 54 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 50 0 R /Resources << /Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] /XObject << /FormXob.49af0aa469f423c70d1893d8d0633831 22 0 R /FormXob.8909a9f6b77b93d0a2fc2662d6d8986a 20 0 R >> >> /Rotate 0 94<< /Annots [ 21 0 R 23 0 R 24 0 R ] /Contents 54 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 50 0 R /Resources << /Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] /XObject << /FormXob.49af0aa469f423c70d1893d8d0633831 22 0 R /FormXob.78b02d5486e8f95760ae7996dba4cd29 20 0 R >> >> /Rotate 0
95 /Trans << >> /Type /Page >> 95 /Trans << >> /Type /Page >>
96endobj 96endobj
9726 0 obj 9726 0 obj
@@ -123,7 +123,7 @@ endobj
123<< /Outlines 35 0 R /PageLabels 56 0 R /PageMode /UseNone /Pages 50 0 R /Type /Catalog >> 123<< /Outlines 35 0 R /PageLabels 56 0 R /PageMode /UseNone /Pages 50 0 R /Type /Catalog >>
124endobj 124endobj
12534 0 obj 12534 0 obj
126<< /Author () /CreationDate (D:20151009094416+00'00') /Creator (\(unspecified\)) /Keywords () /Producer (ReportLab PDF Library - www.reportlab.com) /Subject (\(unspecified\)) 126<< /Author () /CreationDate (D:20151112184235-08'00') /Creator (\(unspecified\)) /Keywords () /Producer (ReportLab PDF Library - www.reportlab.com) /Subject (\(unspecified\))
127 /Title () >> 127 /Title () >>
128endobj 128endobj
12935 0 obj 12935 0 obj
@@ -179,7 +179,7 @@ endobj
179<< /Count 5 /Kids [ 8 0 R 15 0 R 19 0 R 25 0 R 32 0 R ] /Type /Pages >> 179<< /Count 5 /Kids [ 8 0 R 15 0 R 19 0 R 25 0 R 32 0 R ] /Type /Pages >>
180endobj 180endobj
18151 0 obj 18151 0 obj
182<< /Length 7458 >> 182<< /Length 7479 >>
183stream 183stream
1841 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET 1841 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
185q 185q
@@ -259,22 +259,22 @@ q
2591 0 0 1 6 57 cm 2591 0 0 1 6 57 cm
260q 260q
261.960784 .960784 .862745 rg 261.960784 .960784 .862745 rg
262n 0 0 281.6811 12 re f* 262n 0 0 209.6461 12 re f*
263Q 263Q
264q 264q
2650 0 0 rg 2650 0 0 rg
266BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL 112.2206 0 Td (Requirement) Tj T* -112.2206 0 Td ET 266BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL 76.20306 0 Td (Requirement) Tj T* -76.20306 0 Td ET
267Q 267Q
268Q 268Q
269q 269q
2701 0 0 1 299.6811 57 cm 2701 0 0 1 227.6461 57 cm
271q 271q
272.960784 .960784 .862745 rg 272.960784 .960784 .862745 rg
273n 0 0 164.2087 12 re f* 273n 0 0 236.2436 12 re f*
274Q 274Q
275q 275q
2760 0 0 rg 2760 0 0 rg
277BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL 42.09433 0 Td (Version/Comment) Tj T* -42.09433 0 Td ET 277BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL 78.11182 0 Td (Version/Comment) Tj T* -78.11182 0 Td ET
278Q 278Q
279Q 279Q
2800 0 0 rg 2800 0 0 rg
@@ -286,7 +286,7 @@ BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (Fuel) Tj T* ET
286Q 286Q
287Q 287Q
288q 288q
2891 0 0 1 299.6811 39 cm 2891 0 0 1 227.6461 39 cm
290q 290q
2910 0 0 rg 2910 0 0 rg
292BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (6.1) Tj T* ET 292BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (6.1) Tj T* ET
@@ -300,10 +300,10 @@ BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (XenServer) Tj T* ET
300Q 300Q
301Q 301Q
302q 302q
3031 0 0 1 299.6811 21 cm 3031 0 0 1 227.6461 21 cm
304q 304q
3050 0 0 rg 3050 0 0 rg
306BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (6.5 SP1) Tj T* ET 306BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (6.5 SP1 + Hotfix XS65ESP1013) Tj T* ET
307Q 307Q
308Q 308Q
309q 309q
@@ -314,7 +314,7 @@ BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (XenServer plugin for Fuel) Tj T* ET
314Q 314Q
315Q 315Q
316q 316q
3171 0 0 1 299.6811 3 cm 3171 0 0 1 227.6461 3 cm
318q 318q
3190 0 0 rg 3190 0 0 rg
320BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (1.0.1) Tj T* ET 320BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (1.0.1) Tj T* ET
@@ -328,7 +328,7 @@ q
328n 0 54 m 469.8898 54 l S 328n 0 54 m 469.8898 54 l S
329n 0 36 m 469.8898 36 l S 329n 0 36 m 469.8898 36 l S
330n 0 18 m 469.8898 18 l S 330n 0 18 m 469.8898 18 l S
331n 293.6811 0 m 293.6811 72 l S 331n 221.6461 0 m 221.6461 72 l S
332n 0 72 m 469.8898 72 l S 332n 0 72 m 469.8898 72 l S
333n 0 0 m 469.8898 0 l S 333n 0 0 m 469.8898 0 l S
334n 0 0 m 0 72 l S 334n 0 0 m 0 72 l S
@@ -528,7 +528,7 @@ Q
528endstream 528endstream
529endobj 529endobj
53052 0 obj 53052 0 obj
531<< /Length 9384 >> 531<< /Length 9404 >>
532stream 532stream
5331 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET 5331 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
534q 534q
@@ -959,7 +959,7 @@ q
9591 0 0 1 23 -3 cm 9591 0 0 1 23 -3 cm
960q 960q
9610 0 0 rg 9610 0 0 rg
962BT 1 0 0 1 0 14 Tm /F1 10 Tf 12 TL 1.113318 Tw (Download and install XenServer 6.5 with SP1 and HIMN tool, a XenServer plugin, as install guide) Tj T* 0 Tw (mentioned. Use it for future VM creation and network configuration.) Tj T* ET 962BT 1 0 0 1 0 14 Tm /F1 10 Tf 12 TL 1.326905 Tw (Download and install XenServer 6.5 with SP1, Hotfix XS65ESP1013 and HIMN tool, a XenServer) Tj T* 0 Tw (plugin, as install guide mentioned. Use it for future VM creation and network configuration.) Tj T* ET
963Q 963Q
964Q 964Q
965q 965q
@@ -1359,7 +1359,7 @@ q
13591 0 0 1 20 0 cm 13591 0 0 1 20 0 cm
1360q 1360q
1361341.5118 0 0 256.5273 0 0 cm 1361341.5118 0 0 256.5273 0 0 cm
1362/FormXob.8909a9f6b77b93d0a2fc2662d6d8986a Do 1362/FormXob.78b02d5486e8f95760ae7996dba4cd29 Do
1363Q 1363Q
1364Q 1364Q
1365q 1365q
@@ -1765,21 +1765,21 @@ xref
17650000170133 00000 n 17650000170133 00000 n
17660000170252 00000 n 17660000170252 00000 n
17670000170343 00000 n 17670000170343 00000 n
17680000177858 00000 n 17680000177879 00000 n
17690000187299 00000 n 17690000187340 00000 n
17700000190791 00000 n 17700000190832 00000 n
17710000195089 00000 n 17710000195130 00000 n
17720000197796 00000 n 17720000197837 00000 n
17730000197876 00000 n 17730000197917 00000 n
17740000197913 00000 n 17740000197954 00000 n
17750000197950 00000 n 17750000197991 00000 n
17760000197987 00000 n 17760000198028 00000 n
17770000198024 00000 n 17770000198065 00000 n
1778trailer 1778trailer
1779<< /ID 1779<< /ID
1780 % ReportLab generated PDF document -- digest (http://www.reportlab.com) 1780 % ReportLab generated PDF document -- digest (http://www.reportlab.com)
1781 [(\376\224.\177.\266\365\210\305 \351\235\030*\350\277) (\376\224.\177.\266\365\210\305 \351\235\030*\350\277)] 1781 [(cA\036\342\316\300\276\326\317H8\243\272V\345D) (cA\036\342\316\300\276\326\317H8\243\272V\345D)]
1782 /Info 34 0 R /Root 33 0 R /Size 62 >> 1782 /Info 34 0 R /Root 33 0 R /Size 62 >>
1783startxref 1783startxref
1784198061 1784198102
1785%%EOF 1785%%EOF
diff --git a/metadata.yaml b/metadata.yaml
index 561924a..4daf397 100644
--- a/metadata.yaml
+++ b/metadata.yaml
@@ -3,7 +3,7 @@ name: fuel-plugin-xenserver
3# Human-readable name for your plugin 3# Human-readable name for your plugin
4title: XenServer Plugin 4title: XenServer Plugin
5# Plugin version 5# Plugin version
6version: '1.0.1' 6version: '1.0.2'
7# Description 7# Description
8description: Enable Mirantis OpenStack to integrate with Xenserver 8description: Enable Mirantis OpenStack to integrate with Xenserver
9# Required fuel version 9# Required fuel version