简体   繁体   中英

AWS powershell: Get-EC2InstanceType

I want to extract the bare metal instances with cpu Information via AWS PowerShell:

Get-EC2InstanceType -Filter @{'name'='bare-metal';'values'='true' }

Following answers are delivered:

AutoRecoverySupported         : False
BareMetal                     : True
BurstablePerformanceSupported : False
CurrentGeneration             : True
DedicatedHostsSupported       : True
EbsInfo                       : Amazon.EC2.Model.EbsInfo
FpgaInfo                      :
FreeTierEligible              : False
GpuInfo                       :
HibernationSupported          : False
Hypervisor                    :
InferenceAcceleratorInfo      :
InstanceStorageInfo           : Amazon.EC2.Model.InstanceStorageInfo
InstanceStorageSupported      : True
InstanceType                  : z1d.metal
MemoryInfo                    : Amazon.EC2.Model.MemoryInfo
NetworkInfo                   : Amazon.EC2.Model.NetworkInfo
PlacementGroupInfo            : Amazon.EC2.Model.PlacementGroupInfo
ProcessorInfo                 : Amazon.EC2.Model.ProcessorInfo
SupportedRootDeviceTypes      : {ebs}
SupportedUsageClasses         : {on-demand, spot}
SupportedVirtualizationTypes  : {hvm}
VCpuInfo                      : Amazon.EC2.Model.VCpuInfo

The AWS PowerShell guide didn't explain how you receive Information for Amazon.EC2.Model.ProcessorInfo Someone a tip for that?

BR Timo

Amazon.EC2.Model.ProcessorInfo has two properties: SupportedArchitectures and SustainedClockSpeedInGhz.

Docs are here: https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/EC2/TProcessorInfo.html

You can access the properties with something like this:

PS$ $e = Get-EC2InstanceType
PS$ $e[0].ProcessorInfo

SupportedArchitectures SustainedClockSpeedInGhz
---------------------- ------------------------
{x86_64}               3.1

PS$ $e[0].ProcessorInfo.SustainedClockSpeedInGhz                                                                                    

3.1

At this point you could use all sorts of Powershell techniques to get this info in the form you want. So maybe something like this:

PS$ Get-EC2InstanceType -Filter @{'name'='bare-metal';'values'='true' } | Select-Object -Property InstanceType, @{Name="SupportedArchitectures"; Expression={$_.ProcessorInfo.SupportedArchitectures}}

InstanceType SupportedArchitectures
------------ ----------------------
m6g.metal    arm64
m5.metal     x86_64
m5d.metal    x86_64
m6gd.metal   arm64
g4dn.metal   x86_64
c6gd.metal   arm64
a1.metal     arm64
c5.metal     x86_64
c5n.metal    x86_64
r6gd.metal   arm64
r5.metal     x86_64
z1d.metal    x86_64
r6g.metal    arm64
i3.metal     x86_64
r5d.metal    x86_64
c6g.metal    arm64
c5d.metal    x86_64
i3en.metal   x86_64

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM