故障排除 vSphere Auto Deploy
search cancel

故障排除 vSphere Auto Deploy

book

Article ID: 301425

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

Symptoms:
免责声明:本文为 Troubleshooting vSphere Auto Deploy (2000988) 的翻译版本。尽管我们会不断努力为本文提供最佳翻译版本,但本地化的内容可能会过时。有关最新内容,请参见英文版本。


本文提供了与 VMware Auto Deploy 5.x 相关的故障排除指南。本文不适用于 vSphere 6.0。

Auto Deploy 是 vSphere 5.0 的一项新功能,可用于快速置备和配置 ESXi 主机。

注意:有关详细信息,请参见 vSphere Installation and Setup Guide。该指南包含最权威的信息。如果该指南与本文有出入,请以该指南为准。

Environment

VMware vCenter Server 5.0.x
VMware vSphere ESXi 5.1
VMware vSphere ESXi 5.0
VMware vCenter Server 5.5.x
VMware vCenter Server 5.1.x
VMware vSphere ESXi 5.5

Resolution

可以在独立的 Windows 计算机上安装 VMware Auto Deploy。VMware Auto Deploy 同时随 VMware vCenter Appliance 一起提供。


重要的文件和位置

注意:默认情况下,其中一些路径可能处于隐藏状态。

元素位置
Auto Deploy 服务器的默认安装路径
  • 32 位:C:\Program Files (x86)\VMware\VMware vSphere Auto Deploy
  • 64 位:C:\Program Files (x86)\VMware\VMware vSphere Auto Deploy
Auto Deploy 服务器的配置文件
  • 32 位:C:\Documents and Settings\All Users\Application Data\VMware\VMware vSphere Auto Deploy
  • 64 位:C:\ProgramData\VMware\VMware vSphere Auto Deploy
vCenter Server Appliance 的配置文件
  • 配置文件:/etc/vmware-rbd
  • 运行时状态文件:/var/lib/rbd
Auto Deploy 服务器的数据库文件
  • 32 位:C:\Documents and Settings\All Users\Application Data\VMware\VMware vSphere Auto Deploy\Data\db*
  • 64 位:C:\ProgramData\VMware\VMware vSphere Auto Deploy\Data\db*
vCenter Server Appliance 的数据库文件
  • /var/lib/rbd/db*
Auto Deploy 服务器的缓存
  • C:\Users\All Users\VMware\VMware vSphere Auto Deploy
  • 32 位:C:\Documents and Settings\All Users\Application Data\VMware\VMware vSphere Auto Deploy\Data\cache\
  • 64 位:C:\ProgramData\VMware\VMware vSphere Auto Deploy\Data\cache\
vCenter Server Appliance 的缓存
  • /var/lib/rbd/cache
Auto Deploy 服务器的主要配置文件
  • 32 位:C:\Documents and Settings\All Users\Application Data\VMware\VMware vSphere Auto Deploy\vmconfig-autodeploy.xml
  • 64 位:C:\ProgramData\VMware\VMware vSphere Auto Deploy\vmconfig-autodeploy.xml


日志记录

获取日志文件

要通过 vCenter Server 获取日志文件,请执行以下操作:
  1. 使用 vSphere Client 登录到 vCenter Server。
  2. 依次单击主页 > Auto Deploy > 下载 AutoDeploy 日志文件
要手动获取 Auto Deploy 服务器的日志文件,请转至:

%configuration file location%\Logs

要手动获取 vCenter Server Appliance 的日志文件,请转至以下其中一个位置:
  • /var/log/vmware/rbd
  • /etc/vmware-rbd/httpd/logs
注意:vCenter Server 日志不包括 Auto Deploy 日志,但必须按如上所述单独收集。


增加日志文件大小和轮换

要增加日志文件大小和轮换,请执行以下操作:

  1. 使用文本编辑器打开 logging.conf 文件。该文件位于:

    • 32 位 Windows:

      C:\Documents and Settings\All Users\Application Data\VMware\VMware vSphere Auto Deploy\logging.conf

    • 64 位 Windows:

      C:\ProgramData\VMware\VMware vSphere Auto Deploy\logging.conf

    • vCenter Server Appliance:

      /etc/vmware-rbd/logging.conf

  2. size 值更改为 1000000,并将 backupCount 值更改为 5。例如:

    [autodeploy]
    size=1000000
    backupCount=5


  3. 保存并关闭该文件。
  4. 重新启动 Auto Deploy 服务。


常见任务

编辑 Auto Deploy 服务配置

要编辑 Auto Deploy 服务配置,请执行以下操作:

  1. 使用文本编辑器打开主要 Auto Deploy 配置文件。该文件位于:

    • 32 位 Windows:

      C:\Documents and Settings\All Users\Application Data\VMware\VMware vSphere Auto Deploy\vmconfig-autodeploy.xml

    • 64 位 Windows:

      C:\ProgramData\VMware\VMware vSphere Auto Deploy\vmconfig-autodeploy.xml

    • vCenter Server Appliance:

      /etc/vmware-rbd/autodeploy-setup.xml

  2. 调整以下参数:

    • <serviceAddress>IP_address</serviceAddress>

      其中 IP_address 表示 Auto Deploy IP 地址。

    • <defaultValues>
      <port>port_number</port>
      <maxSize>max_cache_size</maxSize>
      </defaultValues>


      其中 port_number 表示 Auto Deploy 端口,以及 max_cache_size 表示最大缓存大小以 GB 为单位。

    • <vCenterServer>
      IP_address

      <port>port_number</port>
      <user>username</user>
      </vCenterServer>


      其中 IP_address 表示 vCenter Server IP 地址,port_number 表示 vCenter Server 端口,以及 username 表示 vCenter Server 用户名称。

  3. 保存并关闭该文件。
  4. 重新启动 Auto Deploy 服务。
注意
  • 此信息同时会存储在位于以下位置的 Auto Deploy 服务器上的 vCenter Server 注册表中:

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\VMware, Inc.\VMware vSphere Auto Deploy

  • 在对注册表进行任何修改之前,请确保对注册表和虚拟机进行了最新有效的备份。有关备份和还原注册表的详细信息,请参阅 Microsoft 文章 136393

重新注册 Auto Deploy 服务

向 vCenter Server 中重新注册 Auto Deploy 服务时,可能需要在 vCenter Server 上重新建立 Auto Deploy 规则。如果 vCenter Server 或 Auto Deploy IP 地址发生更改、Auto Deploy 服务无法启动,或者 SSL 证书发生更改,也必须重新注册 Auto Deploy 服务。

对于 Windows 和 vCenter Server Appliance,Auto Deploy 注册命令均使用相同的语法和交换机。
  • 在以下位置运行命令:

    • 在 Windows 中:

      C:\Program Files (x86)\VMware\VMware vSphere Auto Deploy\autodeploy-register.exe

    • 在 Windows 2012 中:

      C:\Program Files (x86)\VMware\vCenter Server\autodeploy\autodeploy-register.exe

    • 在 vCenter Server Appliance 中:

      /usr/bin/autodeploy-register

  • 要取消注册 Auto Deploy 服务,请运行以下命令:

    autodeploy-register -U -a x.x.x.x -u root -w vmware -p 80

    其中 x.x.x.x 表示 vCenter Server IP 地址,-u root 表示用户,以及 -w vmware 表示密码。

  • 要注册 Auto Deploy 服务,请运行以下命令:

    在 Windows 中:

    autodeploy-register -R -a x.x.x.x -u root -w vmware -p 80 -s "C:\ProgramData\VMware\VMware vSphere Auto Deploy\vmconfig-autodeploy.xml"

    在 vCenter Server Appliance 中:

    autodeploy-register -R -a x.x.x.x -u root -w vmware -p 80 -s /etc/vmware-rbd/autodeploy-setup.xml

    其中 x.x.x.x 表示 vCenter Server IP 地址,-u root 表示用户,以及 -w vmware 表示密码。

  • 如果 SSL 证书发生更改,请使用以下命令注册 Auto Deploy 服务:

    注意:当前,此命令对于 vCenter Server 5.1 无效。有关详细信息,请参见 vSphere Auto Deploy service fails after a change to vCenter Server SSL Certificates with the error: Server has wrong SHA1 thumbprint (2063528)

    在 Windows 中:

    autodeploy-register.exe -R -a vCenterServerFQDN -u vCenterAdminUsername -w password -s "C:\ProgramData\VMware\VMware vSphere Auto Deploy\vmconfig-autodeploy.xml" -f -T new_vCenter_Server_SSL_Cert_Thumbprint

    在 vCenter Server Appliance 中:

    autodeploy-register -R -a vCenterServerFQDN -u root -w password -s "/etc/vmware-rbd/autodeploy-setup.xml" -f -T new_vCenter_Server_SSL_Cert_Thumbprint


故障排除

要确定关于注册的 Auto Deploy ESXi 主机的信息,请执行以下操作:

  1. 使用 Web 浏览器访问此 URL:

    https://x.x.x.x:port_number/vmw/rbd/host/

    其中:
    • x.x.x.x 表示 Auto Deploy 服务器 IP 地址
    • port_number 表示 Auto Deploy 端口(默认端口为 6501)

  2. 单击每个哈希链接。每个哈希代表一个已在其中注册 Auto Deploy 服务的 ESXi 主机。该页面会显示 ESXi 主机的相关信息,其中包括用于引导的 DHCP/TFTP、服务器型号以及 MAC 地址。

    例如:

    Host List:

    5dc289181e9eecc49590d01fa32b0f42


    • hostname=
    • ipv4=xxx.xxx.x.xxx
    • mac=xx:xx:xx:xx:xx:xx
    • uuid=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    • vendor=VMware,Inc

  3. 同时存在两个链接 boot.cfg get boot.cfg

    • 单击 boot.cfg 链接(或 Get gPXE Configuration 链接)可查看将使用的主机和配置文件的相关信息。

      例如:

      #!gpxe

      echo
      echo
      echo ******************************************************************
      echo * Booting through VMware Auto Deploy...
      echo *
      echo * Machine attributes:
      echo * . asset=No Asset Tag
      echo * . domain=
      echo * . hostname=
      echo * . ipv4=xxx.xxx.x.xxx
      echo * . mac=xx:xx:xx:xx:xx:xx
      echo * . model=VMware Virtual Platform
      echo * . oemstring=[MS_VM_CERT/SHA1/27d66596a61c48dd3dc7216fd715126e33f59ae7]
      echo * . oemstring=Welcome to the Virtual Machine
      echo * . serial=VMware-
      xx xx xx xx xx xx xx xx-xx xx xx xx xx xx xx xx
      echo * . uuid=
      xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
      echo * . vendor=VMware, Inc.
      echo *
      echo * Host Profile: hostprofile-1
      echo * Image Profile: ip-VMware, Inc.-test1-d5107713e36092ff920705dbf627a092
      echo * VC Host: host-14
      echo *
      echo * Bootloader VIB version: 5.0.0-1.2.381531

      echo ******************************************************************


    • 单击 Get boot.cfg 链接可查看将用于引导服务器的缓存文件的相关信息。

      例如:

      bootstate=0
      title=Loading VMware ESXi
      kernel=/vmw/cache/a3/36c0980af7357f5d515242e6458be5/tboot.aaef3f985d1dfc669c9490939c82e36f
      kernelopt=BOOTIF=01-00-0c-29-4c-8c-29
      modules=/vmw/cache/72/1776e38e761db08fff0db5edec43af/b.e174d89c00afa21ae697977203c2b9ce --- /vmw/cache/72/1776e38e761db08fff0db5edec43af/useropts.e174d89c00afa21ae697977203c2b9ce --- /vmw/cache/72/1776e38e761db08fff0db5edec43af/k.e174d89c00afa21ae697977203c2b9ce --- /vmw/cache/a3/36c0980af7357f5d515242e6458be5/a.aaef3f985d1dfc669c9490939c82e36f --- /vmw/cache/ff/eae6feb2e63579c776a6041b3de0da/ata-pata.5fa67d0ce923ca8647a45c431c385879


数据库损坏

vSphere Auto Deploy 可利用数据库存储主机的相关信息。因此,Auto Deploy 数据库可能需要维护。SQLite 是一个用于执行以下活动的首选工具。默认情况下,SQLite 仅随 vCenter Server Appliance 一起提供。但是,SQLite Shell 是一款免费的应用程序,可以与 Windows 结合使用,可从 http://sqlite.org/download.html 中获取。

  • 要连接到 Auto Deploy 数据库,请运行以下命令:

    sqlite3 "C:\Users\All Users\VMware\VMware vSphere Auto Deploy\Data\db"

  • 要确认已连接到 Auto Deploy 数据库,请运行以下命令:

    sqlite> .databases

  • 要执行整个数据库的完整性检查,请运行以下命令:

    sqlite> PRAGMA integrity_check;

    如果该数据库完好无损,则此命令的输出为 OK

  • 要重新声明数据库中的空间为空或可用,请运行以下命令:

    sqlite> VACUUM;

  • 要从暂存中删除和重新创建索引(可能会提高性能),请运行以下命令:

    sqlite> REINDEX;

验证 Auto Deploy 配置文件和规则集

为进行故障排除,必须确定当前应用了哪些规则,以及确定特定主机是否满足此合规性。这些命令可以与 vSphere 5.0 PowerCLI 和 ImageBuilder 管理单元结合使用。

要确定当前部署的规则,请运行以下命令:
  • get-deployruleset

    该输出会显示可与 Auto Deploy 结合使用的活动规则集。活动规则集是与这些规则匹配的映像/主机配置文件和模式的集合(例如,Mac 地址、供应商、IP 地址范围)。

  • test-deployrulesetcompliance ESXhostname

    该输出会显示应用于主机的当前配置文件和预期的配置文件的列表。这对于确定主机是否为最新主机很有用。


gPXE 故障排除

在初始引导过程中,ESXi 主机尝试通过 DHCP 使用 PXE 获取 IP 地址。假设万一服务器无法加载 PXE 引导映像,还可以通过按 Ctrl+B 引导进入 gPXE shell。以下命令对于故障排除 PXE 网络配置问题非常有用。
  • 要尝试获取 DHCP 地址,请运行以下命令之一:

    • dhcp net0(然后可以 ping 该计算机)

    • config net0

    • set net0/ip x.x.x.x
      set net0/netmask x.x.x.x
      set net0/gateway x.x.x.x
      set net0/dns x.x.x.x


  • 要确认路由信息,请运行以下命令:

    route

  • 要确认已加载 PXE 映像,请运行以下命令:

    imgstat

    注意:默认 PXE 映像为 vmw-hardwired

  • 要确认 TFTP 连接,请运行以下命令:

    imgfetch tftp://x.x.x.x/tramp


Additional Information

Troubleshooting vSphere Auto Deploy