VMware Cloud Community
rocndn
Contributor
Contributor
Jump to solution

[PowerCLI 4.1] Strange SOAP dump in console as DEBUG.

Hi all,

I have got an ESXi host with several machines. I am using a PowerShell\PowerCLI 4.1 script that is operating with VM's (power-up, revert to snapshot) and executing on them some operations.

My problem is that after I connect to the VICenter (by Connect-VIServer cmdlet)  I receive a very strange output to my console.

This output is an SOAP request (in form of an XML) which is logged in DEBUG mode to the console and showed in yellow color. Two examples of such dump are presented at the end of this post (Example 1, Example 2). Those SOAP XML's differ in size, they can be a 40-lines long and also 2000 lines long.

Their content is strage for me, seems to be the configuration parameters. For instance, the first example of SOAP includes all machines from the ESXi host presented as <returnval> tags in the SOAP envelope body.

The problem is that those dumps in the console do not origins from my script, they seems to be from another thread (ESXi host?), because they just break into the pure script output messages in console.

For me it looks like some configuration issue, I think that the ESXi host give such strange DEBUG output to each client which will connect to him, in my case this client is my script.

Can someone confirm if I am right and how to solve the problem? I would like to avoid those SOAP dumps because of that my console log is very very large and unreadable.

Thank you for help.

Example 1

-----SoapRequest at 10/30/2012 11:03:57 AM
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
  <RetrievePropertiesResponse xmlns="urn:vim25">
   <returnval>
    <obj type="VirtualMachine">vm-2065</obj>
    <propSet>
     <name>config.template</name>
     <val xsi:type="xsd:boolean">false</val>
    </propSet>
    <propSet>
     <name>name</name>
     <val xsi:type="xsd:string">MachineName</val>
    </propSet>
    <propSet>
     <name>parent</name>
     <val type="Folder" xsi:type="ManagedObjectReference">group-v44</val>
    </propSet>
    <propSet>
     <name>runtime.host</name>
     <val type="HostSystem" xsi:type="ManagedObjectReference">host-55</val>
    </propSet>
   </returnval>

.

.

.

   </RetrievePropertiesResponse>
</soapenv:Body>
</soapenv:Envelope>

Example 2

-----SoapRequest at 10/30/2012 11:03:53 AM
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
  <RetrieveServiceContentResponse xmlns="urn:vim2">
   <returnval>
    <rootFolder type="Folder">group-d1</rootFolder>
    <propertyCollector type="PropertyCollector">propertyCollector</propertyCollector>
    <about>
     <name>VMware vCenter Server</name>
     <fullName>VMware vCenter Server 5.0.0 build-455964</fullName>
     <vendor>VMware, Inc.</vendor>
  .
  .
  .
     <version>5.0.0</version>
    </about>
    <setting type="OptionManager">VpxSettings</setting>
    <userDirectory type="UserDirectory">UserDirectory</userDirectory>
.
.
.
    <licenseManager type="LicenseManager">LicenseManager</licenseManager>
    <searchIndex type="SearchIndex">SearchIndex</searchIndex>
   </returnval>
  </RetrieveServiceContentResponse>
</soapenv:Body>
</soapenv:Envelope>

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Setting the DebugPreference to SilentlyContinue gets rid of the SOAP messages alltogether.

But that probably doesn't help you with your debugging sessions :smileygrin:

Redirecting PowerShell streams is, besides the regular output and error streams, is not too obvious.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
8 Replies
LucD
Leadership
Leadership
Jump to solution

Are you running your scripts on the vCenter ?

Is the logging level of the ESXi server or vCenter perhaps set to "trivia" ? See KB1002263


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
rocndn
Contributor
Contributor
Jump to solution

I am running my script from the host where vSphere Client is. The ESXi which have my VM's is another machine.

The vCenter Server Settings have the Logging option set to Information (Normaln logging)

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Are you connecting to the vCenter or the ESXi server ?

Btw, is there a reason you are using PowerCLI 4.1 and not 5.1 ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
rocndn
Contributor
Contributor
Jump to solution

By PowerCLI I am connecting to the vCenter. I am not using 5.1, because there is a bug (described by VMware, will be fixed with 5.2) that will cost me to much work to make a workaround.

Reply
0 Kudos
rocndn
Contributor
Contributor
Jump to solution

OK, I have got the reson why it occurs in log. Just because I set the PowerShell debug mode on by command:

$Global:DebugPreference = "Continue"

So now the question is if someone knows how to make that vCenter will not shows his own SOAP dumps when PowerShell debug in on?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

I don't think that this is a vCenter thing.

If the PowerCLI cmdlets see the DebugPreference as Continue, instead of SilentlyContinue, they will display the SOAP packets.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

rocndn
Contributor
Contributor
Jump to solution

Yes, sorry, I have used a wrong name.  So there is no option to control that debug output from PowerCLI?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Setting the DebugPreference to SilentlyContinue gets rid of the SOAP messages alltogether.

But that probably doesn't help you with your debugging sessions :smileygrin:

Redirecting PowerShell streams is, besides the regular output and error streams, is not too obvious.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos