Seems we may be failing target create silently,
the situation appears to be that the actual device
lun is not created. This has been appearing in the
gates on create from snapshot.
This change adds some logging that will help us determine
if it's the actual create, or if it's the attempted update
while the dd process is possibly holding the volume in a busy
state causing the target update to add lun 1 to fail.
Change-Id: If5d4219dedae4649982fa9c13f131bf5f38fb7c4
'--update',
name,
run_as_root=True)
+ # Grab targets list for debug
+ # Consider adding a check for lun 0 and 1 for tgtadm
+ # before considering this as valid
+ (out, err) = self._execute('tgtadm',
+ '--lld',
+ 'iscsi',
+ '--op',
+ 'show',
+ '--mode',
+ 'target',
+ run_as_root=True)
+ LOG.debug("Targets after update: %s" % out)
except putils.ProcessExecutionError as e:
LOG.error(_("Failed to create iscsi target for volume "
"id:%(vol_id)s: %(e)s")
def verify_cmds(self, cmds):
self.assertEqual(len(cmds), len(self.cmds))
- for a, b in zip(cmds, self.cmds):
- self.assertEqual(a, b)
+ for cmd in self.cmds:
+ self.assertTrue(cmd in cmds)
def verify(self):
script = self.get_script()
self.script_template = "\n".join([
'tgt-admin --update iqn.2011-09.org.foo.bar:blaa',
'tgt-admin --force '
- '--delete iqn.2010-10.org.openstack:volume-blaa'])
+ '--delete iqn.2010-10.org.openstack:volume-blaa',
+ 'tgtadm --lld iscsi --op show --mode target'])
def tearDown(self):
try: