dimarts, 16 de juny del 2015

Como crear una plantilla personalizada en servidores Proxmox

A continuación se detallará la forma de crear una plantilla personalizada con OpenVZ en el sistema Proxmox
1. En primer lugar nos bajamos una plantilla con el ssoo que deseamos personalizar. (Buscar en internet templates proxmox por ejemplo)
2. Creamos la maquina virtual openvz desde la consola proxmox o tecleando lo siguiente desde SSH :

vzctl enter CTID (CTID es el ID  de la maquina virtual)
 
3. Arrancamos la nueva maquina y agregamos y configuramos el software necesario.
4. Salimos de la maquina virtual sin pararla
5. Quitamos la dirección IP de la interfaz de red de nuestra maquina virtual, podemos usar este comando

vzctl set CTID --ipdel all --save
 
6. Paramos la maquina virtual usando este comando vzctl stop CTID o desde la consola
7. Nos dirigimos al directorio donde se encuentra nuestra maquina virtual desde el ssh

cd /var/lib/vz/private/CTID
 
8. Comprimimos el directorio y lo ubicamos en la capeta de plantillas

tar –czvf /var/lib/vz/template/cache/
 
 
http://blog.unelink.es/wiki/como-crear-una-plantilla-personalizada-en-servidores-proxmox/
 

enlace descarrega de container proxmox openvz

https://openvz.org/Download/template/precreated

 https://www.turnkeylinux.org/

per decarregar containers i iso per generar màquina virtual 

conversor formats màquines virtuals , virtualbox , vmware , proxmox , vdi , vmdk , qcow

Convertir Vmware .vmdk a Proxmox .raw

Seguint amb Proxmox… avui he estat passant les maquines virtuals que tinc al server amb vmware al meu nou proxmox… es senzill i ràpid, l’ordre seria:

qemu-img convert -f vmdk FOGServer.vmdk -O raw images/104/vm-104-disk-1.raw
 
Al Proxmox cal ficar-les a la ruta /var/lib/vz/images/100 (101, 102…)
 

Convert Virtualbox vdi to KVM qcow

Step 1. Convert the VB disk vdi image to a raw image format.
VBoxManage clonehd --format RAW ubuntu.vdi ubuntu.img
Note: The ubunut.img is a raw disk image, it will be quite large (as many GB as your virtual drive is, see above).
Step 2 : convert the raw image to a qcow

qemu-img convert -f raw ubuntu.img -O qcow2 ubuntu.qcow

That is all there is to it, the ubuntu.qcow can be used with KVM.
Test your new image (ubuntu.qcow) with:

kvm -m 512 -usbdevice tablet -hda ubuntu.qcow

If it is working you may delete the raw image (ubuntu.img) and archive or delete the ubuntu.vdi 

 

Convert VMware .vmdk to KVM .qcow2 or Virtualbox .vdi

First convert the .vmdk to a format compatible with qemu-img.

Turns out this can be done with vmware-vdiskmanager.
1. Converting from .vmdk
Use vmware-vdiskmanager to create a copy. This works with a single or multiple disks.

ls
Ubuntu.vmdk
Ubuntu-f001.vmdk
Ubuntu-f002.vmdk
Ubuntu-f003.vmdk ...


vmware-vdiskmanager -r Ubuntu.vmdk -t 0 Ubuntu-copy.vmdk

Note: If you have multiple disks, use Ubuntu.vmdk as well (you do not need to convert each Ubuntu-f001.vmdk).
Note: That is a -t Zero not a capital O. see man vmware-vdiskmanager.
Note: vmware-vdiskmanager is part of vmware server (and workstation, not sure about player).
2. Alternate – Converting “flat files”.
Flat files are used by vmware if you create a virtual disk (vmdk) with the “Allocate all disk space now” option (you have this option when creating disks for use with vmware). Flat files contain all the data from your .vmdk and can (usually) be converted directly.
Notice, flat files can be directly converted to .qcow. If you wish to convert to .vdi (VirtualBox) convert flat to raw.

KVM :

qemu-img convert Ubuntu-flat.vmdk -O qcow2 Ubuntu-copy.qemu
Note: That is a capital O qcow2

RAW (for VirtualBox)

qemu-img convert Ubuntu-flat.vmdk -O raw Ubuntu-copy.img
Note: That is a capital O qcow2

KVM – Convert to qcow2

Convert the new “copy” .vmdk with qemu-img

qemu-img convert Ubuntu-copy.vmdk -O qcow2 Ubuntu-copy.qemu

Note: That is a capital O qcow2
3. Boot the image with KVM
kvm -hda Ubuntu-copy.qcow -net nic -net user -m 512
Caveats :
  1. If you have vmware-tools installed, you will have mouse integration.
  2. If you have vmware-tools installed, the guest desktop may well be larger then the kvm window. You will need to resize the guest display to 800×600 .
  3. I could not convert a .vmdk which was using LVM (Fedora).

VirtualBox – Convert to .vdi

1. First use qemu-img to convert the copy .vmdk to raw.

qemu-img convert Ubuntu-copy.vmdk Ubuntu-copy.img

qemu-img with no options will make a raw image. If you prefer you can specify

qemu-img convert Ubuntu-flat.vmdk -O raw Ubuntu-copy.img

2. Then convert the raw image with VBoxManage
VBoxManage convertfromraw --format VDI Ubuntu-copy.img Ubuntu-copy.vdi
3. Start VirtualBox, make a new machine or add the Ubuntu.vdi to an existing machine.
Caveats :
  1. With VMWare-tools installed, Mouse integration did not work (as it did with KVM).
  2. The resolution of the guest is also larger then the Virtualbox window.
  3. I installed the VirtualBoxAdditions and guest resolution worked well, mouse integration, however, did not.
 http://blog.bodhizazen.net/linux/convert-vmware-vmdk-to-kvm-qcow2-or-virtualbox-vdi/