Proxmox: Importar imagen QCOW2
Si os encontráis con ficheros de imagen de máquina virtual QCOW2 y no sabéis como importarlo en Proxmox os lo explico en unos pocos pasos.
Por defecto, no vamos a poder usar las imágenes QCOW2 directamente en una de nuestras máquinas virtuales, tendremos que convertirla para que Proxmox trabaje con ella.
El comando, que voy a explicar, sería:
qm importdisk 101 fichero.qcow2 local-lvm
- “qm importdisk” es el comando de Proxmox
- “101” es el ID de la máquina virtual donde importaremos el disco
- “fichero.qcow2” es el nombre del disco QCOW2
- “local-lvm” es el volumen donde lo vamos a dejar
Ahora detallo los pasos que yo voy a utilizar para que os sea más fácil.
De primeras, me conecto vía SSH a uno de mis nodos:
1 2 3 4 5 6 7 8 9 10 11 12 |
MacBook-Pro-de-Raul:~ raulunzue$ ssh root@192.168.2.50 root@192.168.2.50's password: Linux pve2 5.4.65-1-pve #1 SMP PVE 5.4.65-1 (Mon, 21 Sep 2020 15:40:22 +0200) x86_64 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Wed Sep 30 22:22:41 2020 root@pve2:~# |
Lo primero que tenéis que saber es donde tenéis que copiar el disco. Normalmente, esta es la ruta de los Storages en Proxmox:
1 2 |
root@pve2:~# ls /mnt/pve/ CEPH01/ NAS/ |
Así que subís a la ruta el disco, ya sea con Filezilla, SSH o como os resulte más cómodo. En mi caso os lo dejo por SSH con SCP:
1 2 3 |
MacBook-Pro-de-Raul:Downloads raulunzue$ scp fedora-coreos-32.20200907.3.0-qemu.x86_64.qcow2 root@192.168.2.50:/mnt/pve/NAS/images root@192.168.2.50's password: fedora-coreos-32.20200907.3.0-qemu.x86_64.qcow2 79% 1394MB 106.8MB/s 00:03 ETA |
Verificamos que se ha copiado en la ruta:
1 2 |
root@pve2:/mnt/pve/NAS/images# ls @eaDir fedora-coreos-32.20200907.3.0-qemu.x86_64.qcow2 |
Ahora usaré una máquina virtual para asignarle el disco, en este caso el ID es el 122:
Así que lanzo el comando del que hemos hablado al principio:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
root@pve2:/mnt/pve/NAS# qm importdisk 122 images/fedora-coreos-32.20200907.3.0-qemu.x86_64.qcow2 NAS importing disk 'images/fedora-coreos-32.20200907.3.0-qemu.x86_64.qcow2' to VM 122 ... Formatting '/mnt/pve/NAS/images/122/vm-122-disk-0.raw', fmt=raw size=8589934592 transferred: 0 bytes remaining: 8589934592 bytes total: 8589934592 bytes progression: 0.00 % transferred: 92771293 bytes remaining: 8497163299 bytes total: 8589934592 bytes progression: 1.08 % transferred: 181247619 bytes remaining: 8408686973 bytes total: 8589934592 bytes progression: 2.11 % transferred: 269723946 bytes remaining: 8320210646 bytes total: 8589934592 bytes progression: 3.14 % transferred: 358200272 bytes remaining: 8231734320 bytes total: 8589934592 bytes progression: 4.17 % transferred: 445817605 bytes remaining: 8144116987 bytes total: 8589934592 bytes progression: 5.19 % transferred: 534293931 bytes remaining: 8055640661 bytes total: 8589934592 bytes progression: 6.22 % transferred: 627924218 bytes remaining: 7962010374 bytes total: 8589934592 bytes progression: 7.31 % transferred: 715541551 bytes remaining: 7874393041 bytes total: 8589934592 bytes progression: 8.33 % transferred: 808312845 bytes remaining: 7781621747 bytes total: 8589934592 bytes progression: 9.41 % transferred: 895930177 bytes remaining: 7694004415 bytes total: 8589934592 bytes progression: 10.43 % transferred: 985265497 bytes remaining: 7604669095 bytes total: 8589934592 bytes progression: 11.47 % transferred: 1078895784 bytes remaining: 7511038808 bytes total: 8589934592 bytes progression: 12.56 % transferred: 1167372111 bytes remaining: 7422562481 bytes total: 8589934592 bytes progression: 13.59 % transferred: 1257566424 bytes remaining: 7332368168 bytes total: 8589934592 bytes progression: 14.64 % transferred: 1344324763 bytes remaining: 7245609829 bytes total: 8589934592 bytes progression: 15.65 % transferred: 1431083103 bytes remaining: 7158851489 bytes total: 8589934592 bytes progression: 16.66 % transferred: 1519559429 bytes remaining: 7070375163 bytes total: 8589934592 bytes progression: 17.69 % transferred: 1610612736 bytes remaining: 6979321856 bytes total: 8589934592 bytes progression: 18.75 % transferred: 1696512081 bytes remaining: 6893422511 bytes total: 8589934592 bytes progression: 19.75 % transferred: 1782411427 bytes remaining: 6807523165 bytes total: 8589934592 bytes progression: 20.75 % transferred: 1870887754 bytes remaining: 6719046838 bytes total: 8589934592 bytes progression: 21.78 % transferred: 1962800054 bytes remaining: 6627134538 bytes total: 8589934592 bytes progression: 22.85 % transferred: 2057289334 bytes remaining: 6532645258 bytes total: 8589934592 bytes progression: 23.95 % transferred: 2143188680 bytes remaining: 6446745912 bytes total: 8589934592 bytes progression: 24.95 % transferred: 2235100980 bytes remaining: 6354833612 bytes total: 8589934592 bytes progression: 26.02 % transferred: 2328731267 bytes remaining: 6261203325 bytes total: 8589934592 bytes progression: 27.11 % transferred: 2422361554 bytes remaining: 6167573038 bytes total: 8589934592 bytes progression: 28.20 % transferred: 2510837881 bytes remaining: 6079096711 bytes total: 8589934592 bytes progression: 29.23 % transferred: 2597596220 bytes remaining: 5992338372 bytes total: 8589934592 bytes progression: 30.24 % transferred: 2688649527 bytes remaining: 5901285065 bytes total: 8589934592 bytes progression: 31.30 % transferred: 2780561827 bytes remaining: 5809372765 bytes total: 8589934592 bytes progression: 32.37 % transferred: 2871615134 bytes remaining: 5718319458 bytes total: 8589934592 bytes progression: 33.43 % transferred: 2958373473 bytes remaining: 5631561119 bytes total: 8589934592 bytes progression: 34.44 % transferred: 3048567786 bytes remaining: 5541366806 bytes total: 8589934592 bytes progression: 35.49 % transferred: 3137903106 bytes remaining: 5452031486 bytes total: 8589934592 bytes progression: 36.53 % transferred: 3223802452 bytes remaining: 5366132140 bytes total: 8589934592 bytes progression: 37.53 % transferred: 3310560791 bytes remaining: 5279373801 bytes total: 8589934592 bytes progression: 38.54 % transferred: 3399896111 bytes remaining: 5190038481 bytes total: 8589934592 bytes progression: 39.58 % transferred: 3485795457 bytes remaining: 5104139135 bytes total: 8589934592 bytes progression: 40.58 % transferred: 3575989770 bytes remaining: 5013944822 bytes total: 8589934592 bytes progression: 41.63 % transferred: 3665325090 bytes remaining: 4924609502 bytes total: 8589934592 bytes progression: 42.67 % transferred: 3755519403 bytes remaining: 4834415189 bytes total: 8589934592 bytes progression: 43.72 % transferred: 3842277743 bytes remaining: 4747656849 bytes total: 8589934592 bytes progression: 44.73 % transferred: 3933331049 bytes remaining: 4656603543 bytes total: 8589934592 bytes progression: 45.79 % transferred: 4021807375 bytes remaining: 4568127217 bytes total: 8589934592 bytes progression: 46.82 % transferred: 4108565715 bytes remaining: 4481368877 bytes total: 8589934592 bytes progression: 47.83 % transferred: 4201337008 bytes remaining: 4388597584 bytes total: 8589934592 bytes progression: 48.91 % transferred: 4295826289 bytes remaining: 4294108303 bytes total: 8589934592 bytes progression: 50.01 % transferred: 4381725635 bytes remaining: 4208208957 bytes total: 8589934592 bytes progression: 51.01 % transferred: 4467624981 bytes remaining: 4122309611 bytes total: 8589934592 bytes progression: 52.01 % transferred: 4554383320 bytes remaining: 4035551272 bytes total: 8589934592 bytes progression: 53.02 % transferred: 4641141660 bytes remaining: 3948792932 bytes total: 8589934592 bytes progression: 54.03 % transferred: 4728758992 bytes remaining: 3861175600 bytes total: 8589934592 bytes progression: 55.05 % transferred: 4821530286 bytes remaining: 3768404306 bytes total: 8589934592 bytes progression: 56.13 % transferred: 4910865606 bytes remaining: 3679068986 bytes total: 8589934592 bytes progression: 57.17 % transferred: 5005354886 bytes remaining: 3584579706 bytes total: 8589934592 bytes progression: 58.27 % transferred: 5092972219 bytes remaining: 3496962373 bytes total: 8589934592 bytes progression: 59.29 % transferred: 5181448545 bytes remaining: 3408486047 bytes total: 8589934592 bytes progression: 60.32 % transferred: 5272501852 bytes remaining: 3317432740 bytes total: 8589934592 bytes progression: 61.38 % transferred: 5363555159 bytes remaining: 3226379433 bytes total: 8589934592 bytes progression: 62.44 % transferred: 5458044439 bytes remaining: 3131890153 bytes total: 8589934592 bytes progression: 63.54 % transferred: 5546520766 bytes remaining: 3043413826 bytes total: 8589934592 bytes progression: 64.57 % transferred: 5632420111 bytes remaining: 2957514481 bytes total: 8589934592 bytes progression: 65.57 % transferred: 5721755431 bytes remaining: 2868179161 bytes total: 8589934592 bytes progression: 66.61 % transferred: 5807654777 bytes remaining: 2782279815 bytes total: 8589934592 bytes progression: 67.61 % transferred: 5899567077 bytes remaining: 2690367515 bytes total: 8589934592 bytes progression: 68.68 % transferred: 5987184410 bytes remaining: 2602750182 bytes total: 8589934592 bytes progression: 69.70 % transferred: 6074801743 bytes remaining: 2515132849 bytes total: 8589934592 bytes progression: 70.72 % transferred: 6160701089 bytes remaining: 2429233503 bytes total: 8589934592 bytes progression: 71.72 % transferred: 6247459428 bytes remaining: 2342475164 bytes total: 8589934592 bytes progression: 72.73 % transferred: 6336794748 bytes remaining: 2253139844 bytes total: 8589934592 bytes progression: 73.77 % transferred: 6424412081 bytes remaining: 2165522511 bytes total: 8589934592 bytes progression: 74.79 % transferred: 6512888407 bytes remaining: 2077046185 bytes total: 8589934592 bytes progression: 75.82 % transferred: 6603082720 bytes remaining: 1986851872 bytes total: 8589934592 bytes progression: 76.87 % transferred: 6691559047 bytes remaining: 1898375545 bytes total: 8589934592 bytes progression: 77.90 % transferred: 6785189334 bytes remaining: 1804745258 bytes total: 8589934592 bytes progression: 78.99 % transferred: 6876242640 bytes remaining: 1713691952 bytes total: 8589934592 bytes progression: 80.05 % transferred: 6968154941 bytes remaining: 1621779651 bytes total: 8589934592 bytes progression: 81.12 % transferred: 7054054286 bytes remaining: 1535880306 bytes total: 8589934592 bytes progression: 82.12 % transferred: 7143389606 bytes remaining: 1446544986 bytes total: 8589934592 bytes progression: 83.16 % transferred: 7231006939 bytes remaining: 1358927653 bytes total: 8589934592 bytes progression: 84.18 % transferred: 7317765278 bytes remaining: 1272169314 bytes total: 8589934592 bytes progression: 85.19 % transferred: 7404523618 bytes remaining: 1185410974 bytes total: 8589934592 bytes progression: 86.20 % transferred: 7497294911 bytes remaining: 1092639681 bytes total: 8589934592 bytes progression: 87.28 % transferred: 7590925198 bytes remaining: 999009394 bytes total: 8589934592 bytes progression: 88.37 % transferred: 7677683538 bytes remaining: 912251054 bytes total: 8589934592 bytes progression: 89.38 % transferred: 7767018858 bytes remaining: 822915734 bytes total: 8589934592 bytes progression: 90.42 % transferred: 7852918204 bytes remaining: 737016388 bytes total: 8589934592 bytes progression: 91.42 % transferred: 7947407484 bytes remaining: 642527108 bytes total: 8589934592 bytes progression: 92.52 % transferred: 8033306830 bytes remaining: 556627762 bytes total: 8589934592 bytes progression: 93.52 % transferred: 8122642150 bytes remaining: 467292442 bytes total: 8589934592 bytes progression: 94.56 % transferred: 8215413443 bytes remaining: 374521149 bytes total: 8589934592 bytes progression: 95.64 % transferred: 8303030776 bytes remaining: 286903816 bytes total: 8589934592 bytes progression: 96.66 % transferred: 8393225089 bytes remaining: 196709503 bytes total: 8589934592 bytes progression: 97.71 % transferred: 8479983429 bytes remaining: 109951163 bytes total: 8589934592 bytes progression: 98.72 % transferred: 8566741768 bytes remaining: 23192824 bytes total: 8589934592 bytes progression: 99.73 % transferred: 8589934592 bytes remaining: 0 bytes total: 8589934592 bytes progression: 100.00 % transferred: 8589934592 bytes remaining: 0 bytes total: 8589934592 bytes progression: 100.00 % Successfully imported disk as 'unused0:NAS:122/vm-122-disk-0.raw' |
Y se la asignará a la máquina virtual:
Yo he cambiado el boot para que arranque del disco recién montado, que es un Fedora CoreOS, lo compruebo:
Espero os parezca interesante…ya que es gratis, comparte ;P
¿Te ha gustado la entrada SÍGUENOS EN TWITTER?
Te ha gustado la entrada SGUENOS EN TWITTER O INVITANOS A UN CAFE?
Hola Raul, me funciono a la perfección, mil gracias por el post, aunque tengo una duda, una vez importados los qcow2 y asignados a la VM, puedo eliminar los Qcow2 que fueron importados para liberar espacio en disco?
Mil gracias de antemano
Hola Germán, Gracias. Si, han importado puedes borrarlo. Un saludo
hola buenas tardes, realice el proceso y todo bien, el detalle fue que al iniciar la MV con windows me da un pantallazo azul, y no se que error me lanza y no tengo como validar
hol araul tengo un problema en proxomox la unidad logica lvm-thin esta superblock como puedo reparar la metadata sin perder las maquinas virtuales almacebadas en lvm-thin?
tengo una imagen de vmdk que quiero mntarla en proxmox pero no puedo me ayudan ?
Hola! Mira esta entrada, hay un apartado para convertir el disco VMDK:
https://www.maquinasvirtuales.eu/instalar-nutanix-ahv-en-modo-nested-en-proxmox/
Salu2
Hola
Tengo un servidor antiguo con KVM sin GUI grafica, solo por consola, quiero pasarme a Proxmox, pero mis imagenes no son qcow sino tienen la extension img por ejemplo webserver.img, me serviriian los mismos comandos o sera diferente? Gracias por tu respuesta
Hola!
Puedes agregar un paso intermedio convirtiendo la imagen IMG en QCOW2 de la siguiente forma:
qemu-img convert -f raw /var/lib/vz/images/disk.img -O qcow2 /var/lib/vz/images/100/vm-100-disk-0.qcow2
Salu2