Operating System - HP-UX
1753852 Members
8401 Online
108808 Solutions
New Discussion

Re: WEIRD ISSUE WHILE REMOVING DISKS FROM VM

 
anidil99
Occasional Contributor

WEIRD ISSUE WHILE REMOVING DISKS FROM VM

 Gurus

 

I am unable to remove the disk from the VM  dynamically. It works for some disks but not all. What could be the issue here?

 

See below:

 

VM GUEST:

root@my-guest:/root:-)hpvmdevinfo
Device Type Bus,Device,Target Backing Store Type Host Device Name Virtual Machine Device Name
=========== ================= ================== ================ ===========================
dvd [0,1,2] file /var/tmp/iso-my-guest/Sep2010image.iso /dev/rdisk/disk2
disk [0,1,4] disk /dev/rdisk/disk147 /dev/rdisk/disk11
disk [0,1,6] disk /dev/rdisk/disk69 /dev/rdisk/disk7
disk [4,1,0] disk /dev/rdisk/disk162 /dev/rdisk/disk34
disk [4,1,1] disk /dev/rdisk/disk163 /dev/rdisk/disk37
disk [4,1,2] disk /dev/rdisk/disk164 /dev/rdisk/disk35
disk [4,1,3] disk /dev/rdisk/disk165 /dev/rdisk/disk38
disk [4,1,4] disk /dev/rdisk/disk166 /dev/rdisk/disk36
disk [4,1,5] disk /dev/rdisk/disk167 /dev/rdisk/disk39
disk [4,1,6] disk /dev/rdisk/disk168 /dev/rdisk/disk23
disk [4,1,7] disk /dev/rdisk/disk169 /dev/rdisk/disk40
root@my-guest:/root:-)lssf /dev/rdisk/disk34
esdisk section 0 at address 64000/0xfa00/0x16 /dev/rdisk/disk34
root@my-guest:/root:-)rmsf -H 64000/0xfa00/0x16
root@my-guest:/root:-)lssf /dev/rdisk/disk37
esdisk section 0 at address 64000/0xfa00/0x1b /dev/rdisk/disk37
root@my-guest:/root:-)rmsf -H 64000/0xfa00/0x1b
root@my-guest:/root:-)lssf /dev/rdisk/disk35
esdisk section 0 at address 64000/0xfa00/0x19 /dev/rdisk/disk35
root@my-guest:/root:-)rmsf -H 64000/0xfa00/0x19
root@my-guest:/root:-)lssf /dev/rdisk/disk38
esdisk section 0 at address 64000/0xfa00/0x1c /dev/rdisk/disk38
root@my-guest:/root:-)rmsf -H 64000/0xfa00/0x1c
root@my-guest:/root:-)lssf /dev/rdisk/disk36
esdisk section 0 at address 64000/0xfa00/0x1a /dev/rdisk/disk36
root@my-guest:/root:-)rmsf -H 64000/0xfa00/0x1a
root@my-guest:/root:-)lssf /dev/rdisk/disk39
esdisk section 0 at address 64000/0xfa00/0x1d /dev/rdisk/disk39
root@my-guest:/root:-)rmsf -H 64000/0xfa00/0x1d
root@my-guest:/root:-)lssf /dev/rdisk/disk23
esdisk section 0 at address 64000/0xfa00/0x15 /dev/rdisk/disk23
root@my-guest:/root:-)rmsf -H 64000/0xfa00/0x15
root@my-guest:/root:-)lssf /dev/rdisk/disk40
esdisk section 0 at address 64000/0xfa00/0x1e /dev/rdisk/disk40
root@my-guest:/root:-)rmsf -H 64000/0xfa00/0x1e
root@my-guest:/root:-)

 

VMHOST:

root@my-host:/:-) /opt/hpvm/bin/hpvmmodify -P my-guest -d disk:avio_stor:4,1,0:disk:/dev/rdisk/disk162
root@my-host:/:-) /opt/hpvm/bin/hpvmmodify -P my-guest -d disk:avio_stor:4,1,1:disk:/dev/rdisk/disk163
hpvmmodify: Unable to dynamically delete device disk:avio_stor:4,1,1:disk:/dev/rdisk/disk163 - Device busy.
hpvmmodify: Guest needs to be restarted (using hpvmstop followed by hpvmstart) for all changes to take effect.
root@my-host:/:-) /opt/hpvm/bin/hpvmmodify -P my-guest -d disk:avio_stor:4,1,2:disk:/dev/rdisk/disk164
root@my-host:/:-) /opt/hpvm/bin/hpvmmodify -P my-guest -d disk:avio_stor:4,1,3:disk:/dev/rdisk/disk165
hpvmmodify: Unable to dynamically delete device disk:avio_stor:4,1,3:disk:/dev/rdisk/disk165 - Device busy.
hpvmmodify: Guest needs to be restarted (using hpvmstop followed by hpvmstart) for all changes to take effect.
root@my-host:/:-) /opt/hpvm/bin/hpvmmodify -P my-guest -d disk:avio_stor:4,1,4:disk:/dev/rdisk/disk166
root@my-host:/:-) /opt/hpvm/bin/hpvmmodify -P my-guest -d disk:avio_stor:4,1,5:disk:/dev/rdisk/disk167
root@my-host:/:-) /opt/hpvm/bin/hpvmmodify -P my-guest -d disk:avio_stor:4,1,6:disk:/dev/rdisk/disk168
hpvmmodify: Unable to dynamically delete device disk:avio_stor:4,1,6:disk:/dev/rdisk/disk168 - Device busy.
hpvmmodify: Guest needs to be restarted (using hpvmstop followed by hpvmstart) for all changes to take effect.
root@my-host:/:-) /opt/hpvm/bin/hpvmmodify -P my-guest -d disk:avio_stor:4,1,7:disk:/dev/rdisk/disk169
hpvmmodify: Unable to dynamically delete device disk:avio_stor:4,1,7:disk:/dev/rdisk/disk169 - Device busy.
hpvmmodify: Guest needs to be restarted (using hpvmstop followed by hpvmstart) for all changes to take effect.
root@my-host:/:-)


root@my-host:/:-) hpvmdevinfo -P my-guest
Virtual Machine Name Device Type Bus,Device,Target Backing Store Type Host Device Name Virtual Machine Device Name
==================== =========== ================= ================== ================ ===========================
my-guest dvd [0,1,2] file /var/tmp/iso-my-guest/Sep2010image.iso /dev/rdisk/disk2
my-guest disk [0,1,4] disk /dev/rdisk/disk147 /dev/rdisk/disk11
my-guest disk [0,1,6] disk /dev/rdisk/disk69 /dev/rdisk/disk7
my-guest disk [4,1,1] disk /dev/rdisk/disk163 /dev/rdisk/disk37
my-guest disk [4,1,3] disk /dev/rdisk/disk165 /dev/rdisk/disk38
my-guest disk [4,1,6] disk /dev/rdisk/disk168 /dev/rdisk/disk23
my-guest disk [4,1,7] disk /dev/rdisk/disk169 /dev/rdisk/disk40
root@my-host:/:-)

 

 

 

8 REPLIES 8
Eric SAUBIGNAC
Honored Contributor

Re: WEIRD ISSUE WHILE REMOVING DISKS FROM VM

Bonjour,

 

5 mns to spend today ...

 

You should post more informations, especially whether or not you are using avio.

 

Anyway, with HPVM 4.x or 6.x and avio, it should work if the disk is not in use in the VM.

 

I had the same troubles in the past. So my tip is now to remove the disk from the guest's kernel before trying to detach it from the vm. I use in the guest something like " rmsf -a /dev/rdisk/diskGUESTINSTANCE " just before applying the hpvmmodify command.

 

Question : if you are using HPVM 4.3 or 6.x, have you considered using NPIV ? Managing NPIV LUNs in a VM guest is about the same than in a physical box : just operate at the storage level and you have nothing to do on the VM host. Nice, especially if you have hundred of Guest's LUNs to manage, or if you are playing with temporary snapshots.

 

Hope it will help

 

Eric

 

anidil99
Occasional Contributor

Re: WEIRD ISSUE WHILE REMOVING DISKS FROM VM

Thanks Eric for you reply

 

I will give a try  to your suggestion of using  rmsf -a and see if that helps.  We have both 4.2 & 4.3 in our environment and all are using AVIO.

 

I am doing this as part of migrating the storage from old hitachi arrays to new model.

 

Thanks again

Patrick Wallek
Honored Contributor

Re: WEIRD ISSUE WHILE REMOVING DISKS FROM VM

For some of the disks you tried removing it shows:

 

root@my-host:/:-) /opt/hpvm/bin/hpvmmodify -P my-guest -d disk:avio_stor:4,1,3:disk:/dev/rdisk/disk165
hpvmmodify: Unable to dynamically delete device disk:avio_stor:4,1,3:disk:/dev/rdisk/disk165 - Device busy.

 

So, the system thinks that those disks are busy for some reason.  Are they still in use on the VM?

anidil99
Occasional Contributor

Re: WEIRD ISSUE WHILE REMOVING DISKS FROM VM

Patrick

 

No , they are not being used on VM  and not part of an VGs

 

Thanks

 

anidil99
Occasional Contributor

Re: WEIRD ISSUE WHILE REMOVING DISKS FROM VM

Hi Eric

 

rmsf -a option did not help. Not only that , I  notice the VM  is getting  new device name.

 

For instance  on VM, I do rmsf -a /dev/rdisk/disk30 and from vm host , I do hpvmmodify for the host disk corresponding to disk30.

 

When I come back on VM , I see   disk30 changed to something else - say disk25

 

Thanks

Eric SAUBIGNAC
Honored Contributor

Re: WEIRD ISSUE WHILE REMOVING DISKS FROM VM

I have attached a small script that is supposed to clean a given dsf in a VM guest

 

I call this script via remsh/ssh to the VM Guest, from a main script running on the VM Host,  when the main script is not able to properly delete a virtual disk with hpvmmodify.

 

Suppose you have a physical disk disk43, with a WWN like 0x50002ac0045b2074 (as seen by the command scsimgr) and attached to virtual path 3,2,11 in the VM.

 

The synopsis is :

 

/opt/hpvm/bin/hpvmmodify -P TheVM -d disk:avio_stor:3,2,11:disk:/dev/rdisk/disk43

If disk still visible in the current VM configuration (hpvmstatus)

then ssh TheVM "delete_virtual_disk.sh 0x50002ac0045b2074 3,2,11"
     sleep 2
     /opt/hpvm/bin/hpvmmodify -P TheVM -d disk:avio_stor:3,2,11:disk:/dev/rdisk/disk43

 

 

The script has been tested whith hpvm 4.30, guest and host HP-UX 11iv3 September 2011, plus somes 2012 patches.

 

 

So the actions could be :

 

- clean a Guest 4.30. I mean do some ioscan / insf -e to be sure all the virtual disks are correctly bound in the guest

- from the vmhost delete virtual disks with hpvmmodify, one by one, until it doesn't work.

- note the bus,device,id and the WWN of the faulty disk (scsimgr -p get_attr -D /dev/rdisk/diskXX -a wwid)

- execute the attached script in the VM with WWN as first arg and bus,device,id as the second one

- from the vmhost try to delete again the faulty disk.

 

PS : I haven't so much time. So I may sometimes "hang" ;-)

 

rkossowski
Occasional Visitor

Re: WEIRD ISSUE WHILE REMOVING DISKS FROM VM

To remove Virtual disk from running vPar please follow these simple steps. 

 

1. Clean up disk fron VG ( umount, vgchange, vgexport .. etc..  etc.. )

2. rmsf -H <path ot hardware> via isocan -funC disk.

                      insf -H  0/0/0/0/0.1.0

3. rmsf -H <agile path> via isocan -fuNC disk.

                      rmsf -H 64000/0xfa00/0x4

 

4.Remove/detach Virtual disk from vPar. 

                      vparmodify -p vpar2 -d disk:avio_stor:0,0,1

5. you are done. 

 

Robert Kossowski. 

 

                    

 

 

Primesh Abeysinghe
Frequent Advisor

Re: WEIRD ISSUE WHILE REMOVING DISKS FROM VM

Robert Kossowski is correct, I have tried the options

 

Thanks for the answer