vagrant-smartos / vagrant-smartos-zones

Manage SmartOS local zones in Vagrant
MIT License
54 stars 9 forks source link

User should be able to export/use local zone image #26

Open sax opened 9 years ago

sax commented 9 years ago

After doing some configuration of a zone, the user should be able to export that zone as a base image, into the local file system.

When provisioning a new zone, the user should then be able to use the zones from the local file system.

sax commented 9 years ago

This might need to run a local http server in the host operating system in order to serve the image metadata as well as to allow the global zone to import the image.

sax commented 9 years ago

This depends on managing zfs snapshots, an ability which I just added to the plugin.

bixu commented 9 years ago

Oh wow, this is cool.

sax commented 9 years ago

Yeah. Now that we're using test kitchen, the fact that we have to install build-essential and chef every time adds minutes to each kitchen test. I want to be able to build local images.

sax commented 9 years ago

What would you say to having image overrides? Like bundler local gem overrides, where if a particular image is used, the plugin swaps out a local one.

This would allow you to check in a Vagrantfile or .kitchen.yml with a public image, but then run vagrant with a modified image from the host system.

bixu commented 9 years ago

That seems reasonable.

bixu.co

On 09 Dec 2014, at 16:40, Eric Saxby notifications@github.com wrote:

What would you say to having image overrides? Like bundler local gem overrides, where if a particular image is used, the plugin swaps out a local one.

This would allow you to check in a Vagrantfile or .kitchen.yml with a public image, but then run vagrant with a modified image from the host system.

— Reply to this email directly or view it on GitHub.

bixu commented 9 years ago

Drop me a direct line when you have achieved this? I can think of some reasons we'd want to use custom images at $job, and we will have a private SDC install soon, too.

sax commented 9 years ago

Will do. This is going to be a bit of work, but I'll be incrementally adding bits and pieces of it on master over the next few weeks.

On Wed, Dec 10, 2014 at 1:15 AM, Blake Irvin notifications@github.com wrote:

Drop me a direct line when you have achieved this? I can think of some reasons we'd want to use custom images at $job, and we will have a private SDC install soon, too.

— Reply to this email directly or view it on GitHub https://github.com/vagrant-smartos/vagrant-smartos-zones/issues/26#issuecomment-66423099 .


e s

sax commented 9 years ago

Another thing this will be nice for is to download a zone image onto the host once, then install it into a VM from a local image server. It'll make it faster/easier to work with multiple images without having to create new base boxes.

sax commented 9 years ago

Next to do: after downloading the compressed image, we need to created a manifest file.

For reference: https://wiki.smartos.org/display/DOC/Managing+Images

bixu commented 9 years ago

A big +1 to this. Local Vagrant-powered Test Kitchen is about 2x slower against SmartOS LX than against Ubuntu native just because of bit sucking. I would love to work on this, but my time is pretty limited right now. If want to try a remote pair on a Friday night I might be able to swing it.

sax commented 9 years ago

I'm in the same boat. I really want this feature, but am only going to have little bits of time here or there to get it working.

bixu commented 9 years ago

I'm hoping to get to a place at $job where it's again reasonable for me to take hack-days. If so, maybe I can fast-track this a little. Test Kitchen/ServerSpec is life to me these days :)

sax commented 9 years ago

I just finished up and pushed the last bit of code for this to work. @bixu want to try it out and see if you run into any problems? I released 0.2.0 to rubygems.

sax commented 9 years ago

One update I need to do is to change local datasets from bzip2 to gzip. They will be around 15% larger, but a lot faster to unzip when starting up new zones.

bixu commented 9 years ago

I have this at the top of our NFR/Ops backlog - will get back to you as soon as we've tested

bixu commented 9 years ago

Is this supposed to be fully-automted by version 2 of the plugin or do I need to set up the local image server myself? A quick look this morning and it doesn't seem to be faster than the previous version of the plugin, although I'm doing a kitchen test with a SmartOS configuration I had used yesterday.

sax commented 9 years ago

You don't need to set up an image server... it uses rsync to get the local image into the global zone... that's not as fast as I was expecting, but for me it's still a bit faster than installing all of build-essentials from scratch every time I run test-kitchen.

https://github.com/vagrant-smartos/vagrant-smartos-zones/blob/master/lib/vagrant/smartos/zones/util/rsync.rb