[one-users] Non clonable readonly shared OS image?
Fabian Wenk
fabian at wenks.ch
Thu Sep 8 08:37:22 PDT 2011
Hello Ismael
On 07.09.2011 19:15, Ismael Farfán wrote:
> 2011/9/7 Roger Pau Monné:
>> I don't think it's possible to launch an OS from a single image
>> multiple times...
>>
> Actually I can, the problem is that the contextualization needs to modify
> the hostname, interfaces, passwd, shadow... since many VMs do that
> it corrupts the FS (actually, only those files, I think).
Usually every Unix like OS does write to the disk, mostly in /var/
eg. log, pid and lock files. Now when you have several VMs writing
to the same disk based file system during the same time, it will
corrupt the file system. There is no clean file locking available
when a file system on a disk (or image) is mounted from more then
one running OS.
I guess your only chance is to create a Live CD based on your own
installation (your distribution should provide tools to do this),
then it should work, as an OS bootet from Live CD does create
union mounts with a RAM disk, so writing to the file system is
going into RAM and not written back to the disk (in this case the
ISO image).
> Mainly I was wondering why with readonly=yes the VM doesn't boot at
> all, it fails before even calling kvm and I can't figure out why.
I guess this is not supported from ONE if an OS image (not CD
image) is set to read only, and it will abort at an early stage.
Did you see anything in the log/one/<VID>.log file?
> I'll try modifying fstab to mount / as readonly and set readonly=no in the
> VM description file, maybe that'll work.
I guess your OS will then not work properly and have some other
strange problems, if the / is read only.
> 2011/9/7 Matthew Smith:
>> Hi
>>
>> Have you tried doing this with a 'live CD' distribution image (which is by
>> its nature normally a read only boot)?
>
> I haven't. The idea is that my OS image works as a live CD since I need to
> install some random stuff until it works as a virtual cluster.
During the first phase (as long as you need to setup your system),
just create a persistent disk image and run a single VM with it.
When you have everything installed as needed, use the tools from
your distribution to create a Live CD. Eventually you need to
start your installation based on the Live CD provided from your
distribution. When you have created your Live CD you have to
register this ISO image in ONE. And then you can create several
VMs which use the registered ISO image (as CD) as the boot file
system.
bye
Fabian
More information about the Users
mailing list