-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add notes running vmware simulator #532
base: master
Are you sure you want to change the base?
Conversation
Had tried to default the historical intervals via vmware/govmomi#3191 but wasn't able to get that working. |
Checked commit kbrock@98c2777 with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint |
I put in a fix for the editing for the file, but the reset remains |
@kbrock testing historical metrics collection is probably more "niche" compared with what the average developer would use this for? |
# creating simulator provider | ||
|
||
```bash | ||
echo "127.0.0.1 vc91" > /etc/hosts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? You can just use localhost
or 127.0.0.1
when adding the provider
(I know you were trying to avoid hostname collisions with >1 vcsim but that's also more advanced than the typical UI dev will need)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the end of the day, vc91 (even if in /etc/hosts
) was freaking out, so I just use localhost.
# run | ||
|
||
```bash | ||
# I dumped to a local directory to add historical capture support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try to make the doc less of a brain dump and more of a guide to others. I'm not sure what this is supposed to me as an outside reader.
@@ -0,0 +1,98 @@ | |||
# installing vmware simulator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need an introduction of some sort.
# installing vmware simulator | |
# VMware Simulator | |
This guide explains general usage of the VMware simulator, `vcsim`. This simulator can be used when developing the VMware provider. | |
## Installing VMware Simulator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note the title case change at the end too.
ln -s ~/go/bin/govc ~/bin # or /usr/local/bin | ||
``` | ||
|
||
# creating simulator provider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# creating simulator provider | |
## Generating data for a simulated provider |
kill %1 # or fg ; control-c | ||
``` | ||
|
||
# adding historicals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking this should be another level deep under the "Running a simulator"
# adding historicals | |
### Including historical metrics data |
# adding historicals | ||
|
||
```xml | ||
<!-- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<!-- | |
<!-- |
|
||
export GOVC_URL=https://root:vmware@vc91:9191/sdk GOVC_INSECURE=true | ||
govc object.save -d my-vcenter | ||
# stop stop temporary simulator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# stop stop temporary simulator | |
# stop temporary simulator |
</val> | ||
</propSet> | ||
``` | ||
# better editing of historicals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this title means - feels like this is part of the previous section, so thinking it should just be removed. The TODO also make it clear of the intentions.
# better editing of historicals |
``` | ||
# better editing of historicals | ||
|
||
TODO: please figure out a way to add historicals without editing the files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: please figure out a way to add historicals without editing the files. | |
TODO: Figure out a way to add historicals without editing the files. |
govc object.collect -s -dump PerformanceManager:PerfMgr perfCounter | ||
``` | ||
|
||
# run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# run | |
## Running the simulated provider from the generated data |
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 & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why run in the backround? Seems much simpler to leave it running in the foreground and let people ctrl-c to exit than telling them to do kill %1
later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's run in the background so it can be dumped to a directory in the next step. Then it can be reused in future runs of the simulator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made a few comments around this to beef up the comments/titles, which would make that clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right but that's only necessary so that you can hack in historical metrics, for normal vcsim running it isn't needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is all moot now. vcsim out of the box properly creates those entries
export GOVC_URL=https://root:vmware@vc91:9191/sdk GOVC_INSECURE=true | ||
govc object.save -d my-vcenter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export GOVC_URL=https://root:vmware@vc91:9191/sdk GOVC_INSECURE=true | |
govc object.save -d my-vcenter | |
# dump simulator contents to a directory for later reuse | |
export GOVC_URL=https://root:vmware@vc91:9191/sdk GOVC_INSECURE=true | |
govc object.save -d my-vcenter |
```xml | ||
<!-- | ||
edit my-vcenter/0009-PerformanceManager-PerfMgr.xml | ||
find nistoricalInterval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find nistoricalInterval | |
find historicalInterval |
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 & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not required, but I tend to find guides more readable if they are one param per line (at least for very long sets of options). It also allows easier modification for things like removing lines.
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 & | |
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 & |
ln -s ~/go/bin/vcsim ~/bin # or /usr/local/bin | ||
ln -s ~/go/bin/govc ~/bin # or /usr/local/bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personal preference, so not required for merge, but this format always messes with my head cause it makes me think the entire bin dir is going to be pointing to the target. I like it more explicit...something like:
ln -s ~/go/bin/vcsim ~/bin # or /usr/local/bin | |
ln -s ~/go/bin/govc ~/bin # or /usr/local/bin | |
ln -s ~/go/bin/vcsim ~/bin/vcsim # or /usr/local/bin/vcsim | |
ln -s ~/go/bin/govc ~/bin/govc # or /usr/local/bin/govc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make more sense to either change your GOPATH
or add ~/go/bin/
to your PATH
?
git clone https://github.com/kbrock/govmomi | ||
cd govmomi | ||
git remote add upstream https://github.com/vmware/govmomi | ||
git checkout miq_counters_kb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be linking a personal fork/branch in the guides? Is this a missing feature on upstream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed. we can now use master now that this is all merged
@Fryguy @kbrock high level I'm wondering if we're trying to show devs how to run a vmware simulator, or show them how to patch in @kbrock 's metrics fix? This all would be drastically simpler and I think cover 90% of the use cases if we just say |
Oh yeah I thought this was "how to use VMware simulator" with an added "and dump to a directory that can be reused". |
Actually now that you said that, I'm thinking this entire doc should probably be in the VMware repo in the Readme or in a docs dir, and then here maybe only a link to it from a "testing providers" doc or something. |
Oh yeah I saw that, but I read it as "leave the base one here and puts the metrics one over there", whereas I'm saying, "put the entire doc over there with the metrics too" |
|
WIP: |
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
1 similar comment
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
Here are notes on running the vmware simulator
not sure if we want this in the providers or developer_setup directory