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?

  • I have done that with the same image and it works just fine. – user176316 Jun 3 '13 at 13:53
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 
  • Thanks a lot! I have been googling around quite a bit but for some reason not finding it. – MortenSickel Jun 3 '13 at 18:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.