virtinfo - 虚拟环境信息
virtinfo [-acdptsu] virtinfo [-c {<class>[,...] | all}] [<subcommand>] list [[-H] -o <field>[,...]] [<environment>] ... get [[-H] -o <field>[,...]] {all | <property>[,...]} [<environment>] ...
virtinfo 实用程序提供了由 libv12n(3LIB) 返回的有关当前环境、父环境和支持环境列表的虚拟化信息。If no options are specified, virtinfo performs the equivalent of virtinfo list.
virtinfo 命令支持以下选项:
SPARC only: Execute with all flags.
SPARC only: Report if a control domain.
SPARC only: Report domain name.
SPARC only: Parsable format.
SPARC only: Report domain role.
SPARC only: Report chassis serial number.
SPARC only: Report UUID.
Choose from available virtual environment classes: current, parent, supported, or unsupported.
Without the –c option, all classes are assumed.
virtinfo 命令支持以下子命令:
Lists all virtual environments from chosen environment classes.通过列出感兴趣的环境可以限制列表内容。针对每个环境,将显示下列字段:
环境名
Environment class.It can be current, parent, supported, or unsupported.
用于脚本模式。此选项不输出标头,通过单个制表符而非任意空格分隔各个字段。
显示逗号分隔的字段列表。
检索环境属性。属性特定于环境和类。例如,支持 LDoms 的环境可以在 LDoms 当前环境中支持不同属性。通过列出感兴趣的环境可以限制要查询的环境列表。
针对每个属性,将显示下列字段:
环境名
环境类
属性名称
属性值
用于脚本模式。此选项不输出标头,通过单个制表符而非任意空格分隔各个字段。
显示逗号分隔的字段列表。
If the subcommand is used to print selected properties (i.e. all is not used), all possible combinations of chosen classes and virtual environments, and selected properties are assumed and virtinfo errors out on the first invalid combination it iterates through.No partial output consisting of remaining valid combinations of a class, virtual environment, and property is printed in such a situation.
将返回以下退出值:
成功完成。
出现错误。
以下示例显示缺省输出:
$ virtinfo NAME CLASS logical-domain current logical-domain parent non-global-zone supported kernel-zone supported logical-domain unsupported
当前域是 LDoms 来宾域。同时支持非全局区域和内核区域作为来宾。非控制逻辑域始终将 logical-domain 显示为父项。LDoms 来宾无法创建为来宾。
示例 2 Getting All Properties for all Classes and Virtual Environments from within a Kernel Zone Virtual EnvironmentBy providing all properties, the following example shows that the kernel-zone virtual environment is not supported from within Kernel Zones, and its status property provides the reason why not.It also shows that the solaris branded Zones are supported.As this example is run on bare metal x86 architecture, there is no parent class virtual environment.
$ virtinfo get all NAME CLASS PROPERTY VALUE kernel-zone current zonename bumblebee non-global-zone supported - - kernel-zone unsupported status not supported in kernel-zone示例 3 查看是否支持内核区域
以下示例说明如何检查当前环境是否可以支持内核区域:
$ virtinfo -c supported list kernel-zone NAME CLASS kernel-zone supported示例 4 查看可解析格式的所有 LDoms 属性
以下示例显示有关可解析格式中 LDoms 环境的所有可用信息:
$ virtinfo -c current get -H -o property,value all logical-domain control-role true io-role true root-role true service-role true domain-name primary uuid da64f9b8-3e37-688e-cc3f-e90a59db1ad control-name leftarrow chassis-serial-number 1228BDY5D4示例 5 Selecting a Property not Supported in Every Combination of a Class and Virtual Environment
The following example fails because the non-global-zone virtual environment in the supported class has no zonename property.As explained in the get subcommand section, if specific properties are queried, virtinfo errors out on the first invalid combination of a class, environment, and property.
$ virtinfo get zonename virtual environment 'non-global-zone' in class 'supported' does not support property: zonename
However, because the zonename property is supported for the kernel-zone environment in the current class if queried from within a Kernel Zone, we can narrow down the query.Note that you can always use get all to print only valid combinations of chosen classes and virtual environments with all available properties.
$ virtinfo -c current get zonename kernel-zone NAME CLASS PROPERTY VALUE kernel-zone current zonename kz1示例 6 From Within a Kernel Zone, Only Print the Current Virtual Environment zonename Property Value
This command prints the Kernel Zone name as used in the host.
$ virtinfo -c current get -H -o value zonename kernel-zone kz1
有关下列属性的说明,请参见 attributes(7):
|