Monday, September 10, 2012

VM settings: CD/DVD drive

Client Device:
Very good option, No need to go to server. But your network bandwidth should be strong, Just insert CD/DVD in your client system's CD/DVD tray esxi/esx server over network (You can map iso file to VM as well from client) and just Start installing OS/application. 

How to configure "Client Device"
Power on VM, Open VM console. Click CD/DVD drive icon, if cd/dvd is in Tray just "press connect to D:" (D is my cd/dvd drive on VM) or use connect to iso image on local disk to map ISO file on client computer.

Press connect to ISO image on local disk if you want to mount an ISO file which is stored on client system or on shared drive.

Now here is the tricky part, you will get disconnect from connected CD/DVD drive as soon as you restart the VM and VM booting is so fast you might not get enough time to connect to CD/DVD rom. For this just configure power on boot delay settings from VM settings>Options tab>boot option. Enter 1000 milliseconds (adjust it as per your convenience). And you will get enough time to connect to D drive or map ISO file. (if you are mapping ISO file for first time I will suggest increase milliseconds as per your convenience)

Also make sure in VM bios boot from CD/DVD is selected in the top Queue,

(Trick here, to boot directly into Bios setting as above screenshot select option Force BIOS setup, next time it boots it enters into bios, VM booting is really fast, you might face hard time when wants to go to bios settings)

Host Device:

Just insert CD/DVD on to esx/esxi server and you go, vm will access it.

Make sure you have selected options as below. Here my connected check box is greyed out because vm is powered off.

If you don’t select device status to connected or connect at power on (once you power on vm D drive will get automatically connected if you have selected connect at power on), CD/DVD drive will be in disabled status, it means you have inserted CD/DVD but Host drive is not in use.

(vMotion will not work if device status is connected, it will give the error)

Datastore ISO File:
You will map ISO file which are kept on esxi local disks, vmfs datastore or NFS drive. (here my suggestion is Keep all your ISO file centralize at one shared datastore location, if the same datastore is accessible from another esxi host, vMotion will not get interrupted even if device status is connected)
(If iso files are kept on local disk of host and another host is not able to access it and status is connected vmotion will not work)

CD/DVD drive Modes:

You will be able to edit these settings only when VM is powered off.

Passthrough IDE (raw). Use mode only for remote client device access.

Emulate IDE. Use to access a host CD-ROM device.

The host CD-ROM device is accessed through emulation mode. Passthrough mode is not functional for local host CD-ROM access. You can write or burn a remote CD only through pass-through mode access, but in emulation mode you can only read a CD-ROM from a host CD-ROM device.

Virtual Device Node is similar depict of IDE primary, secondary (master/slave) HDD port on physical system.

Checking and changing device status from RVtools and powercli.

Many time it happens you connect to CD/DVD drive but forget to uncheck connected and destination Host is not able to access cd/dvd from source host, which might cause interruption in vMotion depending on device type settings. It is very hectic if you have multiple VMs (lets say 20, 50 maybe more than 100), you will need to check device status on every VM settings manually.

There is a cool tool RVtools, download and install it.

Log on it, here Localhost is my vcenter.
And check in vCD tab, you will find the status. You can select only vm with connected = true and powered on. Once they are selected click disconnect CD.
Using powercli

To connect to vcenter/esxi through powercli check my blog

What below script does is, retrieve all powered on vm list and configure cd/dvd drive settings to client device type with unchecking connected and connect at poweron.

get-vm | where-object {$_.powerstate -eq "poweredon"} | get-cddrive | set-cddrive -nomedia -startconnected:$false -connected:$false -confirm:$false

No comments: