OpenVZ Forum


Home » General » Support » Add second HDD Custom Location / Partition
Add second HDD Custom Location / Partition [message #53362] Fri, 22 June 2018 18:06 Go to next message
TomB is currently offline  TomB
Messages: 30
Registered: July 2017
Location: -Root-
Member
Hi,

How can I specify a custom location for a new VM HDD?
/vz = full flash (root HDD)
/hdd = hdd storage (Second disk)

[Updated on: Fri, 22 June 2018 18:06]

Report message to a moderator

Re: Add second HDD Custom Location / Partition [message #53364 is a reply to message #53362] Sat, 23 June 2018 05:33 Go to previous messageGo to next message
vaverin is currently offline  vaverin
Messages: 708
Registered: September 2005
Senior Member
https://docs.virtuozzo.com/virtuozzo_7_command_line_referenc e/managing-virtual-machines/prlctlvm.html#managing-virtual-d evices

prlctl set <VM_name> {--device-add hdd | --device-set hdd<N>}
[--image <file>] [--size <size>] [--iface <ide|scsi|virtio>]
[--subtype <virtio-scsi|hyperv>] [--position <pos>]
[--enable|--disable]

--device-set hdd<N> Modifies the parameters of an existing virtual hard disk.
Virtual hard disks are named using the hdd<N> format where <N> is the drive index number starting from 0 (e.g., hdd0, hdd1). To obtain the list of disk names, use the prlctl list command with the --info option.

--image <file>
Specifies an image file that will be used to emulate the virtual disk.

If the specified image does not exist, it is created and used to emulate the virtual hard disk.
If the specified image exists, it is used to emulate the virtual hard disk.
Re: Add second HDD Custom Location / Partition [message #53365 is a reply to message #53364] Sat, 23 June 2018 10:17 Go to previous messageGo to next message
TomB is currently offline  TomB
Messages: 30
Registered: July 2017
Location: -Root-
Member
vaverin wrote on Sat, 23 June 2018 07:33
https://docs.virtuozzo.com/virtuozzo_7_command_line_referenc e/managing-virtual-machines/prlctlvm.html#managing-virtual-d evices

prlctl set <VM_name> {--device-add hdd | --device-set hdd<N>}
[--image <file>] [--size <size>] [--iface <ide|scsi|virtio>]
[--subtype <virtio-scsi|hyperv>] [--position <pos>]
[--enable|--disable]

--device-set hdd<N> Modifies the parameters of an existing virtual hard disk.
Virtual hard disks are named using the hdd<N> format where <N> is the drive index number starting from 0 (e.g., hdd0, hdd1). To obtain the list of disk names, use the prlctl list command with the --info option.

--image <file>
Specifies an image file that will be used to emulate the virtual disk.

If the specified image does not exist, it is created and used to emulate the virtual hard disk.
If the specified image exists, it is used to emulate the virtual hard disk.



prlctl set VMNAME --device-add hdd --image /home/hdd/VMNAME(.hdd)
Creating hdd1 (+) scsi:1 image='/home/hdd/VMNAME.hdd' subtype=virtio-scsi

VM configuration validation result(s) :
* The image file "/home/hdd/VMNAME" used by hard disk 2 does not exist.Hard disk 2 will not be connected at the virtual machine startup.
Failed to configure the virtual machine.


The instruction is not clear for me.
What I did to resolve this issue:

prlctl set VMNAME --device-add hdd
mv /vz/vmprivate/ID/harddisk1.hdd /home/hdd/
prlctl set VMNAME --device-set hdd1 --image /home/hdd/harddisk1.hdd



--

This does not work for me with the latest version:
If the specified image does not exist, it is created and used to emulate the virtual hard disk.

[Updated on: Sat, 23 June 2018 11:40]

Report message to a moderator

Re: Add second HDD Custom Location / Partition [message #53367 is a reply to message #53365] Mon, 25 June 2018 09:30 Go to previous messageGo to next message
vaverin is currently offline  vaverin
Messages: 708
Registered: September 2005
Senior Member
Dear TomvB,
unfortunately I was reproduced the problem on my test node,
submitted https://bugs.openvz.org/browse/OVZ-7035
and pushed developers to clarify the situation.
Re: Add second HDD Custom Location / Partition [message #53369 is a reply to message #53367] Mon, 25 June 2018 12:55 Go to previous messageGo to next message
vaverin is currently offline  vaverin
Messages: 708
Registered: September 2005
Senior Member
Developers advised to use
prlctl device set VM --device-add hdd --image IMGFILE --recreate

[Updated on: Mon, 25 June 2018 12:55]

Report message to a moderator

Re: Add second HDD Custom Location / Partition [message #53370 is a reply to message #53369] Mon, 25 June 2018 18:58 Go to previous message
TomB is currently offline  TomB
Messages: 30
Registered: July 2017
Location: -Root-
Member
vaverin wrote on Mon, 25 June 2018 14:55
Developers advised to use
prlctl device set VM --device-add hdd --image IMGFILE --recreate


Thanks! I'll try it.
Previous Topic: Openvz 7.07, yum upgrade failed
Next Topic: net.ipv4.ip_forward
Goto Forum:
  


Current Time: Tue Mar 19 11:12:59 GMT 2024

Total time taken to generate the page: 0.03794 seconds