Using local harddisk with existing data as storage

jakap

New Member
Mar 11, 2010
16
0
1
Hi guys :)

I've read the wiki and i know, i can use Volume Groups and NFS and iSCSI targets, etc. But is it possible, that i use my Logical Volumes (on a crypted 1.5TB hdd with data..) and simply mount them in the Guest?
I don't want to create new LVs, i saw that this is possible, i only want to use the data in a Guest :)

Is this possible?

Thanks.
 
Hi guys :)

I've read the wiki and i know, i can use Volume Groups and NFS and iSCSI targets, etc. But is it possible, that i use my Logical Volumes (on a crypted 1.5TB hdd with data..) and simply mount them in the Guest?
I don't want to create new LVs, i saw that this is possible, i only want to use the data in a Guest :)

Is this possible?

Thanks.
Yes it's possible.
In a openvz-client use bind mounts.
In a kvm-guest you can use a partition with following command (VMID is this case 123):
Code:
qm set 123 -ide0 /dev/sdc1
Udo
 
I've read the wiki and i know, i can use Volume Groups and NFS and iSCSI targets, etc. But is it possible, that i use my Logical Volumes (on a crypted 1.5TB hdd with data..) and simply mount them in the Guest?
I don't want to create new LVs, i saw that this is possible, i only want to use the data in a Guest :)

You can add any device on the command line, for example

Code:
qm set <cmid> --ide1 /dev/sdc2
 
Thanks :)

What do you think is more performant - decrypting the harddisk in the host or in the guest? Or maybe there is not such a big difference? Anyway, i will try it.
 
Dietmar,
qm set <cmid> --ide1 /dev/sdc2

  • Could You tell if this command also works with openVZ containers?
  • Where this configuration change is stored (in container conf files or in proxmox conf file)? Does during VM backup and restore this change will be taken into account automatically or Ill nedd to apply this manually after every VM openVZ container restore?
  • as for command itself: I need to use "--ide1'' as "ide0" is already used by container - right?
  • what should I put as 'sdc2'?
    I have drives in RAID1 like /sdc, /sdd and those two disks form an md0 device.
    Can I put there '--ide1 /dev/md0' ? (I am tottaly newbee and think better ask than be sorry later ;-) ,
Edited: After issue following command 'qm set 101 --ide1 /dev/md0' on proxmox host Ive got following error: "setting parameters failed - unable to read config for VM 101"

Kind regards,
Piotr
 
Last edited:
Could You tell if this command also works with openVZ containers?

no. see 'man vzctl' for OpenVZ

Where this configuration change is stored (in container conf files or in proxmox conf file)? Does during VM backup and restore this change will be taken into account automatically or Ill nedd to apply this manually after every VM openVZ container restore?

Configuration is stored in /etc/qemu-server/<vmid>.conf. vzdump should work without problems - but it is always a good idea to test backup and restor.

as for command itself: I need to use "--ide1'' as "ide0" is already used by container - right?

yes - see 'man qm' for details.

what should I put as 'sdc2'?

/dev/sdc2

I have drives in RAID1 like /sdc, /sdd and those two disks form an md0 device.
Can I put there '--ide1 /dev/md0'

yes

After issue following command 'qm set 101 --ide1 /dev/md0' on proxmox host Ive got following error: "setting parameters failed - unable to read config for VM 101"

Please post the VM config file.
 
Is your Raid encrypted? If yes, plz test if your config works with "ide1 /dev/md0", write some data (a few GB) into the harddisk and then copy it to /dev/null, does your Guest crash?

Just write "ide1: /dev/md0" in your /etc/qemu-server/id.conf, compare it with the other entrys..
 
You can add any device on the command line, for example

Code:
qm set <cmid> --ide1 /dev/sdc2

Hi

If I do this with an etx2 or ext3 partition, the partition shows up in the guest as an unformated drive, then I can fdisk, mkfs and mount in the guest.
But I want the existing data on the partition in the guest, and it sounds to me that is what is happening to others here? What do I do wrong?

(If I do "qm set <cmid> --ide1 /dev/sdc" it works, and I can mount sdc2 etc in the guest, but thats not what I want...)

jan
 
But I want the existing data on the partition in the guest, and it sounds to me that is what is happening to others here? What do I do wrong?
[/Quite]

That is the way it works (called full virtualization) - so the disk you assigns is seen as entire hard disk inside the VM.
 
So for KVZ You can use "qm set" and for openVZ You use "vzctl".
Could somebody tell me what I need to do to make directory on another volume visible to openvz containers ? I mean "vzctl -command here" ;-)

I have second volume at /dev/md0 (in proxmox its accessible at /DATA) and I am trying to use this space on vm container n# 101

After issuing "vzctl set 105 --devnodes md0:rw --save"
Ive got:
Warning: Unknown iptable module: ipt_recent, skipped
Saved parameters for CT 105

Where I can now acces this directory/device?
 
Last edited:
Hi

If I do this with an etx2 or ext3 partition, the partition shows up in the guest as an unformated drive, then I can fdisk, mkfs and mount in the guest.
But I want the existing data on the partition in the guest, and it sounds to me that is what is happening to others here? What do I do wrong?

(If I do "qm set <cmid> --ide1 /dev/sdc" it works, and I can mount sdc2 etc in the guest, but thats not what I want...)

jan
Hi Jan,
you export an partition, not a disk - so you don't have a partitiontable inside the guest!
But you can mount the filesystem:
Code:
fdisk -l /dev/sdb
no partition table
mount /dev/sdb /mnt
ls /mnt
<here is the content of the partition>
Hope it's help

Udo
 
Code:
fdisk -l /dev/sdb
no partition table
mount /dev/sdb /mnt
ls /mnt
<here is the content of the partition>
Hope it's help

Udo

I didn't even try to mount it as I figured I had to see a partition with fdisk! My mistake, thanks :)
 

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!