[OpenIndiana-discuss] ZFS Snapshot question

Kees Nuyt k.nuyt at zonnet.nl
Fri Aug 3 12:43:56 UTC 2012


On Thu, 2 Aug 2012 14:59:13 -0600, you wrote:

>Hi Mark,
>
>On Thu, Aug 2, 2012 at 2:53 PM, Mark Creamer <whitetr6 at gmail.com> wrote:
>> What I should have done (I think) is set up the zfs file system for each VM
>> at the level below ../vmimages, that is:  "zfs create
>> datastore/vmimages/server1". That way, auto-snapshot would be creating
>> snapshots for each VM, rather than for the entire ../vmimages file system
>> each time.
>>
>> So, is there an easy way to make a separate zfs file system for each of the
>> existing directories below ../vmimages? I am able to take the VM guests
>> down to do this as needed.
>
>Yes, zfs filesystems can be nested as many times as you like. On a
>single pool, you could have "/", then "/home", then "/home/mark", and
>then even create subfilesystems for different kinds of data
>(compressible data, data that needs copies=2, etc.).
>
>Having said that, I believe they need to be mounted in empty
>directories, so you'd have to do:
># mv datastore/vmimages/server1 datastore/vmimages/server1.bak
># zfs create -o [options here] datastore/vmimages/server1
># cp -a datastore/vmimages/server1.bak/* datastore/vmimages/server1
># rm -r datastore/vmimages/server1.bak

Another procedure would be to 
- take all VM's down
- zfs rename datastore/vmimages to datastore/oldimages
- zfs create datastore/vmimages
- zfs create datastore/vmimages/server1
- mv /datastore/oldimages/server1/* /datastore/vmimages/server1/
- zfs create datastore/vmimages/server2
- mv /datastore/oldimages/server2/* /datastore/vmimages/server2/

etc.

-- 
Regards,

Kees Nuyt




More information about the OpenIndiana-discuss mailing list