Any luck with this. Please assist.
Original Message:
Sent: Aug 06, 2024 05:32 PM
From: ganapa2000
Subject: how to get the VM Name in the below script
Hi LucD,
I tried as you mentioned but it is showing blank.
Get-CnsVolume | select @{N='VM_Name';E={$_.Metadata.EntityMetadata}}, Name, @{N='CapacityGB';E={[math]::round($_.CapacityMB/1024)}}, Datastore, @{N='EntityType';E={$_.Metadata.CnsEntityMetadata.EntityType}}, @{N='KubernetesClusterId';E={$_.Metadata.CnsEntityMetadata.KubernetesClusterId}}, @{N='Namespace';E={$_.Metadata.CnsEntityMetadata.Namespace}}, @{N='Label';E={$_.Metadata.CnsEntityMetadata.Label}}, @{N='Path';E={$_.ExtensionData.backingobjectdetails.BackingDiskPath}} | ft -auto
the same I can see through vCenter, but I need that VM Name in the CLI
Original Message:
Sent: Aug 06, 2024 02:59 PM
From: LucD
Subject: how to get the VM Name in the below script
To map the PVC to a VM, query the Kubernetes API, or use the kubectl command.
If the VM is directly related to the PVC the $_.Metadata.EntityMetadata.The entityName property will give you the VM's name.
But it depends on your setup.
------------------------------
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Original Message:
Sent: Aug 05, 2024 05:52 PM
From: ganapa2000
Subject: how to get the VM Name in the below script
Hi,
Please help me, how to get the VM Name in the below script, since we have started using containers, I would like to know, which volumes are mapped to VM.
Please help
Get-CnsVolume | select Name, @{N='CapacityGB';E={[math]::round($_.CapacityMB/1024)}}, Datastore, @{N='EntityType';E={$_.Metadata.CnsEntityMetadata.EntityType}}, @{N='KubernetesClusterId';E={$_.Metadata.CnsEntityMetadata.KubernetesClusterId}}, @{N='Namespace';E={$_.Metadata.CnsEntityMetadata.Namespace}}, @{N='Label';E={$_.Metadata.CnsEntityMetadata.Label}}, @{N='Path';E={$_.ExtensionData.backingobjectdetails.BackingDiskPath}} | ft -auto