Skip to content

Get-VvolUuidFromVmdk modification to return vVol UUid column name #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jasemccarty opened this issue Feb 2, 2021 · 0 comments
Open

Comments

@jasemccarty
Copy link

This function only returns the raw vVol UUID.

Example:

Get-VM -Name "VMNAME" | Get-HardDisk | Get-VvolUuidFromVmdk
rfc4122.64aa931f-77ef-4a6f-be66-c2ba421f3f20
rfc4122.7e40ca4d-ce3f-46f2-9da5-ff4bed469c23
rfc4122.71788eb4-5b02-43b1-8b91-4cb02316f408
rfc4122.833565c0-b7c8-429d-b266-456ffcfb3b22

Suggest creating a new PS Custom Object instead of directly adding to the variable $allUuids

Replace line 280
$allUuids += $vmdkDisk.ExtensionData.Backing.backingObjectId

with

          $item = [PSCustomObject]@{
              VvolUuid = $vmdkDisk.ExtensionData.Backing.backingObjectId
          }

          $allUuids += $item

Which would return:

Get-VM -Name "VMNAME" | Get-HardDisk | Get-VvolUuidFromVmdk
VvolUuid
--------
rfc4122.64aa931f-77ef-4a6f-be66-c2ba421f3f20
rfc4122.7e40ca4d-ce3f-46f2-9da5-ff4bed469c23
rfc4122.71788eb4-5b02-43b1-8b91-4cb02316f408
rfc4122.833565c0-b7c8-429d-b266-456ffcfb3b22

The output could then be passed to other cmdlets (possibly Get-PfaVolumeNameFromVvolUuid)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant