[xen-tools] Re: Feature request

C.J. Adams-Collier cjcollier at gmail.com
Tue Oct 2 18:11:33 CEST 2007


Heh.  That's not quite what I meant, since it doesn't take advantage
of lvcreate's -s option.  I was thinking that instead of having the
script run...

my $lv = "$hostname-disk";
my $lvDev = File::Spec->catdir($vg, $lv);

my @command =
  (
    "lvcreate $vg -n $lv -L $size",
    "mkfs.$fsType $lvDev",
    "mount $lvDev $mountPoint",
    "cp -a $source/. $mountPoint",
  );

foreach my $cmd (@commands){
  system( $cmd );
  # error handling
}

We could reduce the @command list, image creation time and disk usage
overhead by doing the following:

my $lvOriginDev = File::Spec->catdir($vg, "$dist-base");
my @command =
  (
    "lvcreate -s $lvOriginDev -n $hostname-disk -L $size"
  );

foreach my $cmd (@commands){
  system( $cmd );
  # error handling
}

Of course, we would need to create $lvOriginDev using one of the
existing mechanisms (copy, debootstrap, rpmstrap, whatever) if it did
not already exist.

However, once it does exist, snapshot creation is almost
instantaneous, and saves a lot of other overhead.

Cheers,

C.J.

On 10/2/07, Steve Kemp <steve at steve.org.uk> wrote:
> On Tue Oct 02, 2007 at 08:53:58 -0700, C.J. Adams-Collier wrote:
>
> > This pristine image could then be used as an origin for
> > all consecutive images of that role/os/what-have-you.
>
>   That should be supported right now, via:
>
>     xen-create-image --install-method=copy
>     --source=/path/to/mounted/snapshot
>
>   Or am I being dense?
>
> > Cool.  Shall I add a patch to the TODO?  Do you feel comfortable
> > adding me an account at this time?  In case you do, I'll attach an ssh
> > pub key.
>
>   Feel free.  I'll mail you off-list once I've added you.  (Ten minutes
>  or so.)
>
> Steve
> --
>
>
>


-- 
moo.





More information about the xen-tools-discuss mailing list