Uploaded image for project: 'OpenVZ'
  1. OpenVZ
  2. OVZ-7035

prlctl set VMID --device-add hdd does not create hdd image file

    Details

      Description

      According to documentation prlctl set VMID --device-add hdd should create
      hdd image file if it does not exist.
      However seems it does not work as it described.

      Please take look at:
      https://forum.openvz.org/index.php?t=msg&th=13530&goto=53365&S=f83c832c8c93efde5084068352b92187#msg_53365

      https://docs.virtuozzo.com/virtuozzo_7_command_line_reference/managing-virtual-machines/prlctlvm.html#managing-virtual-devices
      "
          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.

        Activity

        Hide
        igor Igor Sukhih added a comment -

        --device-add <hdd|cdrom|net|fdd|serial|usb|pci> [device_options]
        Adding virtual hard disk drives to VE
        --device-add hdd [--image <image_name>] [--recreate] [--size <n>]
        [--iface <ide|scsi|virtio>] [--subtype <virtio-scsi|hyperv>]
        [--position <n>] [--mnt <path>]

        image_name: the image file to be used to emulate the VE virtual
        hard disk. To use an existing image file, specify its name and
        path. To create a new image file, omit the --image option (a new
        file named harddiskN.hdd will be created in the VE directory) or
        use --recreate option.

        Show
        igor Igor Sukhih added a comment - --device-add <hdd|cdrom|net|fdd|serial|usb|pci> [device_options] Adding virtual hard disk drives to VE --device-add hdd [--image <image_name>] [--recreate] [--size <n>] [--iface <ide|scsi|virtio>] [--subtype <virtio-scsi|hyperv>] [--position <n>] [--mnt <path>] image_name: the image file to be used to emulate the VE virtual hard disk. To use an existing image file, specify its name and path. To create a new image file, omit the --image option (a new file named harddiskN.hdd will be created in the VE directory) or use --recreate option.
        Hide
        vvs Vasily Averin added a comment -

        PSBM-86408 was submitted to improve documentation

        Show
        vvs Vasily Averin added a comment - PSBM-86408 was submitted to improve documentation

          People

          • Assignee:
            igor Igor Sukhih
            Reporter:
            vvs Vasily Averin
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: