Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localIQN missing #10

Open
abates opened this issue Jun 8, 2016 · 3 comments
Open

localIQN missing #10

abates opened this issue Jun 8, 2016 · 3 comments

Comments

@abates
Copy link

abates commented Jun 8, 2016

In playing with RBD as an HA SR I discovered that an exception was being thrown when enabling HA:

Jun  8 10:20:20 x2 SM: [31382] ***** generic exception: vdi_generate_config: EXCEPTION <type 'exceptions.AttributeError'>, 'RBDSR' object has no attribute 'localIQN'
Jun  8 10:20:20 x2 SM: [31382]   File "/opt/xensource/sm/SRCommand.py", line 110, in run
Jun  8 10:20:20 x2 SM: [31382]     return self._run_locked(sr)
Jun  8 10:20:20 x2 SM: [31382]   File "/opt/xensource/sm/SRCommand.py", line 159, in _run_locked
Jun  8 10:20:20 x2 SM: [31382]     rv = self._run(sr, target)
Jun  8 10:20:20 x2 SM: [31382]   File "/opt/xensource/sm/SRCommand.py", line 282, in _run
Jun  8 10:20:20 x2 SM: [31382]     return target.generate_config(self.params['sr_uuid'], self.vdi_uuid)
Jun  8 10:20:20 x2 SM: [31382]   File "/opt/xensource/sm/LVMoISCSISR", line 584, in generate_config
Jun  8 10:20:20 x2 SM: [31382]     self.sr.dconf['localIQN'] = self.sr.iscsi.localIQN

I was able to get this to work by simply calling the super class load method in RBDSR's load:

class RBDSR(BaseISCSI.BaseISCSISR):
    def handles(type):
        if type == "rbd":
            return True
        return False
    handles = staticmethod(handles)

    def load(self, sr_uuid):
        # Added the following to inherit base-class attributes including localIQN
        super(RBDSR, self).load(sr_uuid)

I've tested this on XS 7 and can put together a pull request if this is an acceptable fix.

Regards,
Andrew

@MQDOIT
Copy link

MQDOIT commented Jun 21, 2016

Hi Andrew
use your patch the HA can success but when creating a target lun failed.
"logging in to the iscsi target failed."
After remove your patch, the lun can create successfully
1

Regards
Mike

@mstarikov
Copy link
Owner

Hi Andrew, MQ,

This is the same as issue#8. I was meant to find out if localIQN variable is used for anything else except checking if iscsid is running, but haven't got around it . Hence, I'll be somewhat reckless and just do static value heck for it.

Here is the patch
RBDSR-HA.patch.zip

with following content:

--- a/RBDSR.py2016-06-29 11:11:56.000000000 +1000
+++ b/RBDSR.py2016-06-29 11:10:23.000000000 +1000
@@ -58,6 +58,7 @@
             raise xs_errors.XenError('ConfigTargetMissing')

         self.path = ''
+        self.localIQN = 'rados_sr'
         real_address = ''
         try:
             # For monitors we only need one address, since we get accurate map from the ceph later on in attach.

please try it applied on each host:
patch /opt/xensource/sm/RBDSR.py RBDSR-HA.patch
and let me know how it goes. If all works well, I'll update the main RBDSR7.patch and RBDSR.py with that change.

@abates
Copy link
Author

abates commented Jun 29, 2016

Hi Mark,

I'll try to give this a try sometime in the next day or so. Thanks!

Andrew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants