[one-users] Writing one template that allows for persistent VM:

Carlos Martín Sánchez cmartins at fdi.ucm.es
Fri Feb 4 06:39:34 PST 2011

Hi Steven,

On 4 February 2011 05:22, Steven Timm <timm at fnal.gov> wrote:

> hOn Thu, 3 Feb 2011, Steven Timm wrote:
>> I am trying to come up with a prescription for users that allows the
>> following sequence:
>> 1) Launch a VM based on a standard VM repository template
>> 2) Save the contents of the VM back to the VM repositor\
>> 3) Relaunch the VM without modifying the template.
>> I've tried the following thus far:
>> 1) Launch the VM initially from a VM OS file outside the VM repository
>> with save=yes.  this does save the VM OS but just to
>> /var/lib/one/<vmid>/disk.0, not back to the original file.
>> User must copy that file somewhere and/or change their template.
>> 1a) Launch the VM and then execute a onevm saveas command.
>>   this gets a copy of the image back to the image repository
>>   but again user must modify the template to relaunch the VM.
>> 2) Make a public VM image in the repository, launch from that.
>> Problems--even if image is public, other users (even oneadmin) can't read
>> it and sometimes I myself can't read it, without going into
>> the image repo and chmod'ing the file by hand.  And again
>> you are forced to save back to something other than the original file.
>> 3) Make a persistent non-public image in the repository.
>> Again there are permission problems launching, and it can only
>> be used once by one user.  Even so I can't get it to save back to the
>> repository.
>>  If the user makes and saves the persistent non-public image
> in the repository, it is then necessary to go in and
> change the permissions on the file in the repository, otherwise
> the oneadmin user can't read it.  But once this is done,
> it is possible to start the VM from the repository and save it
> back to the same place in the repository when it is done.
When OpenNebula is installed, the images directory is set up with the sticky
bit. From install.sh:

In [1], it says

"The IMAGE_REPOSITORY_PATH can be changed to another administrator defined
folder. This folder will need to be created with special permissions to
ensure its consistency. It will need full permissions for writting new files
for any user, and:

* the sticky bit, so other users are allowed to read other user files, but
aren't allowed to erase them
* the setgid, so all the files copied to the image repository end up with
oneadmin group

This can be achieved with “chmod 3770 /path/to/image/repository/”."

If you changed the images path, or if for some reason you deleted the var
directory, you'll need to recreate the sticky bit configuration.
In order to let other users register images, you have to either let anyone
write in the images path, or add all your OpenNebula regular users to
oneadmin's group.

Could you please check your configuration? If you continue having troubles,
please send us your installation directory permissions.

> Next step--to make a public non-persistent generic image
> in the repo, and then have a "clone" function such that
> a user can make a non-public persistent image from it and
> fork off their VM and save it from there on.  Anyone else interested?
What's your goal? to control it somehow in the VM template, or rather create
a new command such as:
oneimage clone "Original_public_image" "My_private_copy" ?

> Steve Timm
Best regards,

[1] http://opennebula.org/documentation:rel2.0:oned_conf#image_repository

Carlos Martín, Cloud Technology Engineer/Researcher
DSA Research Group: web http://dsa-research.org and blog
OpenNebula Open Source Toolkit for Cloud Computing:
http://www.OpenNebula.org <http://www.opennebula.org/>

>  Everything that we need to do is doable, but it takes hacking around
>> with the template every time to be able to launch where we
>> left off.  We need a way to make things more seamless.
>> Steve Timm
> --
> ------------------------------------------------------------------
> Steven C. Timm, Ph.D  (630) 840-8525
> timm at fnal.gov  http://home.fnal.gov/~timm/
> Fermilab Computing Division, Scientific Computing Facilities,
> Grid Facilities Department, FermiGrid Services Group, Group Leader.
> Lead of FermiCloud project.
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20110204/bb000f18/attachment-0003.htm>

More information about the Users mailing list