Migrar de OVA a Proxmox

Copiaremos el archivo OVA a una carpeta local o NFS en Proxmox.

Tenemos en primer lugar que descomprimir el archivo OVA

tar xvf debian-minimal-12.1.0.ova

En algunos casos, tendremos que instalar el tar si no está en Proxmox

Esto nos dejará tres archivos (o más si la máquina tiene más discos)

debian-minimal-12.1.0.ovf
debian-minimal-12.1.0.mf
debian-minimal-12.1.0-disk1.vmdk

El archivo ovf contiene la descripción e la máquina virtual

<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by VMware ESX Server, User: root, UTC time: 2023-07-30T12:14:21.762012Z-->
<Envelope vmw:buildId="build-14320388" xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/>
  <References>
    <File ovf:href="debian-minimal-12.1.0-disk1.vmdk" ovf:id="file1" ovf:size="459838464"/>
  </References>
  <DiskSection>
    <Info>Virtual disk information</Info>
    <Disk ovf:capacity="40000" ovf:capacityAllocationUnits="byte * 2^20" ovf:diskId="vmdisk1" ovf:fileRef="file1" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized" ovf:populatedSize="1528823808"/>
  </DiskSection>
  <NetworkSection>
    <Info>The list of logical networks</Info>
    <Network ovf:name="VM Network">
      <Description>The VM Network network</Description>
    </Network>
  </NetworkSection>
  <VirtualSystem ovf:id="debian-minimal-12.1.0">
    <Info>A virtual machine</Info>
    <Name>debian-minimal-12.1.0</Name>
    <OperatingSystemSection ovf:id="1" vmw:osType="otherGuest">
      <Info>The kind of installed guest operating system</Info>
    </OperatingSystemSection>..........................................

Ejecutaremos el comando qm importovf

qm importovf <vmid> <manifest> <storage> [OPTIONS]

vmid es el ide nuestra nueva máquina, manifest es el archivo ovf y storage es el almacenamiento destino

En este caso lo hacemos con --dryrun que no modifica nada, y nos permite comprobar que todo está correcto.

qm importovf 202 debian-minimal-12.1.0.ovf local-lvm --dryrun
{
   "disks" : [
      {
         "backing_file" : "/mnt/pve/NAS/debian-minimal-12.1.0-disk1.vmdk",
         "disk_address" : "scsi0",
         "virtual_size" : 41943040000
      }
   ],
   "qm" : {
      "cores" : "2",
      "memory" : "2048",
      "name" : "debian-minimal-12.1.0"
   }
}

Como vemos, ha pasado los chequeos

Ahora podemos ejecutar el comando sin el dry-run y nos creará la máquina virtual

root@pve:/mnt/pve/NAS# qm importovf 202 debian-minimal-12.1.0.ovf local-lvm
  Logical volume "vm-202-disk-0" created.
transferred 0.0 B of 39.1 GiB (0.00%)
transferred 400.0 MiB of 39.1 GiB (1.00%)
transferred 804.0 MiB of 39.1 GiB (2.01%)
transferred 1.2 GiB of 39.1 GiB (3.01%)
transferred 1.6 GiB of 39.1 GiB (4.01%)
transferred 2.0 GiB of 39.1 GiB (5.02%)
transferred 2.4 GiB of 39.1 GiB (6.02%)
transferred 2.7 GiB of 39.1 GiB (7.02%)
transferred 3.1 GiB of 39.1 GiB (8.02%)
transferred 3.5 GiB of 39.1 GiB (9.03%)
transferred 3.9 GiB of 39.1 GiB (10.03%)
transferred 4.3 GiB of 39.1 GiB (11.03%)
transferred 4.7 GiB of 39.1 GiB (12.04%)
transferred 5.1 GiB of 39.1 GiB (13.04%)
transferred 5.5 GiB of 39.1 GiB (14.04%)
transferred 5.9 GiB of 39.1 GiB (15.05%)
transferred 6.3 GiB of 39.1 GiB (16.05%)
transferred 6.7 GiB of 39.1 GiB (17.05%)
transferred 7.1 GiB of 39.1 GiB (18.06%)
transferred 7.4 GiB of 39.1 GiB (19.06%)
transferred 7.8 GiB of 39.1 GiB (20.06%)
transferred 8.2 GiB of 39.1 GiB (21.06%)
transferred 8.6 GiB of 39.1 GiB (22.07%)
transferred 9.0 GiB of 39.1 GiB (23.07%)
transferred 9.4 GiB of 39.1 GiB (24.07%)
transferred 9.8 GiB of 39.1 GiB (25.08%)
transferred 10.2 GiB of 39.1 GiB (26.08%)
transferred 10.6 GiB of 39.1 GiB (27.08%)
transferred 11.0 GiB of 39.1 GiB (28.09%)
transferred 11.4 GiB of 39.1 GiB (29.09%)...............
...........................................
transferred 38.0 GiB of 39.1 GiB (97.30%)
transferred 38.4 GiB of 39.1 GiB (98.30%)
transferred 38.8 GiB of 39.1 GiB (99.31%)
transferred 39.1 GiB of 39.1 GiB (100.00%)
transferred 39.1 GiB of 39.1 GiB (100.00%)
root@pve:/mnt/pve/NAS#

En ese momento tendremos una nueva máquina virtual en nuestro Proxmox con el ID 202

ova-01.png

Vemos que ha configurado todo, tal como venía en el fichero ovf

ova-02.png

Y ahora podremos realizar los cambios necesarios una vez arranque (MAC, tipo de disco, procesador, etc)

ova-03.png

Problemas que podemos encontrarnos

Algunas veces el disco del archivo manifest (ovf) no está demasiado bien definido, y nos puede dar problemas

root@pve:/mnt/pve/NAS/PF# qm importovf 204 PacketFence-ZEN-v13.0.0.ovf local-lvm --dryrun
warning: unable to parse the VM name in this OVF manifest, generating a default value
invalid host ressource /disk/vmdisk1, skipping
{
   "disks" : [],
   "qm" : {
      "cores" : "4",
      "memory" : "12288"
   }
}

En este caso, ejecutaremos, pero no nos creará el disco

root@pve:/mnt/pve/NAS/PF# qm importovf 204 PacketFence-ZEN-v13.0.0.ovf local-lvm
warning: unable to parse the VM name in this OVF manifest, generating a default value
invalid host ressource /disk/vmdisk1, skipping

ova-04.png

Como vemos nos ha creado una máquina sin nombre, y sin disco.

No hay problema, importamos posteriormente el disco.

root@pve:/mnt/pve/NAS/PF# qm importdisk 204 PacketFence-ZEN-v13.0.0-disk1.vmdk local-lvm
importing disk 'PacketFence-ZEN-v13.0.0-disk1.vmdk' to VM 204 ...
  Logical volume "vm-204-disk-0" created.
transferred 0.0 B of 195.3 GiB (0.00%)
transferred 2.0 GiB of 195.3 GiB (1.00%)
transferred 3.9 GiB of 195.3 GiB (2.00%)
transferred 5.9 GiB of 195.3 GiB (3.00%)
transferred 7.8 GiB of 195.3 GiB (4.00%)
transferred 9.8 GiB of 195.3 GiB (5.00%)
transferred 11.7 GiB of 195.3 GiB (6.00%)
transferred 13.7 GiB of 195.3 GiB (7.00%)
transferred 15.6 GiB of 195.3 GiB (8.00%)
transferred 17.6 GiB of 195.3 GiB (9.00%)
transferred 19.5 GiB of 195.3 GiB (10.00%)
transferred 21.5 GiB of 195.3 GiB (11.00%)
transferred 23.4 GiB of 195.3 GiB (12.00%)
transferred 25.4 GiB of 195.3 GiB (13.00%)
transferred 27.3 GiB of 195.3 GiB (14.00%)
transferred 29.3 GiB of 195.3 GiB (15.00%)
transferred 31.2 GiB of 195.3 GiB (16.00%)
transferred 33.2 GiB of 195.3 GiB (17.00%)
..........................................
transferred 183.6 GiB of 195.3 GiB (94.00%)
transferred 185.5 GiB of 195.3 GiB (95.00%)
transferred 187.5 GiB of 195.3 GiB (96.00%)
transferred 189.5 GiB of 195.3 GiB (97.00%)
transferred 191.4 GiB of 195.3 GiB (98.00%)
transferred 193.4 GiB of 195.3 GiB (99.00%)
transferred 195.3 GiB of 195.3 GiB (100.00%)
transferred 195.3 GiB of 195.3 GiB (100.00%)
Successfully imported disk as 'unused0:local-lvm:vm-204-disk-0'

Nos habrá creado un Unsued Disk 0, que si hacemos doble click sobre él, lo podremos asignar a la máquina

ova-05.png

Simplemente hacemos doble click en el disco Unused Disk 0

ova-06.png

Escogemos el tipo de Bus/Device (IDE, SATA, etc) en nuestro caso Virtio

ova-07.png

Y ya lo tenemos todo a falta de renombrar la máquina

ova-08.png 




Revision #4
Created 27 August 2023 12:23:34 by etaboada
Updated 28 August 2023 17:59:55 by etaboada