Projet

Général

Profil

Création de template

Article original par Tiana Ralambondrainy

Création de template proxmox

méthode 1

http://www.proxmox.com/forum/archive/index.php/t-452.html

avec l'interface graphique :

  • créer une VM avec template debian lenny
  • customiser directement cette VM
  • nettoyer la VM
    • aptitude install localepurge & exécuter localepurge & aptitude remove localepurge
    • aptitude clean && aptitude autoclean
  • arrêter la VM
  • enlever l'IP de la VM

sur la machine proxmox

  • aptitude update & aptitude upgrade
  • cd /var/lib/vz/private/<id>
  • nettoyage :
rm /var/lib/vz/private/<id>/etc/network/interfaces
rm /var/lib/vz/private/<id>/etc/hosts 
rm /var/lib/vz/private/<id>/etc/hostname
rm /var/lib/vz/private/<id>/etc/resolv.conf
  • modifier : /var/lib/vz/private/<id>/etc/appliance.info (cf. contenu plus bas)
  • Créé l'archive :
cd /var/lib/vz/private/<id>/ (! important !)
tar -czvf /var/lib/vz/template/cache/<OS>-<OSVERSION>-<NAME>_<VERSION>_<ARCH>.tar.gz --exclude 'etc/network/interfaces etc/hosts etc/hostname etc/resolv.conf' . (ne pas oublier le .)

ATTENTION
respecter la convention de nommage du fichier pour pouvoir l'utiliser :

<OS>-<OSVERSION>-<NAME>_<VERSION>_<ARCH>.tar.gz

ex. debian-5.0-tralambo_5.0-1_i386.tar.gz

méthode 2

http://pve.proxmox.com/wiki/Debian_Appliance_Builder

contenu appliance.info

situé dans

/var/lib/vz/private/<id>/etc/appliance.info

##########################
Name: debian-5.0 (Lenny) LAMP
Version: 5.0-1
Type: ope
OS: debian-5.0
Section: system
Maintainer: Tiana Ralambondrainy <name@domaine.tld>
Architecture: i386
Installed-Size: 560
Infopage: http://pve.proxmox.com/wiki/Debian_5.0_Standard
Description: Debian 5.0 (LAMP) 
 Debian Lenny with LAMP, clamav, and tralambo customs. Date: 20091224 
##########################