解决了

如何列出属于某些项目的虚拟服务器名称?

  • 2019年9月6日
  • 3回复
  • 1164观

徽章
  • jan
  • 航行员
  • 2回复
如何列出仅属于某些项目的棱镜中央服务器。例如,仅列出属于Project“默认”的VM。

“PowerState”表达名称是“PowerState”,但我应该用的是“项目”的相应名称,称为“项目”名称?

此脚本显示vmname和powerstate(runned for prism central):
get-ntnxvm |选择@ {表达式= {$ _。vmname}; label =“vmname”},@ {表达式= {$ _。鲍斯特泰特};标签=“PowerState”}
图标

最好的答案Timothygaray.2019年9月6日,20:39

\n
\nThese are all the properties that I see for a VM object:
\n
\n TypeName: Nutanix.Prism.DTO.Stats.VMDTO
\n
\nName MemberType Definition
\n---- ---------- ----------
\nEquals Method bool Equals(System.Object obj)
\nGetHashCode Method int GetHashCode()
\nGetType Method type GetType()
\nToString Method string ToString()
\nacropolisVm Property System.Nullable[bool] acropolisVm {get;set;}
\nalertSummary Property Nutanix.Prism.DTO.Alerts.AlertSummaryDTO alertSummary {get;set;}
\nclusterUuid Property string clusterUuid {get;set;}
\nconsistencyGroupName Property string consistencyGroupName {get;set;}
\ncontainerIds Property string[] containerIds {get;set;}
\ncontainerUuids Property string[] containerUuids {get;set;}
\ncontrolDomain Property System.Nullable[bool] controlDomain {get;set;}
\ncontrollerVm Property System.Nullable[bool] controllerVm {get;set;}
\ncpuReservedInHz Property System.Nullable[long] cpuReservedInHz {get;set;}
\ndescription Property string description {get;set;}
\ndiskCapacityInBytes Property System.Nullable[long] diskCapacityInBytes {get;set;}
\ndisplayable Property System.Nullable[bool] displayable {get;set;}
\nfingerPrintOnWrite Property string fingerPrintOnWrite {get;set;}
\ngpusInUse Property System.Nullable[bool] gpusInUse {get;set;}
\nguestOperatingSystem Property string guestOperatingSystem {get;set;}
\nhealthSummary Property Nutanix.Prism.DTO.Health.Check.HealthSummaryDTO healthSummary {get;set;}
\nhostId Property string hostId {get;set;}
\nhostName Property string hostName {get;set;}
\nhostUuid Property string hostUuid {get;set;}
\nhypervisorType Property string hypervisorType {get;set;}
\nipAddresses Property string[] ipAddresses {get;set;}
\nmemoryCapacityInBytes Property System.Nullable[long] memoryCapacityInBytes {get;set;}
\nmemoryReservedCapacityInBytes Property System.Nullable[long] memoryReservedCapacityInBytes {get;set;}
\nnonNdfsDetails Property string nonNdfsDetails {get;set;}
\nnumNetworkAdapters Property System.Nullable[long] numNetworkAdapters {get;set;}
\nnumVCpus Property System.Nullable[int] numVCpus {get;set;}
\nnutanixGuestTools Property Nutanix.Prism.DTO.Ngt.NutanixGuestToolsDTO nutanixGuestTools {get;set;}
\nnutanixVirtualDiskIds Property string[] nutanixVirtualDiskIds {get;set;}
\nnutanixVirtualDisks Property string[] nutanixVirtualDisks {get;set;}
\nnutanixVirtualDiskUuids Property string[] nutanixVirtualDiskUuids {get;set;}
\nonDiskDedup Property string onDiskDedup {get;set;}
\npowerState Property string powerState {get;set;}
\nprotectionDomainName Property string protectionDomainName {get;set;}
\nprotectionType Property string protectionType {get;set;}
\nrunningOnNdfs Property System.Nullable[bool] runningOnNdfs {get;set;}
\nstats Property System.Collections.Generic.Dictionary[string,string] stats {get;set;}
\nusageStats Property System.Collections.Generic.Dictionary[string,string] usageStats {get;set;}
\nuuid Property string uuid {get;set;}
\nvdiskFilePaths Property string[] vdiskFilePaths {get;set;}
\nvdiskNames Property string[] vdiskNames {get;set;}
\nvirtualNicIds Property string[] virtualNicIds {get;set;}
\nvirtualNicUuids Property string[] virtualNicUuids {get;set;}
\nvmId Property string vmId {get;set;}
\nvmName Property string vmName {get;set;}
\nvmType Property string vmType {get;set;}","className":"post__content__best_answer"}">
查看原版

3回复

徽章
我没有看到任何名为“项目”的物业。

$ VM = GET-NTNXVM < - 您的VM之一

$ VM |get-member < - 将列出所有可用的属性和方法。

或者

$ VM |选择* < - 将列出所有内容和值。


-Timg.
徽章
我不太熟悉命令。您可以将精确的脚本指向,显示项目名称。最好的问候,Jani
徽章
我没有看到项目名称的属性。我不认为有一个。

这些都是我为VM对象看到的属性:

typename:nutanix.prism.dto.stats.vmdto.

名称成员级定义
---- ---------- ----------
等于方法BOOL等于(System.Object obj)
gethashcode方法int gethashcode()
gettype方法类型gettype()
ToString方法字符串ToString()
acropolisvm属性system.nullable [bool] acropolisvm {get; set;}
AlertSummary属性Nutanix.prism.dto.Alerts.AlertSummaryDTo AlertSummary {GET; SET;}
clusteruuid属性字符串clusteruid {get; set;}
ConleanceCentGroupName属性String一致性GROUPNAME {GET; SET;}
ContainerIds属性String [] ContainIDS {GET; SET;}
containeruids属性字符串[] containeruuids {get; set;}
对手属性System.Nullable [Bool]对比{GET; SET;}
controllervm属性system.nullable [bool] controlyervm {get; set;}
CPUERERVEDINHZ Property System.Nullable [long] cpureservedinhz {get; set;}
描述属性字符串描述{get; set;}
diskcapacityinbytes属性system.nullable [long] diskcapacityinbytes {get; set;}
可显示的属性System.Nullable [Bool]可显示{GET; SET;}
fingerprintonwrite属性串指纹onwrite {get; set;}
Gpusinuse属性system.nullable [bool] gpusinuse {get; set;}
宾托运店ystem属性StruiteStemer {get; set;}
healthsummary property nutanix.prism.dto.Health.Check.HealthSummaryDTO HealthSummary {GET; SET;}
hostId属性字符串hostID {get; set;}
hostname属性字符串hostname {get; set;}
hostuuid属性字符串hostuuid {get; set;}
HyperVisorType属性字符串HyperVisorType {GET; SET;}
ipaddresses属性字符串[] ipaddresses {get; set;}
MemoryCapacityinBytes属性System.Nullable [long] memorycapacityinbytes {get; set;}
MemoryReservedCapacityInbytes属性System.Nullable [long] MemoryReservedCapacityInbytes {GET; SET;}
nonndfsdetails属性字符串nonndfsdetails {get; set;}
numnetworkapters属性system.nullable [long] numnetworkAdapters {get; set;}
numvcpus属性system.nullable [int] numvcpus {get; set;}
NutanixGuesttools属性Nutanix.prism.dto.ngt.nutanixguesttoolsdto nutanixguesttools {get; set;}
NutanixVirtualDiskIds属性String [] NutanixVirtualDiskIds {GET; SET;}
NutanixVirtualdisks属性String [] NutanixVirtualDisks {GET; SET;}
NutanixVirtualDiskuuIds属性String [] NutanixVirtualDiskuuIds {GET; SET;}
ondiskdedup属性字符串ondiskdedup {get; set;}
PowerState属性字符串PowerState {GET; SET;}
ProtectionDomainName属性字符串保护域{GET; SET;}
ProtectionType属性String ProtectionType {GET; SET;}
Houringonndfs属性system.nullable [bool] houringonndfs {get; set;}
stats属性system.collections.generic.dictionary [string,string] stats {get; set;}
UsageStats Property System.Collections.Generic.Dictionary [String,String] UsageStats {GET; SET;}
UUID属性字符串UUID {GET; SET;}
vdiskfilepaths属性字符串[] vdiskfilepaths {get; set;}
vdisknames属性字符串[] vdisknames {get; set;}
VirtualNicids属性字符串[] VirtualNicIDS {GET; SET;}
VirtualnicuuIds属性字符串[] VirtualNicuuIds {GET; SET;}
vmid属性字符串vmid {get; set;}
vmname属性字符串vmname {get; set;}
vmtype属性字符串vmtype {get; set;}

回复


Learn more about our cookies.<\/a>","cookiepolicy.button":"Accept cookies","cookiepolicy.button.deny":"Deny all","cookiepolicy.link":"Cookie settings","cookiepolicy.modal.title":"Cookie settings","cookiepolicy.modal.content":"We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.<\/a>","cookiepolicy.modal.level1":"Basic
Functional","cookiepolicy.modal.level2":"Normal
Functional + analytics","cookiepolicy.modal.level3":"Complete
Functional + analytics + social media + embedded videos"}}}">
Baidu