more polish to 5000* demo
[eblake-techtalks.git] / 5000-libvirt-demo.term
blob0b9822b115f37820b499827121953debe61632ab
1 #!/bin/bash
3 source functions
5 # Title.
6 export title="Demonstration with libvirt"
8 # History.
9 remember 'virsh start f32'
10 remember 'virsh backup-begin f32'
11 remember 'virsh shutdown f32'
12 remember 'virsh dumpxml f32 | sed '\''s|<domain type=.kvm.>|<domain type="kvm" xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0"> <qemu:capabilities><qemu:add capability="incremental-backup"/></qemu:capabilities>|'\'' > f32.xml'
13 remember 'virsh define f32.xml'
14 remember ''
16 pushd $talkdir/demo.d >/dev/null
17 rm -f *
18 virsh destroy f32 >& /dev/null
19 virsh undefine --snapshots-metadata --checkpoints-metadata f32 >& /dev/null
20 reset_f32 backup-3000.d
21 terminal
22 if [ ! -f ../backup-5100.d/Base1.qcow2 ]; then
23 echo 'First run, copying...'
24 cp Base1.qcow2 Base2.qcow2 ../backup-5100.d/
25 virsh dumpxml f32 > ../backup-5100.d/f32.xml
27 popd >/dev/null