HPE Storage Users Group
https://3parug.com/

Script to remove all virtual volumes
https://3parug.com/viewtopic.php?f=17&t=709
Page 1 of 1

Author:  operator [ Fri May 09, 2014 6:20 am ]
Post subject:  Script to remove all virtual volumes

Hello,
I'm looking for the fastest way to remove all virtual volumes from 3par from cli. I'm running a demo environment so I need to remove all created volumes once in a while. If i use "removevv -f -pat * " does it remove .srdata and admin volumes too or is that impossible? I'm new with this stuff. Thank you in advance!

Author:  Richard Siemers [ Fri May 09, 2014 9:35 am ]
Post subject:  Re: Script to remove all virtual volumes

Test it with the -dr (dry run) option to see if they are included.
Too bad there is not an option to remove by ID# with a pattern.

Author:  Richard Siemers [ Fri May 09, 2014 9:53 am ]
Post subject:  Re: Script to remove all virtual volumes

Its not looking good for the "-pat *" option.

Code:
SS7400 cli% showvv
                                                     --Rsvd(MB)--- -(MB)-
Id Name    Prov Type CopyOf BsId Rd -Detailed_State- Adm Snp   Usr  VSize
 1 .srdata full base ---       1 RW normal             0   0 81920  81920
 0 admin   full base ---       0 RW normal             0   0 10240  10240
-------------------------------------------------------------------------
 2 total                                               0   0 92160  92160
SS7400 cli% removevv -dr -pat *
Dry run : removevv -ld admin
Dry run : removevv -ld .srdata


Frustrating... so I cracked the book:

http://h20565.www2.hp.com/portal/site/h ... .492883150

Page 12 covers glob-style pattern matching... however it does not appear that 3PAR implemented an option to exclude. So this pattern will kill anything that starts with a CAPTIAL A-Z, lowercase b-z, or a number... but will leave behind anything that starts with a or non-alphanumeric. Perhaps a start that you can tweak to meet your goal.

Code:
SS7400 cli% removevv -dr -pat \[A-Zb-z0-9\]*
No matching vvs

Author:  operator [ Mon May 12, 2014 1:17 am ]
Post subject:  Re: Script to remove all virtual volumes

Thank you very much this is just what I was looking for! I also tried to look for the exclusion logic but couldn't find anything...
I also tried to run the -pat * as "edit" user who has access to all domains. It doesn't show .srdata and admin volumes when you list the volumes but it tries to delete them when you enter the * pattern. If you choose "yes", it will not allow you to remove the disks but I guess it's not really best practice trying to erase critical disks five times a day.
Thanks again!

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/