pkg_add http://pkgsrc.joyent.com/sdc6/2012Q1/i386/All/smtools
# note this is going to shut down the VM
sm-prepare-image
# b996c578-c4fc-46ef-81cc-d2eb3489ebc6 is the UUID
# of the zone I want to snapshot and clone. `uuid`
# returns a new UUID.
zfs snapshot zones/b996c578-c4fc-46ef-81cc-d2eb3489ebc6@`uuid`
# we can see the snapshot we made
zfs list -t snapshot
# create a new UUID for the clone
export CLONE_UUID=`uuid`
# clone!
# the UUID after the `@` is the UUID for from our snapshot version
zfs send zones/b996c578-c4fc-46ef-81cc-d2eb3489ebc6@81e67092-cb63-11e1-b0f3-fbc4021003b3 | zfs recv zones/$CLONE_UUID
# now you should be able to use $CLONE_UUID as a "dataset_uuid" in a VM json spec.
After stopping and running the prepare script on my machine, I was unable to log in via ssh again. I saw this ssh error:
Unable to negotiate a key exchange method
I fixed this by zlogin
'ing back into the machine and running the following:
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
svcadm restart ssh