Quick Support

Für den Fernsupport von nicht verwalteten Geräten verwenden wir die sichere und schnelle Support-Software von AnyDesk.

Sie können unseren angepassten Client für Windows, MacOS und Linux unten herunterladen.

Windows Quicksupport
MacOS Quicksupport
Linux 64-Bit Quicksupport
Skip to content

List VM VDIs by SR IP

Quick and dirty Powershellscript to display the mount point and network point of VDIs by Virtual machines on a specific NFS Storage IP
– you need the XenServerPSModule available on citrix downloads
– just change the first to lines to your xenserver and nfs ip and that’s is

#parameter
$nfsip = "192.168.0.10"
$xenserverip = "192.168.0.4"

Import-Module XenServerPSModule
Connect-XenServer -Url https://$xenserverip

#get all pdbs linked pointing to tintri datastore
$colpbd = Get-Xenpbd | where {$_.device_config.server -like $nfsip}


foreach ($pbd in $colpbd){
	#get all SRs pointing to tintri pbds
	$colsr = Get-XenSR -opaque_ref $pbd.SR.opaque_ref
	
	foreach ($sr in $colsr) {
		#get all VDIs on SR
		$colvdi = Get-XenVDI | where { $_.SR.opaque_ref -like $sr.opaque_ref}

		foreach ($vdi in $colvdi){
            #get vbd
            $colvbd = Get-XenVBD | where { $_.VDI.opaque_ref -like $vdi.opaque_ref}

            foreach ($vbd in $colvbd){
                #Show VM VDI Path
                $vm = Get-XenVM -Ref $vbd.vm.opaque_ref

                
                Write-Host -For DarkYellow "The VM $($vm.name_label) has VDI $($vdi.name_label) on"
                Write-Host "Network Path: $($pbd.device_config.server)$($pbd.device_config.serverpath)/$($sr.uuid)/$($vdi.uuid).vhd"
                Write-Host "XenServer Path: /var/run/sr-mount/$($sr.uuid)/$($vdi.uuid).vhd"
                Write-Host "------------------------------"
            }
		}
	}
}

Dieser Beitrag hat 2 Kommentare

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

ERROR: si-captcha.php plugin: securimage.php not found.

An den Anfang scrollen