0

I have a setup with some test and stagiging servers running on the same host (using virsh to maintain it on ubuntu 10.04)

The test and staging systems are build up with the same sets of servers. One of them being a wms server that has a large disk for holding more or less static maps. Is it possible to use one diks image file on both the test-wms and the staging-wms servers? It may be possible to mount it read-only - or can I use some kind of copy-on-write to manage this?

MortenSickel
  • 203
  • 2
  • 6

1 Answers1

1

You can use the large disk as a base image for two different COW disks. From the qemu-img manpage:

create [-f fmt] [-o options] filename [size] Create the new disk image filename of size size and format fmt. Depending on the file format, you can add one or more options that enable additional features of this format. if the option backing_file is specified, then the image will record only the differences from backing_file. No size needs to be specified in this case. backing_file will never be modified unless you use the "commit" monitor command (or qemu-img commit).

Let's say your original disk is named maps.img and you wanted to create test-maps.img and staging-maps.img for your two VMs.

qemu-img create -f qcow2 -o backing_file=maps.img test-maps.img 
qemu-img create -f qcow2 -o backing_file=maps.img staging-maps.img 
sciurus
  • 12,678
  • 2
  • 31
  • 49