Search code examples
openvz

Custom OpenVZ template not installing


I made a template of my containers on a OpenVZ server that i owned as i was wanting to reinstall OpenVZ to the server to start a new and when i go to install it i am getting this error: (im sure you understand about me blanking the password)

Internal error: Command 'vzctl set 1 --userpasswd root:YOUDONTNEEDMYPASSWORD' execution failed with code 47
Output: Starting container...
Opening delta /vz/private/1/root.hdd/root.hdd
Adding delta dev=/dev/ploop44501 img=/vz/private/1/root.hdd/root.hdd (rw)
Mounting /dev/ploop44501p1 at /vz/root/1 fstype=ext4 data='balloon_ino=12,' 
Container is mounted
Unable to start init, probably incorrect template
Container start failed
Killing container ...
Container was stopped
Unmounting file system at /vz/root/1
Unmounting device /dev/ploop44501
Container is unmounted

i do not get any error when using a template from OpenVZ's Website

Files inside the custom template (after extracting): http://prntscr.com/bs78f4

any help would be greatly appreciated

If you need the download link to the template (Dropbox) just ask

If you need SSH access on to try and fix it i will give you it as it is as i say a blank server and i can also reinstall it to any OS in about 5 mins if that would help


Solution

  • You really didn't give much in the way of details so I don't have a lot to go on but I'll mention a few things. I assume you are talking about OpenVZ Legacy using the EL6 2.6.32.x OpenVZ kernel.

    1) What distro is the OS Template of? In the container config it is nice to ensure the OSTEMPLATE="" parameter is set to something where vzctl knows what scripts to use to configure the container's filesystem upon boot. How the ipadd is set, and user passwords... may vary from one distro to another so cluing vzctl in is very helpful. Also, from knowning what distro and version it is, it knows what init system to try to start.

    2) How did you create the OS Template from your existing container? I assume you stopped the container, mounted the container disk (vzctl mount {ctid}) and then tar gz|xz'd the the root directory of the container's filesystem and placed the resulting file in /vz/template/cache/ ?

    3) Lastly CTIDs <= 100 are reserved and should NOT be used. In your example, you gave a CTID of 1. Stop doing that. See the vzctl man page if you desire verification of the reserved ctids.

    Feel free to ask interactively in #openvz on the Freenode IRC network... and use of the OpenVZ mailing list and/or forum is recommended. I just happened to see this post on planet.openvz.org.