Go to main content

手册页部分 8:系统管理命令

退出打印视图

更新时间: 2022年7月27日 星期三
 
 

virtinfo(8)

名称

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 命令支持以下选项:

–a

SPARC only: Execute with all flags.

–c

SPARC only: Report if a control domain.

–d

SPARC only: Report domain name.

–p

SPARC only: Parsable format.

–t

SPARC only: Report domain role.

–s

SPARC only: Report chassis serial number.

–u

SPARC only: Report UUID.

–c

Choose from available virtual environment classes: current, parent, supported, or unsupported.

Without the –c option, all classes are assumed.

子命令

virtinfo 命令支持以下子命令:

list [[–H] –o < field>[,...]] [<environment>] ...

Lists all virtual environments from chosen environment classes.通过列出感兴趣的环境可以限制列表内容。针对每个环境,将显示下列字段:

name(名称)

环境名

class

Environment class.It can be current, parent, supported, or unsupported.

–H

用于脚本模式。此选项不输出标头,通过单个制表符而非任意空格分隔各个字段。

–o field

显示逗号分隔的字段列表。

get [[–H] –o < field>[,...]] {all | <property>[,...]}
[<environment>] ...

检索环境属性。属性特定于环境和类。例如,支持 LDoms 的环境可以在 LDoms 当前环境中支持不同属性。通过列出感兴趣的环境可以限制要查询的环境列表。

针对每个属性,将显示下列字段:

name(名称)

环境名

class

环境类

property

属性名称

value

属性值

–H

用于脚本模式。此选项不输出标头,通过单个制表符而非任意空格分隔各个字段。

–o field

显示逗号分隔的字段列表。

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.

退出状态

将返回以下退出值:

0

成功完成。

>0

出现错误。

示例

示例 1 Viewing Default Information

以下示例显示缺省输出:

$ 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 Environment

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

属性类型
属性值
可用性
system/library/libv12n
接口稳定性
Uncommitted(未确定)

另请参见

libuuid(3LIB), libv12n(3LIB)