Attach raw file to virtual machine

Egor

New Member
Nov 21, 2016
28
1
3
31
I have a .raw image with linux operating system. How do I make it a hard disk for my virtual machine?
OOijrfC.png


Ideally, I want proxmox to ask me the path on the filesystem to this .raw file.
Add Hard Disk
Bus/Device: VirtIO
Path to image: /tmp/images/some_image.raw
Format: RAW

I can do that easily on libvirt system:
BkecpTW.png


How can I do the same thing in proxmox?
 
  • Like
Reactions: kotakomputer
you can do the same, not with a compressed raw (.gz) but with a raw.
upload your raw into your storage (be sure how you configured the storage, to host images) the add it in the VM config

upload_2016-11-21_16-57-29.png

I have a .raw image with linux operating system. How do I make it a hard disk for my virtual machine?
OOijrfC.png


Ideally, I want proxmox to ask me the path on the filesystem to this .raw file.
Add Hard Disk
Bus/Device: VirtIO
Path to image: /tmp/images/some_image.raw
Format: RAW

I can do that easily on libvirt system:
BkecpTW.png


How can I do the same thing in proxmox?
 
you can do the same, not with a compressed raw (.gz) but with a raw.
upload your raw into your storage (be sure how you configured the storage, to host images) the add it in the VM config

View attachment 4437

Thank you for your reply!

I cannot change the clients configuration of storages - I have to use what is given by default. By default there are only 2 storages:
local (pve)
local-lvm (pve)


The storage "local (pve)" accepts only .iso images and the storage "local-lvm (pve)" has the button "Upload" blocked:
d7onO08.png


The disk image that you see on the screenshot "vm-242-disk-1.raw" is the image that was created by ProxMox automatically, when I have chosen storage for the virtual machine "242" to be "local-lvm (pve)".
Notice that ProxMox didn't ask me to choose the image "vm-242-disk-1.raw", but it has created this file on it's own (probably filled with zeros). I'd like to replace that empty file with my own image "vm.raw", but I don't know where the file "vm-242-disk-1.raw" is located. Furthermore, I don't know how to upload my image file "vm.raw" on ProxMox machine - there is too little space on the usual file system for my file "vm.raw" and I don't know how to upload my file to a bigger storage "local-lvm (pve)" via scp. I cannot upload my file to folder "/tmp/my_svm/vm.raw", because of the lack of space. Even if I could upload my file there, I don't know how to transfer it from "/tmp/my_svm/vm.raw" to the storage "local-lvm (pve)". Even if I could transfer "vm.raw" to the storage "local-lvm (pve)", I don't know how to attach the file "vm.raw" to my virtual machine "242", so that the virtual machine will load linux from the file "vm.raw" when started in web console.
 
you cannot upload backups or raw disk images over the GUI/API - you need to put them in the correct places on storages yourself (e.g., via SSH)
 
you cannot upload backups or raw disk images over the GUI/API - you need to put them in the correct places on storages yourself (e.g., via SSH)
Thank you for suggestion. Probably, I should have asked questions more granularly =)

Here is me, connected to ProxMox server via WinSCP:
IJ7eUjy.png


In which folder on the right side of the screenshot do I need to upload my image "SVM.image_KVM_4.0.41.8018.raw", so that it will be placed in the storage "local-lvm (pve)"?
 
You have to go in datacenter (not on the node) and select "STORAGE", the select what it will host.


upload_2016-11-22_9-44-1.png


Pay attentiom, for thin LVM things changed.. they can host only LXC or VM disks. no template or backups.. it uses LV.
 
You have to go in datacenter (not on the node) and select "STORAGE", the select what it will host.


View attachment 4438


Pay attentiom, for thin LVM things changed.. they can host only LXC or VM disks. no template or backups.. it uses LV.
I am sorry, but I don't understand.

I will try to specify the problem more rigorously. There are 2 computers involved in the problem:
- Computer-1 (my computer) has an image of the linux operating system "SVM.image_KVM_4.0.41.8018.raw" with the weight of 30Gb.
- Computer-2 (ProxMox server) has the storage which is shown in the web console as "local-lvm (pve)".

How can I upload "SVM.image_KVM_4.0.41.8018.raw" from Computer-1 to Computer-2 by any means there exist at all (sftp, scp or ProxMox API - it doesn't matter)?

If you look at this screenshot:
IJ7eUjy.png

I can try uploading my image "SVM.image_KVM_4.0.41.8018.raw" to folder "/tmp/images/SVM.image_KVM_4.0.41.8018.raw", but
- there is not enough space in that folder
- it is NOT the desired storage "local-lvm (pve)"

How can I upload my file "SVM.image_KVM_4.0.41.8018.raw" to the storage named "local-lvm (pve)"?
 
From Windows directly? Not possible

From Linux via SSH it is easy. Create a new vm with the desired disk size (same as raw) and memorize the id, then try to find the lvm backed storage for the vm and determine the underlying device path e.g. /dev/<vgname>/vm-<vmid>-disk-1 and run the following command:

Code:
$ dd if=SVM.image_KVM_4.0.41.8018.raw bs=1M | ssh <destination ip> dd of=/dev/<vgname>/vm-<vmid>-disk-1 bs=1M

and the file is transferred directly to the LVM.
 
From Windows directly? Not possible

From Linux via SSH it is easy. Create a new vm with the desired disk size (same as raw) and memorize the id, then try to find the lvm backed storage for the vm and determine the underlying device path e.g. /dev/<vgname>/vm-<vmid>-disk-1 and run the following command:

Code:
$ dd if=SVM.image_KVM_4.0.41.8018.raw bs=1M | ssh <destination ip> dd of=/dev/<vgname>/vm-<vmid>-disk-1 bs=1M

and the file is transferred directly to the LVM.

Thank you, I have figured this out (and we can use 'cat').
It is possible to deploy VM from Windows.
 
hello i have same situation failed to restre backup now i extract the backup and find

qemu-server.conf tmp-disk-drive-scsi0.raw i was told to do new dummy VM with same size of backup disk and i made then i do qm import i made and i got new disk added to VM but not attached and i add this to vm and restart but i got the system request me to install centos again any help how to solve
 
hello i have same situation failed to restre backup now i extract the backup and find

qemu-server.conf tmp-disk-drive-scsi0.raw i was told to do new dummy VM with same size of backup disk and i made then i do qm import i made and i got new disk added to VM but not attached and i add this to vm and restart but i got the system request me to install centos again any help how to solve
probably missing some boot order setting (e.g., check that after you've reattached the disk to a slot like scsi0, that that slot comes before the CDROM drive in the boot order settings).
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!