Differences between revisions 1 and 2
Revision 1 as of 2008-05-22 13:55:55
Size: 278
Comment: first draft
Revision 2 as of 2008-05-22 16:15:40
Size: 3887
Comment: update
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:

Line 8: Line 6:
[[TableOfContents]]

== Prerequisites ==

Installed and running XEN Dom0. (with NAT)


In the test a Debian sid netinstall was used.
Line 10: Line 17:
 (1) Install lvm-common lvm2  (1) Test if module is installed:
Line 12: Line 19:
{{{
test:~# modprobe dm-mod
test:~# lsmod|grep dm
dm_snapshot 15552 0
dm_mirror 19152 0
dm_mod 50232 2 dm_snapshot,dm_mirror
}}}

(2) Install Packages
{{{
aptitude install lvm2
=> lvm-common lvm2
}}}

(3) Adjust Drive Range

{{{
vim /etc/lvm/lvm.conf
Line 13: Line 38:
    # By default we accept every block device
    # filter = [ "a/.*/" ]
    filter = [ "a|/dev/sda4|", "r/.*/" ]
}}}

(4) Make sure we have no pre-installed drives
{{{
vgscan
  Reading all physical volumes. This may take a while...
  No volume groups found
vgchange -a y
  No volume groups found
}}}

(5) Create a Volume
{{{
pvcreate /dev/sda4
  Physical volume "/dev/sda4" successfully created
}}}

(6) Create Volume Group
{{{
vgcreate vg /dev/sda4
  Volume group "vg" successfully created
(not done: vgextend vg /dev/sdb4)
}}}

(7) Create virtual Machine
{{{
xen-create-image --hostname buildsid --ip 10.0.2.40 --gateway 10.0.2.40
}}}
Line 15: Line 72:
{{{lvcreate -L 12M --snapshot -n vol2 /dev/Volg1/vol1} {{{
lvcreate -L 2G --snapshot -n buildsid-disk-ss /dev/vg/buildsid-disk
}}}
Line 17: Line 76:
== restore LVM snapshot == == restore LVM snapshot time ==

The aim of this section is to measure the time

(1) Start virtual machine

(2) Log into machine

(3) Make some changes
{{{
buildsid:~# dd bs=1024 count=100000 if=/dev/urandom of=test.img
100000+0 records in
100000+0 records out
102400000 bytes (102 MB) copied, 25.68 s, 4.0 MB/s
}}}

(4) This makes some changes to the snapshot:
{{{
  lvdisplay /dev/vg/buildsid-disk-ss
  [...]
  LV Size 10,00 GB
  Current LE 2560
  COW-table size 2,00 GB
  COW-table LE 512
  Allocated to snapshot 4,86%
  Snapshot chunk size 8,00 KB
  [...]
}}}
(5) Shut down the machine

(6)
An now the test:

{{{
time lvremove -f /dev/vg/buildsid-disk-ss; time lvcreate -L 2G --snapshot -n buildsid-disk-ss /dev/vg/buildsid-disk
}}}

(7)
The result is:
{{{
  Logical volume "buildsid-disk-ss" successfully removed

real 0m0.088s
user 0m0.000s
sys 0m0.036s
  Logical volume "buildsid-disk-ss" created

real 0m0.225s
user 0m0.000s
sys 0m0.048s
}}}

(8)
A second run on an unchanged snapshot:
{{{
  Logical volume "buildsid-disk-ss" successfully removed

real 0m0.067s
user 0m0.000s
sys 0m0.032s
  Logical volume "buildsid-disk-ss" created

real 0m0.170s
user 0m0.000s
sys 0m0.052s
}}}

Subjective observation: Sometimes it can take up to 3 seconds.

(9) Results:

|| || remove || create || total time ||
||Debian Sit 10GB/2GB || 0.088s || 0.225s || 0.243s ||

== turnaround time ==

The trunaround time is the time from '''t0''' (shutting down machine A) to '''tn''' (machine B is up). The following stages can be forseen:

|| Time || Event ||
|| t0 || trigger shutdown ||
|| t1 || shutting down machine A ||
|| t2 || machine is down ||
|| t3 || start delete snapshot ||
|| t4 || end delete snapshot ||
|| t5 || start create snapshot ||
|| t6 || end create snapshot ||
|| t7 || start booting machine B ||
|| t8 || end of booting machine B||
|| t9 || sending signal from B ||
Line 20: Line 167:
== turnaround time == Preparations:

(1) boot the machine

(2) make it is up and running

(3) Copy a ssh key for a user on that
  machine to the autorized_key file, so that
  the user can log in to that machine without
  password.

The following script measures the time:
{{{
time turnaround.pl
}}}

The "turnaround.pl" script do work

{{{
TODO
}}}

LVM

The aim of this page is to summarize the LVM relevant parts.

?TableOfContents

Prerequisites

Installed and running XEN Dom0. (with NAT)

In the test a Debian sid netinstall was used.

Preparations

  • (1) Test if module is installed:

test:~# modprobe dm-mod
test:~# lsmod|grep dm
dm_snapshot            15552  0
dm_mirror              19152  0
dm_mod                 50232  2 dm_snapshot,dm_mirror

(2) Install Packages

aptitude install lvm2
=>  lvm-common lvm2

(3) Adjust Drive Range

vim /etc/lvm/lvm.conf
 
    # By default we accept every block device
    # filter = [ "a/.*/" ]
    filter = [ "a|/dev/sda4|", "r/.*/" ]

(4) Make sure we have no pre-installed drives

vgscan
  Reading all physical volumes.  This may take a while...
  No volume groups found
vgchange -a y
  No volume groups found

(5) Create a Volume

pvcreate /dev/sda4
  Physical volume "/dev/sda4" successfully created

(6) Create Volume Group

vgcreate vg /dev/sda4
  Volume group "vg" successfully created
(not done: vgextend vg /dev/sdb4)

(7) Create virtual Machine

xen-create-image --hostname buildsid --ip 10.0.2.40 --gateway 10.0.2.40

make LVM snapshot

lvcreate -L 2G --snapshot -n buildsid-disk-ss /dev/vg/buildsid-disk

restore LVM snapshot time

The aim of this section is to measure the time

(1) Start virtual machine

(2) Log into machine

(3) Make some changes

buildsid:~# dd bs=1024 count=100000 if=/dev/urandom of=test.img
100000+0 records in
100000+0 records out
102400000 bytes (102 MB) copied, 25.68 s, 4.0 MB/s

(4) This makes some changes to the snapshot:

  lvdisplay /dev/vg/buildsid-disk-ss
  [...]
  LV Size                10,00 GB
  Current LE             2560
  COW-table size         2,00 GB
  COW-table LE           512
  Allocated to snapshot  4,86%
  Snapshot chunk size    8,00 KB
  [...]

(5) Shut down the machine

(6) An now the test:

time lvremove -f /dev/vg/buildsid-disk-ss; time lvcreate -L 2G --snapshot -n buildsid-disk-ss /dev/vg/buildsid-disk

(7) The result is:

  Logical volume "buildsid-disk-ss" successfully removed

real    0m0.088s
user    0m0.000s
sys     0m0.036s
  Logical volume "buildsid-disk-ss" created

real    0m0.225s
user    0m0.000s
sys     0m0.048s

(8) A second run on an unchanged snapshot:

  Logical volume "buildsid-disk-ss" successfully removed

real    0m0.067s
user    0m0.000s
sys     0m0.032s
  Logical volume "buildsid-disk-ss" created

real    0m0.170s
user    0m0.000s
sys     0m0.052s

Subjective observation: Sometimes it can take up to 3 seconds.

(9) Results:

remove

create

total time

Debian Sit 10GB/2GB

0.088s

0.225s

0.243s

turnaround time

The trunaround time is the time from t0 (shutting down machine A) to tn (machine B is up). The following stages can be forseen:

Time

Event

t0

trigger shutdown

t1

shutting down machine A

t2

machine is down

t3

start delete snapshot

t4

end delete snapshot

t5

start create snapshot

t6

end create snapshot

t7

start booting machine B

t8

end of booting machine B

t9

sending signal from B

Preparations:

(1) boot the machine

(2) make it is up and running

(3) Copy a ssh key for a user on that

  • machine to the autorized_key file, so that the user can log in to that machine without password.

The following script measures the time:

time turnaround.pl

The "turnaround.pl" script do work

TODO