From 98c2777c0baa43be348a22e3ad8a1fa44689e32e Mon Sep 17 00:00:00 2001 From: Keenan Brock Date: Mon, 27 Nov 2023 17:35:02 -0500 Subject: [PATCH] vmware_simulator --- providers/vmware_simulator.md | 98 +++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 providers/vmware_simulator.md diff --git a/providers/vmware_simulator.md b/providers/vmware_simulator.md new file mode 100644 index 00000000..a4fdf68b --- /dev/null +++ b/providers/vmware_simulator.md @@ -0,0 +1,98 @@ +# installing vmware simulator + +```bash +cd ~/go/ +git clone https://github.com/kbrock/govmomi +cd govmomi +git remote add upstream https://github.com/vmware/govmomi +git checkout miq_counters_kb +# client +pushd govc ; make clean && make && make install ; popd +# server +pushd vcsim ; make clean && make && make install ; popd +ln -s ~/go/bin/vcsim ~/bin # or /usr/local/bin +ln -s ~/go/bin/govc ~/bin # or /usr/local/bin +``` + +# creating simulator provider + +```bash +echo "127.0.0.1 vc91" > /etc/hosts + +# run temporary simulator +vcsim -username root -password vmware -app 2 -cluster 2 -dc 1 -ds 2 -folder 2 \ + -host 2 -nsx 2 -pg 2 -pg-nsx 2 -pod 2 -pool 1 -standalone-host 2 -vm 2 \ + -l vc91:9191 & + +export GOVC_URL=https://root:vmware@vc91:9191/sdk GOVC_INSECURE=true +govc object.save -d my-vcenter +# stop stop temporary simulator +kill %1 # or fg ; control-c +``` + +# adding historicals + +```xml + + + historicalInterval + + + 1, + 300 + 86400 + Past Day + 1 + true + + + 2 + 1800 + 604800 + Past Week + 1 + true + + + 3 + 7200 + 2592000 + Past Month + 1 + true + + + 4 + 86400 + 31536000 + Past Year + 1 + true + + + +``` +# better editing of historicals + +TODO: please figure out a way to add historicals without editing the files. +That way we can just use the vmware simulator container + +```bash + govc object.collect -s -dump PerformanceManager:PerfMgr historicalInterval + govc metric.interval.info + + govc metric.interval.change + + # this one has a default (not sure if related or not) + govc object.collect -s -dump PerformanceManager:PerfMgr perfCounter +``` + +# run + +```bash +# I dumped to a local directory to add historical capture support +vcsim -username root -password vmware -load my-vcenter -l vc91:9191 +```