jondwaite / civmdisks Goto Github PK
View Code? Open in Web Editor NEWPowerShell cmdlets to manage disks attached to Virtual Machines in VMware Cloud Director
License: MIT License
PowerShell cmdlets to manage disks attached to Virtual Machines in VMware Cloud Director
License: MIT License
Not sure how active this project is anymore but I was using the module to attempt to create a bulk number of VMs in a VMware Cloud Director instance.
When doing this I am importing objects from a csv and parsing them with foreach loop. Each VM has multiple drives to add, up to 20 additional drives.
After the first VM is created, it will add the disks as expected. All other VMs created it will not add the disks. It returns an error of "Write-Error: Exception occurred attempting to add disk to VM, exiting."
Would it be possible to add a feature that can update the VM disk storage profile, if this is not set to the VM default?
in function - Get-APIVersion
there is operation: Measure-Object -Property Version -Maximum).Maximum.ToString() + ".0"
it returns 36.2.0 for API. Which is not accepted by vCloud resulting in error : Error retrieving VM properties from VCD API, exiting.
Real reason is: Response status code does not indicate success: 406 (Not Acceptable).
vCloud Director expects API version 36.2
By placing comment of + ".0" everything works fine.
Measure-Object -Property Version -Maximum).Maximum.ToString() #+ ".0"
Hi,
I am using vCD version 10.3.3.19610595 and powershell 7.4 core
when running the following code:
$VMName = "Test-SRV01"
Install-Module CIVMDisks -Scope CurrentUser -AllowClobber
Import-Module CIVMDisks
$Vm = Get-CIVM -name $VMName
$Vm
$vm | Get-CIVMDisk | Format-Table
I get this error:
Write-Error: Error retrieving VM properties from VCD API, exiting.
The server is found when i output $vm
$vm
Name Status GuestOSFullName CpuCount MemoryGB
---- ------ --------------- -------- --------
Test-SRV01 PoweredOff Microsoft Windows Server 2022 (64-bit) 1 4,000
anybody an idea?
When running on culture other than US English, the non-exported function Get-APIVersion
might return version in wrong format, which causes other functions to fail.
https://github.com/jondwaite/CIVMDisks/blob/master/CIVMDisks.psm1#L37
Example from a system using fi-FI
culture. Note how decimal separator is replaced with comma.
C:\ [DBG]:>> $APIVersion = (($Versions.SupportedVersions.VersionInfo | `
>> Where-Object { $_.deprecated -eq $false }) | `
>> Measure-Object -Property Version -Maximum).Maximum.ToString()
C:\ [DBG]:>> $apiversion
36,3
This happens because Measure-Object -Maximum
causes input to be parsed as a number and ToString()
formats number according to user's current culture if no other formatting information is provided.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.