David wrote:
> LVM snapshots are pretty useful to rapidly spin up copy on write
> VMs.
>
> bdev.py needed a slight tweak to allow this, because you can't
> directly activate or deactive lvm snapshots. This could be
> definitely improved to do things like automatically activate origin
> lvms, check snap%, but my python-fu is weak so this worked for me if
> someone else comes across this:
>
> --- /tmp/bdev.orig.py 2011-07-21 13:51:44.000000000 -0700
> +++ bdev.py 2011-07-21 13:42:46.000000000 -0700
> @@ -643,7 +643,14 @@
> """
> result = utils.RunCmd(["lvchange", "-ay", self.dev_path])
> if result.failed:
> - _ThrowError("Can't activate lv %s: %s", self.dev_path,
> result.output)
> + """Check for snapshot
> + """
> + snapshotRegex=re.compile('snapshot')
> + snapshot=re.search(snapshotRegex,result.output)
> + if snapshot:
> + print "Snapshot LVM detected, please ensure origin is activated
and
> snap% is adequate"
> + else:
> + _ThrowError("Can't activate lv %s: %s", self.dev_path,
> result.output)
This could be a start towards allowing that backups/images are stored/managed
by Ganeti itself and allow quick spin-up.
Original issue reported on code.google.com by ius...@google.com on 19 Jul 2012 at 10:16
Original issue reported on code.google.com by
ius...@google.com
on 19 Jul 2012 at 10:16