OpenVZ Forum - RDF feed
type: channel
items: Cannot start a VM when created by custom template
items: Re: Cannot start a VM when created by custom template

Cannot start a VM when created by custom template
type: item
description: Hello folks, I've been reading a lot of things about it and I can't get it resolved. I have openvz up/running on a centos 6.6 machine, it has 8gb or ram and a i5 cpu, is not that much but it fits well my needs. It already has 2 vms running: 101 -> ubuntu14.04_x64 201 -> centos6_x64 I'm trying to use the template of ubuntu14.04_x64 to create a new ubuntu template with some other softwares. I tried it form WebInterface and I got some errors, tried form CLI and got new errrors. See below my steps on CLI: [root@openvz /]# vzlist CTID NPROC STATUS IP_ADDR HOSTNAME 101 87 running 10.0.0.1 httpServer 201 9 running 10.0.0.2 bindServer [root@openvz ~]# cd /vz/private/101/ [root@openvz 101]# ls root.hdd [root@openvz 101]# tar --numeric-owner -czf /vz/template/cache/ubuntu-14.04-x86_64-kurento.tar.gz .[root@openvz /]# vzctl create 202 --ostemplate ubuntu-14.04-x86_64-kurento --config kurento Creating image: /vz/private/202.tmp/root.hdd/root.hdd size=10240000K Creating delta /vz/private/202.tmp/root.hdd/root.hdd bs=2048 size=20480000 sectors v2 Storing /vz/private/202.tmp/root.hdd/DiskDescriptor.xml Opening delta /vz/private/202.tmp/root.hdd/root.hdd Adding delta dev=/dev/ploop39010 img=/vz/private/202.tmp/root.hdd/root.hdd (rw) mke2fs 1.41.12 (17-May-2010) Discarding device blocks: done Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 640848 inodes, 2559488 blocks 127974 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 79 block groups 32768 blocks per group, 32768 fragments per group 8112 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 34 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to overri…
creator: ragazzid
date: 2015-04-28T17:47:46-00:00

Re: Cannot start a VM when created by custom template
type: item
description: Hi, you've tar the ploop disk directory structure not a filesystem, you must mount the ploop to root/dir, tar it=build template. # mount the root/ploop vzctl mount 101 # change to ct root cd /vz/root/101 # build template from filesystem tar --numeric-owner -czf /vz/template/cache/ubuntu-14.04-x86_64-kurento.tar.gz . # umount ploop vzctl umount 101 # create new ct from build template vzctl create ... --ostemplate ubuntu-14.04-x86_64-kurento ... Bye, Thorsten
creator: curx
date: 2015-04-28T19:29:32-00:00

Re: Cannot start a VM when created by custom template
type: item
description: Thorsten, Thank you so much for the fast and precise reply, it worked like a charm. Someone needs to update this page with the info you provided about mount the container before tar it.: https: // openvz.org / Debian_template_creation#Preparing_for_and_packing_template_ cache
creator: ragazzid
date: 2015-04-29T14:01:33-00:00