VMware Cloud Community
NordalLund
Contributor
Contributor

New-CDDrive -contentlibraryiso issue

Hi All,

I'm trying to add a cd drive with a mounted iso from the content library. I'm trying the following:

PS D:\Users\z8qno> $test = Get-ContentLibraryItem -Name "TinyCore-current.iso"

PS D:\Users\z8qno> $test

---------Command output------------

Name                           ContentLibrary                 ItemType                       SizeGB

----                           --------------                 --------                       ------

TinyCore-current.iso           ISOImages                      iso                            0,016

PS D:\Users\z8qno> get-vm xxx | New-CDDrive -ContentLibraryIso $test -Verbose

VERBOSE: 08-09-2017 10:15:03 New-CDDrive Started execution

VERBOSE: Performing the operation "Creating CD drive on Virtual Machine 'xxx' mounting ISO image from Content Library Item: 'TinyCore-current.iso'." on target

"xxx".

New-CDDrive : 08-09-2017 10:15:03       New-CDDrive             com.vmware.vapi.std.errors.operation_not_found {'messages': [com.vmware.vapi.std.localizable_message {'id': vapi.met

hod.input.invali

d.interface, 'default_message': Cannot find service 'com.vmware.vcenter.iso.image'., 'args': [com.vmware.vcenter.iso.image]}], 'data':}.

At line:1 char:23

+ get-vm xxx | New-CDDrive -ContentLibraryIso $test -Verbose

+                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [New-CDDrive], CisException

    + FullyQualifiedErrorId : VirtualDeviceServiceImpl.NewVirtualCDDrive.FromContentLibraryIso,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.NewCDDrive

VERBOSE: 08-09-2017 10:15:03 New-CDDrive Finished execution

---------Command output end------------

According to release notes of powerchell 6.5.2 this should be possible?

But then, Im not 100% sure that i am on 6.5.2. I did an module-update -name vmware.powercli, but get-powercliversion tells me im still in 6.5.1, but get-module -name vmware.powercli tells me in on 6.5.2 - not very consistent.

Anyways, the option is there, so I think it's supposed to work?

PS D:\Users\z8qno> Get-PowerCLIVersion

---------Command output------------

PowerCLI Version

----------------

   VMware PowerCLI 6.5.1 build 5377412

---------------

Component Versions

---------------

   VMware Cis Core PowerCLI Component 6.5 build 6230110

   VMware VimAutomation Core PowerCLI Component 6.5 build 6234650

   VMware SRM PowerCLI Component 6.5 build 5374694

   VMware Licensing PowerCLI Component 6.5 build 5375648

   VMware Vds PowerCLI Component 6.5 build 5374428

   VMware vROps PowerCLI Component 6.5 build 5375723

   VMware HA PowerCLI Component 6.0 build 5314477

   VMware HorizonView PowerCLI Component 7.1.0 build 5307191

   VMware Cloud PowerCLI Component 6.5 build 5375799

   VMware PCloud PowerCLI Component 6.5 build 5376282

   VMWare ImageBuilder PowerCLI Component 6.6 build 5299608

   VMWare AutoDeploy PowerCLI Component 6.6 build 5299608

   VMware Storage PowerCLI Component 6.5 build 5374001

   VMware vSphere Update Manager PowerCLI 6.6 build 5301639

PS D:\Users\z8qno> get-Module -Name vmware*

ModuleType Version    Name                                ExportedCommands

---------- -------    ----                                ----------------

Binary     6.5.1.5... VMware.DeployAutomation             {Add-DeployRule, Add-ProxyServer, Add-ScriptBundle, Copy-DeployRule...}

Binary     6.5.1.5... VMware.ImageBuilder                 {Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Compare-EsxImageProfile, Export-EsxImageProfile...}

Manifest   6.5.2.6... vmware.powercli

Binary     6.5.2.6... VMware.VimAutomation.Cis.Core       {Connect-CisServer, Disconnect-CisServer, Get-CisService}

Binary     6.5.1.5... VMware.VimAutomation.Cloud          {Add-CIDatastore, Connect-CIServer, Disconnect-CIServer, Get-Catalog...}

Manifest   6.5.1.5... VMware.VimAutomation.Common

Binary     6.5.2.6... VMware.VimAutomation.Core           {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAdapter, Add-VMHost, Add-VMHostNtpServer...}

Binary     6.0.0.5... VMware.VimAutomation.HA             Get-DrmInfo

Binary     7.1.0.5... VMware.VimAutomation.HorizonView    {Connect-HVServer, Disconnect-HVServer}

Binary     6.5.1.5... VMware.VimAutomation.License        Get-LicenseDataManager

Binary     6.5.1.5... VMware.VimAutomation.PCloud         {Connect-PIServer, Disconnect-PIServer, Get-PIComputeInstance, Get-PIDatacenter}

Manifest   1.0.0.5... VMware.VimAutomation.Sdk            {Get-InstallPath, Get-PSVersion}

Binary     6.5.1.5... VMware.VimAutomation.Srm            {Connect-SrmServer, Disconnect-SrmServer}

Binary     6.5.1.5... VMware.VimAutomation.Storage        {Copy-VDisk, Export-SpbmStoragePolicy, Get-NfsUser, Get-SpbmCapability...}

Script     1.0        VMware.VimAutomation.StorageUtility Update-VmfsDatastore

Binary     6.5.1.5... VMware.VimAutomation.Vds            {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHost, Export-VDPortGroup, Export-VDSwitch...}

Binary     6.5.1.5... VMware.VimAutomation.vROps          {Connect-OMServer, Disconnect-OMServer, Get-OMAlert, Get-OMAlertDefinition...}

Binary     6.5.1.5... VMware.VumAutomation                {Add-EntityBaseline, Copy-Patch, Get-Baseline, Get-Compliance...}

PS D:\Users\z8qno> $PSVersionTable

Name                           Value

----                           -----

PSVersion                      5.1.14409.1005

PSEdition                      Desktop

PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}

BuildVersion                   10.0.14409.1005

CLRVersion                     4.0.30319.42000

WSManStackVersion              3.0

PSRemotingProtocolVersion      2.3

SerializationVersion           1.1.0.1

---------Command output end------------

Is anyone having the same issue, or knows how to do it the right way?

BR, Kasper

0 Kudos
4 Replies
LucD
Leadership
Leadership

You are doing it correctly.
Since 6.5.2, PowerCLI is doing smaller upgrades, in 6.5.2 only 3 modules were updated (the ones marked with 6.5.2).

There have been some issues reported with the cmdlet before.

See for example 15. Re: Get-ContentLibraryItem doesn't work

I suggest to create a SR for this (yes, PowerCLI is supported, see PowerCLI Support Breakdown).


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

0 Kudos
NordalLund
Contributor
Contributor

Thanks Luc, i will do that.

0 Kudos
NordalLund
Contributor
Contributor

Just to close this.

I did a support request at vmware, and the answer is that the powercli cmd-let is not supported in vcenter 6.0.

To use this feature you need the have vcenter 6.5.

Thanks, Kasper

0 Kudos
LucD
Leadership
Leadership

Thanks for sharing that.


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

0 Kudos