Skip to content
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

Please allow run-time configuration of :vsphere_debug #124

Open
Zugschlus opened this issue Mar 2, 2018 · 2 comments
Open

Please allow run-time configuration of :vsphere_debug #124

Zugschlus opened this issue Mar 2, 2018 · 2 comments

Comments

@Zugschlus
Copy link

Hi,

recently, the result of a "create VM" operation in The Foreman has changed, which has resulted in a The Foreman forum entry.

Finding out whether it was foreman changing things or the Vsphere world has suddenly changed its behavior would be tremendously easier if there were a possbility to intercept the API request that gets sent to Vsphere, to find whether Foreman via fog via fog-vsphere actually requests a Paravirtual or an LSILogic SCSI controller or issues an invalid requests which might cause Vsphere to fall back to a default which might happen to be LSILogic.

Obtaining those logs from inside Vsphere seems to be next to impossible. I had the VMware experts at a customer site showing me a support rejection from VMware support since The Foreman is not a VMware certified application allowed to access the Vsphere API and VMware only supports certified applications talking to their sacred API.

So it would be really good to have a possibility to beef up fog-vsphere's logging to see what actually gets sent to Vsphere. Thanks for considering this.

Greetings
Marc

@timogoebel
Copy link
Member

@Zugschlus: Sorry for the long turnaround here.
It's possible to activate a debug mode in rbvmomi (the library used for connections with vsphere) through fog-vsphere:

client = ::Fog::Compute.new(
  :provider                     => 'vsphere',
  :vsphere_username             => '',
  :vsphere_password             => '',
  :vsphere_server               => '',
  :vsphere_expected_pubkey_hash => '',
  :vsphere_debug => true
)

This prints debug info to STDERR. In Foreman's case you should see the logs in the apache error log I think.
You can add that line in Foreman's codebase here.

I hope, this helps.

@Zugschlus
Copy link
Author

Hi Timo, thanks for the hint. It was a bit too late though, I used a socat - tcpdump - socat chain to snoop on foreman talking to the vCenter and was actually able to identify the issue with the obtained data.
Next time, I'm going to try this approach.
The current issue now mutates into the request for a possibility to set :vsphere_debug in some run-time configuration file so that it is not necessary to peddle around in Foreman's code.

@Zugschlus Zugschlus changed the title Please allow optional logging of requests sent to Vsphere to aid debugging Please allow run-time configuration of :vsphere_debug Mar 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants