VMware Cloud Community
ezjurgen
Contributor
Contributor

add new disk to a vm in Vcloud?

ok I might be getting blind here. I am using Azure Runbooks to automate a vcloud director. I have the vim.automation.cloud module but cant find new-civmDisk in there. Doing a search only give me 2 posts, Both fail for me; see below. What am I missing here? it should not be this hard is it?

John made his own module :

jondwaite/CIVMDisks: PowerShell cmdlets to manage disks attached to Virtual Machines in VMware Cloud...

Write-Error: Error retrieving VM properties from VCD API, exiting.

And CloudNinja mafe a function. 

Add vCloud Harddisks with PowerCLI | Geek after Five (wordpress.com) 

PS C:\WINDOWS\system32> Get-CIVM -Name TEST13-CL-SRV05 | New-CIHarddisk -vm $vm -size 20000

New-CIHarddisk : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match an
y of the parameters that take pipeline input.
At line:1 char:34
+ Get-CIVM -Name TEST13-CL-SRV05 | New-CIHarddisk -vm $vm -size 20000
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (TEST13-CL-SRV05:PSObject) [New-CIHarddisk], ParameterBindingException
+ FullyQualifiedErrorId : InputObjectNotBound,New-CIHarddisk

 

 

0 Kudos
7 Replies
Macleud
Enthusiast
Enthusiast

Hello.

What version of vCloud do you have?

0 Kudos
ezjurgen
Contributor
Contributor

Sorry been working on other parts of the deployment

 

I ran

$global:DefaultCIServers | select name, version

And it seems the version is 10.3.3.19610595


0 Kudos
ahidri
Contributor
Contributor

Hello,
you have this error in version 10.3 or in oldest one ?

0 Kudos
Macleud
Enthusiast
Enthusiast

Hello everyone.
Jondwaite updated the module in February. Try updating the module. Pay attention to the syntaxis of the command.

Try to specify a size value. For example:

Add-CIVMDisk -DiskSize 100G
0 Kudos
ezjurgen
Contributor
Contributor

Hi Ahidri,

What do you mean with the oldest version? 

Yes I had this error after connecting to the vCloud Director using PowerCLI and then trying to add the disk

0 Kudos
ezjurgen
Contributor
Contributor

Hi Macleud,

Thanks for responding. 

Saddly, Johns module is made for PS v6 minimum and I am using PS5 and the following sync VSCode->DevOps->AzureAutomationRunbooks. And I did not figure out how to jump my code to a higher PS version yet and how it would sync over DevOps to Azure Runbooks in a higher version.

I was kinda hoping you guys already figured out how to create and add a disk to a VM using vcd Cloud API. does anyone have a working script using the API v37 10.3?

And what version of powershell are most of you guys working on? 5.1? 6? 7?

0 Kudos
ezjurgen
Contributor
Contributor

And it seems the version is 10.3.3.19610595

0 Kudos