Skip to content

Commit

Permalink
EMC VMAX database lock for symconfigure
Browse files Browse the repository at this point in the history
When VMAX is executing a symconfigure command it database stay
in lock to another execute and need to wait for this.
The STGAdm will wait 60 seconds and try again. It will happen
more one time (3 tentatives on total)
For this the return code when is diffrent of 0 was also improved

Change-Id: Id42939153bf8536e03f782f038b2abea655fbf14
  • Loading branch information
kairoaraujo committed Mar 10, 2016
1 parent 04e074b commit 4aab4a8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stgadm/globalvar.py
Expand Up @@ -6,5 +6,5 @@


timestr = time.strftime("%m%d%Y-%H%M%S")
version = '0.3.0'
version = '0.3.1'

25 changes: 25 additions & 0 deletions stgadm/vmax_add_dev.py
Expand Up @@ -6,6 +6,7 @@
import globalvar
import pystorage
import os
import time


class New:
Expand Down Expand Up @@ -76,6 +77,7 @@ def preview(self):
print(exec_return[1])

if exec_return[0] != 0:
print exec_return[2]
print('\n** ERROR Code: {0} **\n'.format(exec_return[0]))
exit()
else:
Expand All @@ -93,6 +95,26 @@ def execute(self):
self.sgn,
self.action)

# check if EMC VMAX database was in lock
if exec_return[0] == 2:
exec_count = 2
while exec_count <= 3:
print("\nINFO: EMC VMAX {0} Database Locked.\n"
"New tentative in 1 minute. Please Wait...\n"
"Tentative: {1}".format(self.stg_sid, exec_count))
time.sleep(60)
exec_return = exec_change.create_dev(self.stg_sid,
self.disk_count,
self.lun_size,
self.member_meta_size,
self.lun_type,
self.stg_pool,
self.sgn,
self.action)
if exec_return[0] != 2:
break
exec_count += 1

file_name = '{0}/stgadm/evidences/{1}_{2}_{3}.txt'.format(
config.stghome, self.change, self.ign, self.time)
evidence_file = open(file_name, 'w')
Expand All @@ -107,6 +129,9 @@ def execute(self):
"{1}\n".format(exec_return[0], exec_return[1])
)

if exec_return[0] != 0:
evidence_file.write(exec_return[2])

evidence_file.close()

return file_name
Expand Down

0 comments on commit 4aab4a8

Please sign in to comment.