Public bug reported:

When playing with fence_scsi in Azure's new shared disk feature, I
discovered that I'm able to register a key and acquire a reservation
using that key for the host I have generated the key to. BUT, when
trying to unregister a key from another host I get errors.

With that problem, I can't use fence_scsi agent for fencing in Microsoft
Azure.

-------------------------------

rafaeldtinoco@clubionic01:~$ cat /etc/fence_scsi.key
3abe0000

#### Registering a node into the shared disk manually:

rafaeldtinoco@clubionic01:~$ sudo fence_scsi --verbose -n 10.250.3.10 -d 
/dev/sdc -k 3abe0000 -D debug.log -o on
Executing: /usr/bin/sg_turs /dev/sdc
0

Executing: /usr/bin/sg_turs /dev/sdc
0

Executing: /usr/bin/sg_persist -n -i -k -d /dev/sdc
0   PR generation=0x8, there are NO registered reservation keys
No registration for key 3abe0000 on device /dev/sdc

Executing: /usr/bin/sg_turs /dev/sdc
0

Executing: /usr/bin/sg_persist -n -o -I -S 3abe0000 -d /dev/sdc
0

Executing: /usr/bin/sg_turs /dev/sdc
0

Executing: /usr/bin/sg_persist -n -i -k -d /dev/sdc
0   PR generation=0x9, 1 registered reservation key follows:
    0x3abe0000

Executing: /usr/bin/sg_turs /dev/sdc
0

Executing: /usr/bin/sg_persist -n -i -r -d /dev/sdc
0   PR generation=0x9, there is NO reservation held

Executing: /usr/bin/sg_turs /dev/sdc
0

Executing: /usr/bin/sg_persist -n -o -R -T 5 -K 3abe0000 -d /dev/sdc
0

Executing: /usr/bin/sg_turs /dev/sdc
0

Executing: /usr/bin/sg_turs /dev/sdc
0

Executing: /usr/bin/sg_persist -n -i -k -d /dev/sdc
0   PR generation=0x9, 1 registered reservation key follows:
    0x3abe0000

Success: Powered ON

#### Trying to un-register from the same node HAS TO FAIL (fence_scsi
does not allow it)

rafaeldtinoco@clubionic01:~$ sudo fence_scsi --verbose -n 10.250.3.10 -d 
/dev/sdc -k 3abe0000 -D debug.log -o off
Delay 0 second(s) before logging in to the fence device

Executing: /usr/bin/sg_turs /dev/sdc
0

Executing: /usr/bin/sg_turs /dev/sdc
0

Executing: /usr/bin/sg_persist -n -i -k -d /dev/sdc
0   PR generation=0x9, 1 registered reservation key follows:
    0x3abe0000


Failed: keys cannot be same. You can not fence yourself.

#### Trying to un-register from another node (has to succeed, that is
the fencing purpose!)

rafaeldtinoco@clubionic02:~$ sudo fence_scsi --verbose -n 10.250.3.10 -d 
/dev/sdc -k 3abe0000 -D debug.log -o off
Delay 0 second(s) before logging in to the fence device

Executing: /usr/bin/sg_turs /dev/sdc
0

Executing: /usr/bin/sg_turs /dev/sdc
0

Executing: /usr/bin/sg_persist -n -i -k -d /dev/sdc
0   PR generation=0x9, 1 registered reservation key follows:
    0x3abe0000

Executing: /usr/bin/sg_turs /dev/sdc
0

Executing: /usr/bin/sg_persist -n -i -k -d /dev/sdc
0   PR generation=0x9, 1 registered reservation key follows:
    0x3abe0000

Executing: /usr/bin/sg_turs /dev/sdc
0

Executing: /usr/bin/sg_persist -n -o -A -T 5 -K 62ed0001 -S 3abe0000 -d /dev/sdc
99  persistent reserve out: transport: Host_status=0x07 [DID_ERROR]
Driver_status=0x00 [DRIVER_OK]

PR out (Preempt and abort): Sense category: -1, try '-v' option for more
information


Executing: /usr/bin/sg_turs /dev/sdc
0

Executing: /usr/bin/sg_persist -n -i -k -d /dev/sdc
0   PR generation=0x9, 1 registered reservation key follows:
    0x3abe0000

Failed to remove key 3abe0000 on device /dev/sdc

Failed to verify 1 device(s)

-------------------------

And I have realized that, in the SAME node (as the key in place), I'm
able to release and unregister a node's key:

rafaeldtinoco@clubionic01:~$ sudo sg_persist --out --release 
--param-rk=0x3abe0000 --prout-type=5 /dev/sdc
  Msft      Virtual Disk      1.0
  Peripheral device type: disk

rafaeldtinoco@clubionic01:~$ sudo sg_persist --out --register 
--param-rk=0x3abe0000 --prout-type=5 /dev/sdc
  Msft      Virtual Disk      1.0
  Peripheral device type: disk

-------------------------

But in a different node, after the reservation is set in a different
node, I CANNOT release and unregister the node'skey:

rafaeldtinoco@clubionic02:~$ sudo sg_persist --in --read-keys --device=/dev/sdc
  Msft      Virtual Disk      1.0
  Peripheral device type: disk
  PR generation=0x9, 1 registered reservation key follows:
    0x3abe0000

rafaeldtinoco@clubionic02:~$ sudo sg_persist --out --release 
--param-rk=0x3abe0000 --prout-type=5 /dev/sdc
  Msft      Virtual Disk      1.0
  Peripheral device type: disk
persistent reserve out: transport: Host_status=0x07 [DID_ERROR]
Driver_status=0x00 [DRIVER_OK]


rafaeldtinoco@clubionic02:~$ sudo sg_persist --out --register --device=/dev/sdc 
--param-rk=0x3abe0000
  Msft      Virtual Disk      1.0
  Peripheral device type: disk
persistent reserve out: transport: Host_status=0x07 [DID_ERROR]
Driver_status=0x00 [DRIVER_OK]

** Affects: fence-agents (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: fence-agents (Ubuntu Bionic)
     Importance: High
     Assignee: Rafael David Tinoco (rafaeldtinoco)
         Status: Confirmed

** Also affects: fence-agents (Ubuntu Bionic)
   Importance: Undecided
       Status: New

** Changed in: fence-agents (Ubuntu Bionic)
       Status: New => Confirmed

** Changed in: fence-agents (Ubuntu Bionic)
   Importance: Undecided => High

** Changed in: fence-agents (Ubuntu Bionic)
     Assignee: (unassigned) => Rafael David Tinoco (rafaeldtinoco)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1864419

Title:
  [bionic][azure] fence_scsi unable to unfence from another node

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/fence-agents/+bug/1864419/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to