VMware Cloud Community
Mordecai1
Contributor
Contributor
Jump to solution

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

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
LucD
Leadership
Leadership
Jump to solution

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
LucD
Leadership
Leadership
Jump to solution

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

Mordecai1
Contributor
Contributor
Jump to solution

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))

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Mordecai1
Contributor
Contributor
Jump to solution

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

Thanks! Of course you are absolutely right!

Reply
0 Kudos