Script to remove all virtual volumes

Post Reply
operator
Posts: 4
Joined: Wed May 07, 2014 3:12 am

Script to remove all virtual volumes

Post by operator »

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!
User avatar
Richard Siemers
Site Admin
Posts: 1333
Joined: Tue Aug 18, 2009 10:35 pm
Location: Dallas, Texas

Re: Script to remove all virtual volumes

Post by Richard Siemers »

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.
Richard Siemers
The views and opinions expressed are my own and do not necessarily reflect those of my employer.
User avatar
Richard Siemers
Site Admin
Posts: 1333
Joined: Tue Aug 18, 2009 10:35 pm
Location: Dallas, Texas

Re: Script to remove all virtual volumes

Post by Richard Siemers »

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

Code: Select all

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: Select all

SS7400 cli% removevv -dr -pat \[A-Zb-z0-9\]*
No matching vvs
Richard Siemers
The views and opinions expressed are my own and do not necessarily reflect those of my employer.
operator
Posts: 4
Joined: Wed May 07, 2014 3:12 am

Re: Script to remove all virtual volumes

Post by operator »

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!
Post Reply