I'd like to use an OpenSolaris EC2 instance as a DB server, using an external EBS volume connected to a ZFS pool.
If I set-up the ZFS pools then bundle-up the EC2 image, could I terminate the instance then safely re-attach the existing EBS volume (with data) to a new EC2 instance after it boots?
My main concern is if the instance terminates unexpectedly. I would ideally like to bring up a new instance and automate the re-attachment of the EBS volume but I'm not sure whether I could store the AMI with the pool structure already set, or whether I'd have to issue some commands at start-up to build the pool structure after attaching the volume.
I haven’t used ZFS on EBS, so I don’t know if there are specific wrinkles related to that (there shouldn’t be).
When moving ZFS pools between “machines” (real or virtualised), you’re supposed to
export
the pool beforeimport
ing into the other. It’s not strictly necessary, but it makes things happen more smoothly.This article on migrating ZFS storage pools may give you the heads-up you need.