Skip to content

TritonDataCenter/sdc-vm-agent

Repository files navigation

sdc-vm-agent

This repository is part of the Triton Data Center project. See the contribution guidelines and general documentation at the main Triton project page.

The SDC VM agent is a library for keeping track of VM changes on Triton. There is one VM agent installed per Compute Node. VM changes trigger updates on VMAPI so data is persisted.

See the header of lib/vm-agent.js for more details on how vm-agent works.

Development

Typically sdc-vm-agent development is done by:

  • making edits to a clone of sdc-vm-agent.git on a Mac (likely Linux too, but that's untested) or a SmartOS development zone,

      git clone git@github.com:TritonDataCenter/sdc-vm-agent.git
      cd sdc-vm-agent
      git submodule update --init   # not necessary first time
      vi
    
  • building:

      make all
      make check
    
  • syncing changes to a running SDC (typically a COAL running locally in VMWare) via: ./tools/rsync-to coal

  • then testing changes in that SDC (e.g. COAL). See "Testing" below for running the test suite.

Testing

To run the vm-agent tests, run the following from the GZ on an SDC node (HN or CN) with vm-agent installed:

cd /opt/smartdc/agents/lib/node_modules/vm-agent
./runtests

The vm-agent SMF service log can be inspected while running the tests by calling:

tail -f `svcs -L vm-agent` | bunyan