Highlighted
Contributor
Contributor

How to get VM Guest/Config ConfiguredGuestId and RuntimeGuestId by using get-view?

Jump to solution

Hello,

I would like to retrieve the VM Guest properties ConfiguredGuestId and RuntimeGuestId by using get-view and not get-vm.

How do I do that?

I cannot find it in VMware.Vim.GuestInfo, VMware.Vim.VirtualMachineGuestSummary, VMware.Vim.VirtualMachineConfigSummary or VMware.Vim.VirtualMachineConfigInfo.

Also i cannot find this in the API Documentation.

Thanks a lot in advance!

Perhaps mattboren​ or LucD​ can solve my problem ;-)?

Regards,

René

1 Solution

Accepted Solutions
Highlighted
User Moderator
User Moderator

Do you mean like this?

Get-View -ViewType VirtualMachine |
Select Name,
    @{N='ConfiguredGuestId';E={$_.Config.GuestId}},
    @{N='RuntimeGuestId';E={$_.Guest.GuestId}}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

4 Replies
Highlighted
User Moderator
User Moderator

Do you mean like this?

Get-View -ViewType VirtualMachine |
Select Name,
    @{N='ConfiguredGuestId';E={$_.Config.GuestId}},
    @{N='RuntimeGuestId';E={$_.Guest.GuestId}}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Highlighted
Contributor
Contributor

ucD

Not directly, see example below:

Get-VM example:

Get-VM -ErrorAction Stop | Select-Object Name, GuestId,

@{ Name        = "ConfiguredGuestId"

    Expression = {

        $_.Guest.ConfiguredGuestId

    }

}, @{Name      = "RuntimeGuestId"

    Expression = {

        $_.Guest.RuntimeGuestId

    }

}

pastedImage_0.png

I need to verify the GuestId and ConfiguredGuestId are the same AND if the RuntimeGuestId (VMTools detection) differs too much (InPlace Upgrade/OS Upgrade etc.) that i can adjust the GuestId/ConfiguredGuestId.

We have a large amount of data, and i query mostly with Get-View (also using UpdateViewData method) instead of Get-VM because it is a lot faster.

I cannot find these properties using Get-View for now. (If you need my complete Get-View code, please let me know (But this code only covers all other properties))

0 Kudos
Highlighted
User Moderator
User Moderator

Not sure what you mean.
I just produced those values via Get-View in that snippet.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Highlighted
Contributor
Contributor

Ouch... i have totally missed the different properties in Guest and Config for GuestId!

Thanks! Of course you are absolutely right!

0 Kudos