[one-users] modifying a virtual machine resources

Fabian Wenk fabian at wenks.ch
Tue Dec 6 13:36:12 PST 2011


Hello Davood

On 06.12.2011 21:32, davood ghatreh wrote:
> Do you know how this "save as" feature works? I can use it. when I save as
> a VM, it goes to my images, and after a while of being LOCKED, its status
> changes to FAILED. how can i save a machine as an image?

If you want to use the 'onevm saveas <vm_id> <disk_id> 
<image_name>' on a running VM, then you need to be able properly 
shutdown this running VM in OpenNebula and wait until the image 
is written to the Image Repository. The cluster node needs to be 
able to write to the Image folder. The error you see, could be 
because this writing is not possible. Check your log files.

Alternatively you could do the following steps to create an image 
into the Image Repository:

Create the image manually (outside of OpenNebula) with this steps 
(for KVM):

On a system which has KVM available:
qemu-img create -f raw servername.img 10G
qemu-system-x86_64 -hda servername.img -cdrom 
/path/to/install.iso -boot d -m 512
Connect through VNC for installation, the above command will 
report you the used port (default 5900)
qemu-system-x86_64 servername.img -m 512  # to test after install
Connect through VNC
login and run 'poweroff' as root or with sudo

Now on the front-end:
Create an image template (servername-image.one)
oneimage register servername-image.one
Create an VM template for the host (servername.one)
onevm create servername.one

Hope this helps.


bye
Fabian



More information about the Users mailing list