OpenVZ Forum


Home » General » Support » Best practices to get an "image" of a perfect, fresh-install VM
Best practices to get an "image" of a perfect, fresh-install VM [message #11882] Tue, 10 April 2007 20:18 Go to next message
ugob is currently offline  ugob
Messages: 271
Registered: March 2007
Senior Member
Hi,

here is my question.

I've made myself a bare bone "image" of a VM, so that I don't have to do all my tweaks every time I install a new VM.

What I've done:

To create the image (Step A)
- Suspend the VM
- Tar up the private area
- Dump the state
- Resume the VM

Then, when I want to create a new VM based on this "image"(step B):

- Copy the private area to the destination server
- Create a config
- Restore the state
- Restart

I'm sure I'm doing too many steps...

What would be the best way to create such an image? It is not important to me that the original VM stays up in the process. Would it be posssible to simply stop the VM, then tar up the private area and restart the vm when done instead of my step A?

BTW, I could write an how-to if you'd like...

Regards,

Ugo Bellavance


Please read the manual before asking questions:
http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf

Please have a look at the wiki before asking questions:
http://wiki.openvz.org/Main_Page
Re: Best practices to get an "image" of a perfect, fresh-install VM [message #11884 is a reply to message #11882] Tue, 10 April 2007 20:22 Go to previous messageGo to next message
rickb is currently offline  rickb
Messages: 368
Registered: October 2006
Senior Member
Quote:

Would it be posssible to simply stop the VM, then tar up the private area and restart the vm when done instead of my step A?


This is the way I have done it for years, and it has always worked fine.


-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions

UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters
Re: Best practices to get an "image" of a perfect, fresh-install VM [message #11922 is a reply to message #11884] Thu, 12 April 2007 03:47 Go to previous messageGo to next message
ugob is currently offline  ugob
Messages: 271
Registered: March 2007
Senior Member
Is it possible to edit a file in the tarball before 'restoring' it?

Please read the manual before asking questions:
http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf

Please have a look at the wiki before asking questions:
http://wiki.openvz.org/Main_Page
Re: Best practices to get an "image" of a perfect, fresh-install VM [message #11943 is a reply to message #11922] Thu, 12 April 2007 11:17 Go to previous message
Andrey Mirkin is currently offline  Andrey Mirkin
Messages: 193
Registered: May 2006
Senior Member
If you want just to start (using command "vzctl start") a VE after restoring it from backup file, then you can edit files in tarball.

If you want to make something like snapshot (fs + processes state (suspend and dump)), then you must keep fs in tarball unchanged.


Andrey Mirkin
http://static.openvz.org/userbars/openvz-developer.png
Previous Topic: *SOLVED* 2.6.18 & CentOS
Next Topic: TCP: bucket table overflow
Goto Forum:
  


Current Time: Sat Oct 19 06:04:31 GMT 2024

Total time taken to generate the page: 0.05170 seconds