How to attach existing HD image to a new VM?

starkruzr

Well-Known Member
This just... doesn't seem to be an option. Anywhere. Every time you go to add a new hard disk it assumes you want to create a new image. There isn't an option to use an existing one. To wit:

7XW1V43.png


I got a little further by following this thread for migrating from ESXi to Proxmox (which is what I'm doing): http://noltechinc.com/miscellany/migrating-virtual-machines-from-esxi-5-to-proxmox-2-1

The image file is a QCOW2 file converted from a VMDK. I moved it to the name of the disk that Proxmox created. Then I got this:

kvm: -drive file=/var/lib/vz/images/100/vm-100-disk-1.qcow2,if=none,id=drive-virtio0,format=qcow2,aio=native,cache=none: could not open disk image /var/lib/vz/images/100/vm-100-disk-1.qcow2: Image is not in qcow2 format
TASK ERROR: start failed: command '/usr/bin/kvm -id 100 -chardev 'socket,id=qmp,path=/var/run/qemu-server/100.qmp,server,nowait' -mon 'chardev=qmp,mode=control' -vnc unix:/var/run/qemu-server/100.vnc,x509,password -pidfile /var/run/qemu-server/100.pid -daemonize -name Gemenon -smp 'sockets=1,cores=1' -nodefaults -boot 'menu=on' -vga cirrus -cpu kvm64,+lahf_lm,+x2apic,+sep -k en-us -m 4096 -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' -drive 'if=none,id=drive-ide2,media=cdrom,aio=native' -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' -drive 'file=/var/lib/vz/images/100/vm-100-disk-1.qcow2,if=none,id=drive-virtio0,format=qcow2,aio=native,cache=none' -device 'virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa' -netdev 'type=tap,id=net0,ifname=tap100i0,script=/var/lib/qemu-server/pve-bridge,vhost=on' -device 'virtio-net-pci,mac=56:19:B2:9A:0A:C4,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300'' failed: exit code 1

Does anyone know what I might be doing wrong here? It was converted to QCOW2.
 
By the way. I'm also interested in this functionality (attaching existing disks to VM-s).
 
By the way. I'm also interested in this functionality (attaching existing disks to VM-s).
Renaming the file to the name the virtual host picked for its new hard drive worked. Sloppy, but it works. What I am left with now is a curious situation in which everything is fine but the nginx server this machine was running before it was converted no longer works correctly. I get a lot of 404s and 503 Bad Gateways. Logs look like this:

aGkEfa3.png


Any ideas what's happened here? The directory is there and belongs to www-data. Sort of mystifying.
 
Yes, the renaming thing works, but it is a bit strange to do it by hands in such great system. It is not very hard to add some fields to form in the disk window :)

About your problem: try to run fsck or sort of it. Seems to be innode problem or something. It is like the file is there but it is not or with wrong descriptors :D.