<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Retrieve vCenter instance name in vSphere Management SDK Discussions</title>
    <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Retrieve-vCenter-instance-name/m-p/1405873#M7182</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much,&amp;nbsp;but i still have a problem.&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;PRE&gt;
&lt;EM&gt;ServiceInstance si = new ServiceInstance(url, username, password, ignoreCert);&lt;/EM&gt;

&lt;EM&gt;OptionManager om = si.getOptionManager();&lt;/EM&gt;

&lt;EM&gt;OptionValue[] ovs =om.queryOptions("VirtualCenter.InstanceName");&lt;/EM&gt;&lt;/PRE&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;It returns this error on the third line:&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;EM style="line-height: 1.25;"&gt;Exception in thread "main" com.vmware.vim25.NoPermission&lt;/EM&gt;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;Also,&amp;nbsp;this instruction:&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;PRE&gt;
OptionValue[] ovs =om.getSetting();&lt;/PRE&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;returns a&amp;nbsp;NullPointerException...&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;Where is the problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Feb 2016 10:57:45 GMT</pubDate>
    <dc:creator>enricodile</dc:creator>
    <dc:date>2016-02-16T10:57:45Z</dc:date>
    <item>
      <title>Retrieve vCenter instance name</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Retrieve-vCenter-instance-name/m-p/1405870#M7179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;How can I&amp;nbsp;retrieve vCenter's&amp;nbsp;instance name with SDK?&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;In vsphere&amp;nbsp;Client i can see the name (in image below :&amp;nbsp;SRVCENTER):&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;IMG alt="Image" src="https://dl.dropboxusercontent.com/u/6981268/Temp/vcenter.png" /&gt;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;I could not find it in any object...&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.25;"&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;Henry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2016 12:06:14 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/Retrieve-vCenter-instance-name/m-p/1405870#M7179</guid>
      <dc:creator>enricodile</dc:creator>
      <dc:date>2016-02-15T12:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve vCenter instance name</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Retrieve-vCenter-instance-name/m-p/1405871#M7180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In attachment the screenshot..&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2016 12:32:25 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/Retrieve-vCenter-instance-name/m-p/1405871#M7180</guid>
      <dc:creator>enricodile</dc:creator>
      <dc:date>2016-02-15T12:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve vCenter instance name</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Retrieve-vCenter-instance-name/m-p/1405872#M7181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'll want the OptionManager object on the ServiceInstance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ServiceInstance -&amp;gt; setting ['&lt;SPAN style="color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;"&gt;VirtualCenter.InstanceName&lt;/SPAN&gt;']&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2016 15:30:51 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/Retrieve-vCenter-instance-name/m-p/1405872#M7181</guid>
      <dc:creator>stumpr</dc:creator>
      <dc:date>2016-02-15T15:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve vCenter instance name</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Retrieve-vCenter-instance-name/m-p/1405873#M7182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much,&amp;nbsp;but i still have a problem.&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;PRE&gt;
&lt;EM&gt;ServiceInstance si = new ServiceInstance(url, username, password, ignoreCert);&lt;/EM&gt;

&lt;EM&gt;OptionManager om = si.getOptionManager();&lt;/EM&gt;

&lt;EM&gt;OptionValue[] ovs =om.queryOptions("VirtualCenter.InstanceName");&lt;/EM&gt;&lt;/PRE&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;It returns this error on the third line:&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;EM style="line-height: 1.25;"&gt;Exception in thread "main" com.vmware.vim25.NoPermission&lt;/EM&gt;&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;Also,&amp;nbsp;this instruction:&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;PRE&gt;
OptionValue[] ovs =om.getSetting();&lt;/PRE&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;returns a&amp;nbsp;NullPointerException...&lt;/P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;Where is the problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 10:57:45 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/Retrieve-vCenter-instance-name/m-p/1405873#M7182</guid>
      <dc:creator>enricodile</dc:creator>
      <dc:date>2016-02-16T10:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve vCenter instance name</title>
      <link>https://communities.vmware.com/t5/vSphere-Management-SDK/Retrieve-vCenter-instance-name/m-p/1405874#M7183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'll need to login.&amp;nbsp; If you are logging in, you also need permissions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P style="color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;"&gt;This method might require any of the following privileges depending on where the property fits in the inventory tree.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;System.View on the root folder, if this is used to read settings in the "client" subtree.&lt;/LI&gt;
&lt;LI&gt;System.Read on the root folder, if this is used to read all settings or any settings beside those in the "client" subtree.&lt;/LI&gt;
&lt;LI&gt;System.Read on the host, if this is used to read the advanced options for a host configuration.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 11:00:47 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Management-SDK/Retrieve-vCenter-instance-name/m-p/1405874#M7183</guid>
      <dc:creator>stumpr</dc:creator>
      <dc:date>2016-02-16T11:00:47Z</dc:date>
    </item>
  </channel>
</rss>

