Skip to content

Commit

Permalink
CA-257740: Fix HA broken for NFS
Browse files Browse the repository at this point in the history
Commit 8a19f82dcf7d6e1737908f7e2380bdb216404991 had introduced
a regression causing attach_from_config to fail, meaning the host
would not boot properly with HA enabled since the attach static VDI
would fail and ha_start_daemon would fail as well because there would
not be any static VDI attached.

Before 8a19f82dcf7d6e1737908f7e2380bdb216404991 FileVDI.load was failing
during attach_from_config since the SR was not mounted but managed to set

   'self.path = raw_path'

before failing.

After 8a19f82dcf7d6e1737908f7e2380bdb216404991 FileVDI.load was still
failing during attach_from_config since the SR was not mounted but
it was leaving

    'self.path = None'

This commit is fixing the problem by checking if 'self.path is None'
and calling self._find_path_with_retries() again to set the path after
the SR is mounted.

Signed-off-by: Stefano Panella <stefano.panella@citrix.com>
Signed-off-by: Mark Syms <mark.syms@citrix.com>
Signed-off-by: Edvin Torok <edvin.torok@citrix.com>
Reviewed-by: Edwin Török <edvin.torok@citrix.com>
  • Loading branch information
stefanopanella authored and MarkSymsCtx committed Jan 30, 2018
1 parent ef9293e commit 2a5bc6d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/FileSR.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,8 @@ def delete(self, sr_uuid, vdi_uuid, data_only = False):
return super(FileVDI, self).delete(sr_uuid, vdi_uuid, data_only)

def attach(self, sr_uuid, vdi_uuid):
if self.path is None:
self._find_path_with_retries(vdi_uuid)
if not self._checkpath(self.path):
raise xs_errors.XenError('VDIUnavailable', \
opterr='VDI %s unavailable %s' % (vdi_uuid, self.path))
Expand Down

0 comments on commit 2a5bc6d

Please sign in to comment.