3

I am using Proxmox VE 4.4 and I am puzzled how to eject a CD/DVD drive that is currently configured. Assume that the ID of the guest VM is set as the environment variable vmid.

Currently the configuration qm config $vmid|grep ^ide gives the following:

ide2: iso-storage:iso/SLE-12-SP2-Server-DVD-x86_64-GM-DVD1.iso,media=cdrom,size=3188M

and I'd like to "eject" that drive such that no media is in that drive anymore, but it still exists as CD/DVD drive to the guest (i.e. without removing the drive!).

How can I achieve that from the shell of the Proxmox VE machine (i.e. the host)?

NB: qm cdrom <vmid> eject does not exist in this version of Proxmox VE, but it does appear to have existed in the past.


What I tried:

# qm set $vmid -ide2 media=cdrom
400 Parameter verification failed.
ide2: invalid format - format error
ide2.file: property is missing and it is not optional

qm set <vmid> [OPTIONS]

and

# qm set $vmid -ide2 media=cdrom,file=
400 Parameter verification failed.
ide2: invalid format - missing key in comma-separated list property

qm set <vmid> [OPTIONS]

and

# qm set $vmid -ide2 media=cdrom,file=/dev/null
update VM $vmid: -ide2 media=cdrom,file=/dev/null
volume /dev/null does not exists
0xC0000022L
  • 1,516
  • 2
  • 22
  • 42

1 Answers1

3

I figured it out on my own.

While almost any value for the <volume> in -ide[n] [file=]<volume> failed (see qm(1)), the undocumented value none did the trick.

   -ide[n] [file=]<volume> [,aio=<native|threads>] [,backup=<1|0>] [,bps=<bps>]
   [,bps_max_length=<seconds>] [,bps_rd=<bps>] [,bps_rd_length=<seconds>] [,bps_wr=<bps>]
   [,bps_wr_length=<seconds>] [,cache=<enum>] [,cyls=<integer>] [,detect_zeroes=<1|0>]
   [,discard=<ignore|on>] [,format=<enum>] [,heads=<integer>] [,iops=<iops>] [,iops_max=<iops>]
   [,iops_max_length=<seconds>] [,iops_rd=<iops>] [,iops_rd_length=<seconds>]
   [,iops_rd_max=<iops>] [,iops_wr=<iops>] [,iops_wr_length=<seconds>] [,iops_wr_max=<iops>]
   [,mbps=<mbps>] [,mbps_max=<mbps>] [,mbps_rd=<mbps>] [,mbps_rd_max=<mbps>] [,mbps_wr=<mbps>]
   [,mbps_wr_max=<mbps>] [,media=<cdrom|disk>] [,model=<model>] [,rerror=<ignore|report|stop>]
   [,secs=<integer>] [,serial=<serial>] [,size=<DiskSize>] [,snapshot=<1|0>]
   [,trans=<none|lba|auto>] [,werror=<enum>]
       Use volume as IDE hard disk or CD-ROM (n is 0 to 3).

I only stumbled across that, because one of the virtual machines in my PVE clustered happened to have that value. So I gave it a try and lo and behold:

qm set $vmid -ide2 media=cdrom,file=none

does the trick.

0xC0000022L
  • 1,516
  • 2
  • 22
  • 42