esdc-ce icon indicating copy to clipboard operation
esdc-ce copied to clipboard

Watch for vminfo events on a node

Open YanChii opened this issue 5 years ago • 0 comments

Recent development in SmartOS introduced vminfod facility. It watches all changes regarding a VM and is able to trigger events the very simillar way to the sysevent.

Example command:

vminfo events -jfr

It produces json output with full event info, including the new VM json config.

What can be caught by vminfo event:

  • VM config changes made by vmadm, e.g. RAM change, CPU, disk, (it always sends the new VM json in the event)
  • metadata variables change, including the changes pushed by mdata-put inside a VM
  • ZFS filesystem direct changes (refreservation, fs properties, etc)
  • VM status changes

Implementation: The implementation looks relatively easy. Fast daemon can create another thread the same way as the sysevent thread. It can filter relevant messages and send them to the mgmt worker. The mgmt worker can then trigger updates to database and/or to SIO.

Main motivation: To have consistent metadata set from inside a VM. For start, it is quite sufficient to process only metadata change updates.

J.

YanChii avatar May 07 '19 16:05 YanChii