A.6. VDSM Hook Domain XML 对象

在 hook 脚本启动后,_hook_domxml 变量会被加到环境中。这个变量包括了相关虚拟机的 libvirt domain XML 对象的路径。以下所列出的 hook 会例外。
以下 hook 的 _hook_domxml 变量包括了 NIC 的 XML 对象而不是虚拟机的 XML 对象。
  • *_nic_hotplug_*
  • *_nic_hotunplug_*
  • *_update_device
  • *_device_create
  • *_device_migrate_*

重要

before_migration_destinationbefore_dehibernation hook 当前接收原始主机上的 domain XML,而目标主机上的 domain XML 会有所不同。
VDSM 使用 libvirt domain XML 的格式来定义虚拟机。http://libvirt.org/formatdomain.html 提供了关于 libvirt domain XML 格式的详细信息。虚拟机的 UUID 可能可以从 domain XML 中获得,同时环境变量 vmId 也包括了它的值。