I'm working on a powershell script that required to be able to unmount or mount some ISO in a particular VM.
No prob for the "unmounting" part with invoke-xenvbd -XenAction Eject but i'm not able to mount an ISO with the same command but with the XenAction Insert.
Question
Julien BANZI1709152910
Hi everyone,
I'm working on a powershell script that required to be able to unmount or mount some ISO in a particular VM.
No prob for the "unmounting" part with invoke-xenvbd -XenAction Eject but i'm not able to mount an ISO with the same command but with the XenAction Insert.
Here is my code sample :
$Master = Get-XenVM -Name $($XD_Master.Xen_MasterName)
$ISO_library = get-XenSR | Where-Object {($_.type -eq 'iso') -and $_.name_label -notmatch 'XenServer Tools'}
$CD = ForEach ($ISO in $ISO_Library.VDIs) {Get-XenVDI -Ref $ISO.opaque_ref | Where-Object {$_.name_label -eq 'FinalisationVDI.iso'}}
$VBD = $Master.VBDs | Get-XenVBD | where {($_.Type -eq 'CD')}
I try this command to mount the ISO but it fails...
Invoke-XenVBD -Uuid $VBD.uuid -XenAction Insert $CD.uuid
Any help please ?
Link to comment
10 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