VMware Cloud Community
rickywood
Contributor
Contributor
Jump to solution

get-ccdrive not working on Windows 7 powercli

I'm having a strange issue with powercli 4.1.0-264274 on Windows 7:

connect-viserver -server myserver

get-cddrive -vm myvm

On Windows 7 the results are:

Iso HostDevice RemoteDevice

--- -


-


On Windows Xp the results are:

IsoPath : Folder/my iso.iso

HostDevice :

RemoteDevice :

ConnectionState : VMware.VimAutomation.Client20.ConnectInfoImpl

Id : VirtualMachine-vm-12345/9876

Name : CD/DVD Drive 1

On Xp the script works and produces the correct results, on Windows 7 it does not work. Can somebody please help me find a solution or workaround for the issue on Windows 7?

Thanks,

Tags (3)
Reply
0 Kudos
1 Solution

Accepted Solutions
admin
Immortal
Immortal
Jump to solution

Try to retrieve the information like this:

$cd = Get-CDDrive -VM myvm
$cd.ExtensionData.Backing

-


PowerCLI development team

View solution in original post

Reply
0 Kudos
11 Replies
Texiwill
Leadership
Leadership
Jump to solution

Hello,

Moved to the PowerCLI forum.


Best regards,
Edward L. Haletky VMware Communities User Moderator, VMware vExpert 2009, 2010

Now Available: 'VMware vSphere(TM) and Virtual Infrastructure Security'[/url]

Also available 'VMWare ESX Server in the Enterprise'[/url]

Blogging: The Virtualization Practice[/url]|Blue Gears[/url]|TechTarget[/url]|Network World[/url]

Podcast: Virtualization Security Round Table Podcast[/url]|Twitter: Texiwll[/url]

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Are you using PowerCLI 4.1 ?

Get-PowerCLIVersion

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
admin
Immortal
Immortal
Jump to solution

There should be no difference between Windows 7 and XP regarding this cmdlet. Are you sure you are executing the script on the same VM in both cases? Can you do "Get-CDDrive -VM myvm | select *" to see what fields differ (except for ISO path)?

Thanks,

Dimitar

-


PowerCLI development team

Reply
0 Kudos
rickywood
Contributor
Contributor
Jump to solution

The powercli version on Windows 7 is:

PowerCLI Version

-


VMware vSphere PowerCLI 4.1 build 264274

The version on Xp is 4.0

I upgraded to to version 4.1 on the the Xp machine and I am having the same problem as on Windows 7. The issue seems to be specific to Version 4.1

Thanks,

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

There seems ot be indeed an issue with this cmdlet in PowerCLI 4.1, I could reproduce your problem.

A guest with an ISO mounted from a datastore and no output is shown.

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
rickywood
Contributor
Contributor
Jump to solution

running the command on powercli Version 4.0:

IsoPath :

HostDevice :

RemoteDevice :

ConnectionState : VMware.VimAutomation.Client20.ConnectInfoImpl

Id : VirtualMachine-vm-24462/3002

Name : CD/DVD Drive 1

running the command on powercli Version 4.1:

IsoPath :

HostDevice :

RemoteDevice :

ParentId : VirtualMachine-vm-24462

Parent : myvm

ConnectionState : VMware.VimAutomation.ViCore.Impl.V1.ConnectInfoImpl

ExtensionData : VMware.Vim.VirtualCdrom

Id : VirtualMachine-vm-24462/3002

Name : CD/DVD Drive 1

Uid : /VIServer=@vcserver.company.com:443/CDDrive=Virtual Machine-vm-24462&slash;3002/

What I am trying to do is:

get-cddrive -myvm | set-cddrive -isopath $isopath -startconnected:$true -Confirm:$false

The problem is I get the following error :

Set-CDDrive : 9/15/2010 8:53:50 AM Set-CDDrive The operation for the entity VirtualMachine-vm-24462 failed with the following message: "Invalid configuration for device '0'."

Thanks,

Reply
0 Kudos
admin
Immortal
Immortal
Jump to solution

The problem with Set-CDDrive might be caused by incorrect iso path. Could you post the contents of $isopath variable? Also what version of vCenter/ESX are you using? Are you connected to the vCenter or directly to the ESX?

-


PowerCLI development team

Reply
0 Kudos
rickywood
Contributor
Contributor
Jump to solution

$isopath = folder/filename.iso

Connecting to the vCenter, information is:

VMware Infrastructure Client

Version 2.5.0

Build 174768

VMware VirtualCenter

Version 2.5.0

Build 227637

I ran the following command and it worked:

New-CDDrive -IsoPath $isopath -vm myvm, it created a second cd drive

The problem is when a cd drive already exists the get-cddrive cannot retrieve the information. LucD was able to reproduce the issue.

Thanks,

Reply
0 Kudos
admin
Immortal
Immortal
Jump to solution

Try to retrieve the information like this:

$cd = Get-CDDrive -VM myvm
$cd.ExtensionData.Backing

-


PowerCLI development team

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

That way the information is visible for me.

That's on a vCenter 4.1 with an ESX 4.1 host.

The cmdlets were run on a XP Pro 32-bit client.

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
rickywood
Contributor
Contributor
Jump to solution

LucD and d_hristov thank you for your help, the issues is resolved, I had to reinstall the OS on my Virtual machine and installed VMware vSphere PowerCLI 4.1 build 264274. For clients having a previous version installed, we uninstalled powercli rebooted and installed the latest version.

It won't display the Cd information on the cmd line, by following g_histov advise:

$cd = Get-CDDrive -VM myvm

$cd.ExtensionData.Backing

was able to see the information and now I am able to mount the cd and associate the iso.

Thanks.

Reply
0 Kudos