重要的是,该Zone在启动之前处于适当的安装状态。
配置的Zone必须与操作环境一起安装。
也就是说,必须实例化Zone配置,并且必须将软件包安装在Zone的根路径下。
Zone状态应标记为已安装。
要检查Zone的当前状态,请运行带有子命令列表和 -cv 开关的 zoneadm 命令。
以下 zoneadm 输出确认 zone002 已安装。
# zoneadm list -cv ID NAME STATUS PATH BRAND IP 0 global running / native shared - zone002 installed /zones/zone002 native shared
如果尚未安装该Zone,则状态将指示为已配置。
# zoneadm list -cv ID NAME STATUS PATH BRAND IP 0 global running / native shared - zone002 configured /zones/zone002 native shared
在这种情况下,Zone或者被分离,或者必须通过运行 zoneadm -z install 命令来安装。
要检查Zone是否处于分离状态,请检查 zonepath 的内容。
如果找到目录 dev 和 root 以及 SUNWdetached.xml,则可以尝试将Zone添加到系统
# ls -l /zones/zone002 total 12 drwxr-xr-x 12 root sys 50 Aug 18 14:40 dev drwxr-xr-x 2 root root 2 Nov 4 2014 lu drwxr-xr-x 19 root root 21 Aug 14 15:30 root -rw-r--r-- 1 root root 4511578 Aug 18 14:41 SUNWdetached.xml
# zoneadm -z zone002 attach -U Getting the list of files to remove Removing 4 files Remove 9 of 9 packages Installing 6103 files Add 10 of 10 packages Updating editable files
Zone内的文件 /var/sadm/system/logs/update_log 包含Zone更新的日志。
如果 zonepath 为空,则需要使用 zoneadm -z [zone_name] install 安装该Zone
例子:
# zoneadm -z zone002 install Preparing to install zone . Creating list of files to copy from the global zone. Copying [2552] files to the zone. Initializing zone product registry. Determining zone package initialization order. Preparing to initialize [1026] packages on the zone. Initialized [1026] packages on zone. Zone is initialized. The file contains a log of the zone installation.
安装Zone后, zoneadm list -cv 输出将指示该Zone已安装。
日期:2020-09-17 00:15:15 来源:oir作者:oir