1 Reply Latest reply: Apr 24, 2013 3:25 PM by Dan de Gruchy RSS

    Use CLI to Clone Snapshots taken via Volume Collection

    Matthew Hein Newbie
    Visibility: Open to anyone



      Has anyone figured out how to use the CLI to clone snapshots taken via a volume collection (if possible at all)? I know the CLI commands to do this per volume, but that requires hitting each volume associated with a VC and verifying you have the right snapshot.


      I know it is easy to do via the GUI, but it can be time consuming when having to do this for 10 or more VCs.



        • Re: Use CLI to Clone Snapshots taken via Volume Collection

          Howdy Matthew,

          Currently we do not have a way to make clones at the volume collection level in the CLI (however we do have an RFE open for this).  As you have discovered it is possible to do them one volume at a time with a syntax similar to the one below.

                 vol --clone volume_name --snapshot snap_name --clonename name_of_clone --initiatorgrp initgroup_name --multi_initiator {yes | no}

          It is recommended to set initiator group and multi initiator flags upon creation of the clone.  There are other options that can be added as well like a description, read only , quotas, and warning levels and reserves.  You can see the entire list below (this is a snippit from the man page).

                 vol --clone volname [--snapname snapname] [--clonename clonename]

                 [--description text] [--readonly { yes | no }] [--reserve percent]

                 [--quota percent] [--warn_level percent] [--snap_reserve percent]

                 [--snap_quota percent] [--snap_warn_level percent] [--start_offline]

                 [--apply_acl_to {volume|snapshot|both}] [--chapuser username] [--ini-

                 tiatorgrp group_name] [--multi_initiator { yes | no }]

          If you need to perform a large batch of clones you could generate a script that can log into the array and perform each clone for you, or you can simplify the the manual route by using information from the snapcoll --list and --info commands. 

          In this example I've already performed a snapcoll --list  (snapcolls are the snapshot version of the volcoll) which lists out all the snapshot collections (a grouping of all the volume snapshots taken at a point in time in the volume collection).

          This is a snippit of the snapcoll --list  It shows the volcoll name on the right, followed by the snapcoll name, followed by the number of snapshots per snapcoll and lastly the replication status (these are not replicating).

               ESX                  ESX-hourly-2013-01-09::01:00:00.000           4 N/A

               ESX                  ESX-hourly-2013-01-08::23:00:00.000           4 N/A

               ESX                  ESX-hourly-2013-01-08::22:00:00.000           4 N/A

               ESX                  ESX-hourly-2013-01-08::21:00:00.000           4 N/A

               ESX                  ESX-hourly-2013-01-08::20:00:00.000           4 N/A

               ESX                  ESX-hourly-2013-01-08::19:00:00.000           4 N/A

          Now lets say I want to clone the 8pm on the 8th snapshots. i just run the command with the snapcoll I want the info on.

               support1-B:/# snapcoll --info ESX-hourly-2013-01-08::20:00:00.000

               Name: ESX-hourly-2013-01-08::20:00:00.000

               Description: Created by protection policy ESX schedule hourly

               Volume collection name: ESX

               Origination group name: support1

               Is replica: No

               Is manual: No

               Replication status: N/A

               Replication started: N/A

               Replication completed: N/A

               Created: Jan  8 2013 20:09:00


                  Volume: labvm6

                          Snapshot: ESX-hourly-2013-01-08::20:00:00.000

                  Volume: blabvmmgr

                          Snapshot: ESX-hourly-2013-01-08::20:00:00.000

                  Volume: labvm4

                          Snapshot: ESX-hourly-2013-01-08::20:00:00.000

                  Volume: labvm3

                          Snapshot: ESX-hourly-2013-01-08::20:00:00.000

          As you can see here, the snapshot name for each volume is exactly the same, just the volume names change.  So if you wanted to create the clones manually you can type out 1 command, and then up arrow the command and change the volume name and the clone name and repeat. 

               vol --clone labvm6 --snapshot ESX-hourly-2013-01-08::20:00:00.000 --clonename labvm6Cln --initiatorgrp supesx --multi_initiator yes

               vol --clone labvm4 --snapshot ESX-hourly-2013-01-08::20:00:00.000 --clonename labvm4Cln --initiatorgrp supesx --multi_initiator yes

               vol --clone labvm3 --snapshot ESX-hourly-2013-01-08::20:00:00.000 --clonename labvm3Cln --initiatorgrp supesx --multi_initiator yes

               vol --clone blabvmmgr --snapshot ESX-hourly-2013-01-08::20:00:00.000 --clonename blabvmmgrCln --initiatorgrp supesx --multi_initiator yes