VMware Cloud Community
alansinclair
Contributor
Contributor

Set-CDDrive -ISOPath parameters?

The example for Set-CDDrive (e.g. at http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Set-CDDrive.html) is

$cd = New-CDDrive -VM VM -ISOPath "[sof-20666-esx:storage1] ISO\testISO.iso"

Is the path "ISO\testISO.iso" on the machine where the powershell script is running, or is it the ESX host?

Also is "[sof-20666-esx:storage1]" a type declaration, or something which I need to discover from the machine running the script (if so, where to find it)?

Thanks for help - I'm so abysmally ignorant and can't find a good starting place to learn from.

0 Kudos
3 Replies
mattboren
Expert
Expert

Hello, alansinclair-

The value that you should specify for the parameter -ISOPath is a datastore path.  A datastore path is of the form:

[datastoreName] someFolder/somefile.iso

This consists of:

0)  the name of the datastore, enclosed in the square brackets

1)  a space character

2)  the name of the desired folder at the root of the datastore

3)  a forward slash (the example in the New-CDDrive documentation incorrectly uses a backslash)

4)  the name of the desired file in the given folder

Another datastore path example, to try to help clarify:

[templatesAndISOs] myISOs/kickstartBoot.iso

This datastore path specified the "kickstartBoot.iso" ISO file that resides in the "myISOs" folder at the root of the "templatesAndISOs" datastore.

So, to create a new CDDrive for a VM and attach an ISO to the CDDrive, would copy "kickstartBoot.iso" to the "myISOs" folder on the "templatesAndISOs" datastore, and then issue the command:

$cdDrive = New-CDDrive -VM myVM -ISOPath "[templatesAndISOs] myISOs/kickstartBoot.iso"

Make sense?

alansinclair
Contributor
Contributor

Cool, thanks so much!

> Make sense?

Yes, very helpful 🙂

and apologies: I clicked 'Helpful answer' instead of 'Correct answer' so owe you some pints (or points)

0 Kudos
mattboren
Expert
Expert

Yes, you are welcome.  And, no problemo on the answer type -- it is always good to have some I.O.U. pints in the bank, just in case :smileysilly:

0 Kudos