Kid Kooijmans1709160840 Posted November 21, 2022 Share Posted November 21, 2022 Hi, I'm trying to extend to extend a disk of a VM using the Hypervisor 8.2 powershell SDK. I can't seem to find a way. I have set up a connection and read the VM I want to edit the disk of. $VMs = get-xenvm | where {$_.name_label.StartsWith("VMName")} foreach($VM in $VMs){ $VBDrefs = $VM.VBDs foreach($VBDref in $VBDrefs){ $VBD = Get-XenVBD -Ref $VBDref $VDI = Get-XenVDI -Ref $VBD.VDI if($VDI.name_label -eq $VM.name_label + " 0"){ $VirtualSize = ($GB * 120) $VirtualSize Set-XenVDI -VDI $VDI .... --> there is no option to set the new size of the disk here } } } Link to comment
0 Sergey Polyakov Posted December 2, 2022 Share Posted December 2, 2022 Invoke-XenVDI -Uuid <guid> -XenAction Resize -Size 80GB Link to comment
0 Kid Kooijmans1709160840 Posted December 7, 2022 Author Share Posted December 7, 2022 Nice, that did the trick. I ran "Get-Help -Category Cmdlet -Name Invoke-XenVDI -Examples" but wasn't able to find the "-size 80GB" parameter. Thanks! Link to comment
0 Konstantina Chremmou Posted February 22 Share Posted February 22 Get-Help does not work very well for the CH powershell module because the cmdlets use heavily dynamic parameters. We're planning to work around this issue soon. Link to comment
Question
Kid Kooijmans1709160840
Hi,
I'm trying to extend to extend a disk of a VM using the Hypervisor 8.2 powershell SDK. I can't seem to find a way.
I have set up a connection and read the VM I want to edit the disk of.
$VMs = get-xenvm | where {$_.name_label.StartsWith("VMName")}
foreach($VM in $VMs){
$VBDrefs = $VM.VBDs
foreach($VBDref in $VBDrefs){
$VBD = Get-XenVBD -Ref $VBDref
$VDI = Get-XenVDI -Ref $VBD.VDI
if($VDI.name_label -eq $VM.name_label + " 0"){
$VirtualSize = ($GB * 120)
$VirtualSize
Set-XenVDI -VDI $VDI .... --> there is no option to set the new size of the disk here
}
}
}
Link to comment
3 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now