Hi,

The inability to create more than 1 clone at a time (ie: in separate TXGs) is something which has hampered me (and several projects on which I have worked) for some years, now.

Specifically I am looking at various forms of diskless grid/cloud environments where you create a "golden image", snapshot it, and then clone that snapshot perhaps 1000 times for 1000 machines... poking the image slightly each time, and letting DHCP pick up the administrative slack of systems management.


To create 1000 clones in this fashion (for i in `range 1 1000` do ; zfs clone [...] ; done) may take well over 1 hour, because 1000 TXGs need to be set up and committed.

I would like to create 1000 clones in rather less than a couple of minutes.


I've kicked this idea around with Darren Moffat and he informs me that it is painful to achieve the obvious solution:

        zfs clone tank/s...@version  tank/foo tank/bar tank/baz ...

...because to explicitly specify each (of multiple) clone names on the cmdline causes multiple calls to ioctl() and therefore multiple TXGs, and thus slowness.

Thus we hit on this proposal, for your consideration:



zfs multiclone tank/f...@1 tank/<PATTERN> <BEGIN> <END> [STRIDE]

- implement limited but comprehensive snprintf semantics for PATTERN

- support: %d, %3d, %03d, FOO%d, FOO%dBAR, FOO%#08xBAR

- includes decimal, hex, octal

- BEGIN, END, STRIDE all decimal positive integers

- STRIDE optional, defaults to 1

- creation begins at BEGIN, increments by STRIDE, continues until END
  is exceeded


Examples:

- zfs multiclone tank/sh...@1 tank/fish%02d 0 7 2

- creates: /tank/fish00 /tank/fish02 /tank/fish04 /tank/fish06

- zfs multiclone tank/gold-image tank/diskless/node%d.root 1 100

- ...is pretty obvious. (.../node1.root/ etc)


What do you think?

        - alec


_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to