LVM Snapshot

kcrawford

Renowned Member
Nov 29, 2013
21
2
68
Hello,

I am attempting to create copy on write snapshot of my Windows Server 2008 R2 VM for testing purposes. I would like to be able to snapshot the VM at a point in time, make changes, delete the snapshot and be back to the time before taking the snapshot.

I have completed the following steps:

1. Created a snapshot of my vm disk image.

Code:
root@proxmox:~# lvcreate --size 5GB -s -n snap /dev/sky-vol/vm-101-disk-1
  Logical volume "snap" created

2. Added the disk image tag to the VM configuration.

Code:
root@proxmox:~# lvchange --addtag pve-vm-101 /dev/sky-vol/snap
  Logical volume "snap" changed

3. Edited the VM configuration file to use the snapshot as the ide0 device.

Code:
#ide0: container_storage:vm-101-disk-1,size=50G
ide0: container_storage:snap,size=50G

4. Attempted to start the VM, I receive the following error.

Code:
root@proxmox:~# qm start 101
unable to parse lvm volume name 'snap'

Can someone guide me as to what I am doing wrong?

*Also*, output from pveversion:


Code:
root@proxmox:~# pveversion -v
proxmox-ve-2.6.32: 3.2-126 (running kernel: 2.6.32-29-pve)
pve-manager: 3.2-4 (running version: 3.2-4/e24a91c1)
pve-kernel-2.6.32-20-pve: 2.6.32-100
pve-kernel-2.6.32-22-pve: 2.6.32-107
pve-kernel-2.6.32-29-pve: 2.6.32-126
pve-kernel-2.6.32-26-pve: 2.6.32-114
pve-kernel-2.6.32-23-pve: 2.6.32-109
lvm2: 2.02.98-pve4
clvm: 2.02.98-pve4
corosync-pve: 1.4.5-1
openais-pve: 1.1.4-3
libqb0: 0.11.1-2
redhat-cluster-pve: 3.2.0-2
resource-agents-pve: 3.9.2-4
fence-agents-pve: 4.0.5-1
pve-cluster: 3.0-12
qemu-server: 3.1-16
pve-firmware: 1.1-3
libpve-common-perl: 3.0-18
libpve-access-control: 3.0-11
libpve-storage-perl: 3.0-19
pve-libspice-server1: 0.12.4-3
vncterm: 1.1-6
vzctl: 4.0-1pve5
vzprocps: 2.0.11-2
vzquota: 3.1-2
pve-qemu-kvm: 1.7-8
ksm-control-daemon: 1.1-1
glusterfs-client: 3.4.2-1
root@proxmox:~#
 
Last edited:
Hello,

I am attempting to create copy on write snapshot of my Windows Server 2008 R2 VM for testing purposes. I would like to be able to snapshot the VM at a point in time, make changes, delete the snapshot and be back to the time before taking the snapshot.
Hi,
there is an different naming with lvm-snapshots. If you delete the snapshot the "old" content was removed and only the uptodate LV was there!
I have completed the following steps:

1. Created a snapshot of my vm disk image.

Code:
root@proxmox:~# lvcreate --size 5GB -s -n snap /dev/sky-vol/vm-101-disk-1
  Logical volume "snap" created
And now you have all what you need! Any changes was written to /dev/sky-vol/vm-101-disk-1 and the old content was stored in /dev/sky-vol/snap
(this is the reason, why you can easy delete the snapshot).

If you want to revert you must do this (with switched off VM):
Code:
lvconvert --merge /dev/sky-vol/snap
Of course you should have an valid backup and test the scenario.

There are no changes in the VM-config!


Udo
 
This appears to have worked. I did power down the VM taking the snapshot and performing the merge(?) using the lvconvert command. I will test further to determine if this is needed.

Thank you for the quick reply.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!