10 Replies Latest reply on Aug 20, 2014 8:29 AM by Ben Vassie

    Cannot add ESXi host to Datacenter

      Share This:

      I am using RBA-AD-VMware_Infrastructure:v3.0:Host_Operations:Create Host to add a newly provisioned ESXi host (built using BSA) to my existing Datacenter (in vCenter), however the vCenter does not add it as it says the username and/or password is incorrect, the credentials are valid as I can add it manually using the same username and password.

        • 1. Re: Cannot add ESXi host to Datacenter
          Aryan Anantwar

          Hi,

           

          will you share the adapter request & response of the same execution?

          it would be helpful to find out the cause of failure.

           

          Regards,

          Aryan Anantwar

          • 2. Re: Cannot add ESXi host to Datacenter

            The adapter issues the command successfully, however if you look at the vCenter event it says the username and/or password is incorrect

            I am now trying to issue the raw PowerCLI command however I cannot find any documentation on how to setup the PowerShell adapter to use the PowerCLI

            • 3. Re: Cannot add ESXi host to Datacenter
              Aryan Anantwar

              Refer below documentation for PowerShell Adapter configuration:

              https://docs.bmc.com/docs/display/public/baob201204/PowerShell+adapter

              • 4. Re: Cannot add ESXi host to Datacenter

                Here is my PowerShell adapter configuration

                 

                <config>

                  <target>localhost</target>

                  <user-name>Administrator</user-name>

                  <password encryption-type="Plain">password</password>

                  <powershell-consolefile>C:\Program Files (x86)\VMWare\vim.psc1</powershell-consolefile>

                </config>

                 

                and here is the adapter output

                 

                <powershell-output>

                  <metadata>

                    <status>success</status>

                  </metadata>

                  <targets-output>

                    <target-output host="localhost">

                      <metadata>

                        <status>success</status>

                      </metadata>

                      <commands-output>

                        <command-output>

                          <metadata>

                            <command>whoami</command>

                            <line-count>4</line-count>

                            <execution-milliseconds>359</execution-milliseconds>

                            <exit-code>0</exit-code>

                            <status>success</status>

                          </metadata>

                          <output>

                            <line index="1">Copyright 2010 BMC Software Ltd, Version: 1.6  </line>

                            <line index="2">Connecting to remote service...</line>

                            <line index="3">Couldn't connect to \\localhost\IPC$ (1219)</line>

                            <line index="4">Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again.</line>

                          </output>

                        </command-output>

                      </commands-output>

                    </target-output>

                  </targets-output>

                </powershell-output>]

                • 5. Re: Cannot add ESXi host to Datacenter
                  Aryan Anantwar

                  Hi,

                   

                  will you try replacing target value "localhost" with IP address/hostname.

                   

                  HTH.

                  • 6. Re: Re: Cannot add ESXi host to Datacenter

                    Still does not work DEBUG - Preparing to test the process.........Starting Local Peers on the grid........ DEBUG - Started all local peers. DEBUG - --------------------------------------------------- DEBUG - --  About to Start WorkFlow Testing DEBUG - --------------------------------------------------- DEBUG -      Process Details: DEBUG -        Grid Name: GRID1 DEBUG -        Module Name: Ben DEBUG -        Process ID: :Ben:Test DEBUG - Launch Requested INFO - [Current Time=Tue Aug 19 11:55:23 BST 2014] [Process Name=:Ben:Test] [Root Job Id=8b2788106aa0700e:14dea51a:147e87a9da0:-80001-1408445723620] [Job Id=8b2788106aa0700e:14dea51a:147e87a9da0:-80001-1408445723620] The process started. It is triggered by the scheduler. DEBUG - [Current Time=Tue Aug 19 11:55:23 BST 2014] [Process Name=:AutoPilot-AD-Utilities:Terminal:PowerShell] [Root Job Id=8b2788106aa0700e:14dea51a:147e87a9da0:-80001-1408445723620] [Job Id=8b2788106aa0700e:14dea51a:147e87a9da0:-80001-1408445723620/:Ben:Test:start:call-process[1]] Adapter request without secure password DEBUG - [Current Time=Tue Aug 19 11:55:23 BST 2014] [Process Name=:AutoPilot-AD-Utilities:Terminal:PowerShell] [Root Job Id=8b2788106aa0700e:14dea51a:147e87a9da0:-80001-1408445723620] [Job Id=8b2788106aa0700e:14dea51a:147e87a9da0:-80001-1408445723620/:Ben:Test:start:call-process[1]] [adapter request=                 Connect-VIServer -Server localhost -User Administrator -Password password      ] DEBUG - [Current Time=Tue Aug 19 11:55:39 BST 2014] [Process Name=:AutoPilot-AD-Utilities:Terminal:PowerShell] [Root Job Id=8b2788106aa0700e:14dea51a:147e87a9da0:-80001-1408445723620] [Job Id=8b2788106aa0700e:14dea51a:147e87a9da0:-80001-1408445723620/:Ben:Test:start:call-process[1]] [adapter response=       success                      Windows Server 2008        6.1.7601        success                                          Connect-VIServer -Server localhost -User Administrator -Password password            16            2247            0            success                                Copyright 2010 BMC Software Ltd, Version: 1.6              Connecting to remote service...            Failed to Copy Script From Given Location.            Failed to Copy file (Attempt :1 ): From (null)            The system cannot find the file specified.            Failed to Copy Script From Given Location.            Failed to Copy file (Attempt :2 ): From (null)            The system cannot find the file specified.            Failed to Copy Script From Given Location.            Failed to Copy file (Attempt :3 ): From (null)            The system cannot find the file specified.            Failed to Copy Script From Given Location.            Failed to Copy file (Attempt :4 ): From (null)            The system cannot find the file specified.            Couldn't copy service to \\146.105.104.124\Admin$ (may be service already running), error=2            The system cannot find the file specified.                              ] INFO - [Current Time=Tue Aug 19 11:55:39 BST 2014] [Process Name=:AutoPilot-AD-Utilities:Terminal:PowerShell] [Root Job Id=8b2788106aa0700e:14dea51a:147e87a9da0:-80001-1408445723620] [Job Id=8b2788106aa0700e:14dea51a:147e87a9da0:-80001-1408445723620/:Ben:Test:start:call-process[1]] The process terminated in the completed state. The process started at 19 Aug 2014 11:55:23,667, terminated at 19 Aug 2014 11:55:39,439, and the execution took 15,772 milliseconds. INFO - [Current Time=Tue Aug 19 11:55:39 BST 2014] [Process Name=:Ben:Test] [Root Job Id=8b2788106aa0700e:14dea51a:147e87a9da0:-80001-1408445723620] [Job Id=8b2788106aa0700e:14dea51a:147e87a9da0:-80001-1408445723620] The process terminated in the completed state. The process started at 19 Aug 2014 11:55:23,636, terminated at 19 Aug 2014 11:55:39,485, and the execution took 15,849 milliseconds.

                    • 7. Re: Cannot add ESXi host to Datacenter

                      Remove the <target> element.  If you specify it, even if it is "localhost", it will use Xcmd to connect via remote methods, and you have to have run thru the post-installation tasks to set up security for Xcmd to operate in that mode.

                      • 8. Re: Cannot add ESXi host to Datacenter

                        That works! Thanks you

                         

                        Not onto my next issue, before running a PowerCLI command you have to connect to your vCenter

                         

                        Connect-VIServer -Server localhost -User Administrator -Password password

                         

                        Can I add this command to my adapter so I don't have to run it in my work flow each time? or..

                         

                        How can I run multiple PowerShell commands in one process?

                         

                        I need to log onto the vCenter using


                        Connect-VIServer -Server localhost -User Administrator -Password password


                        Then run my command, for example to list the disks on a host


                        Get-SCSILun -VMHost esxihost -LunType disk | ft CanonicalName,CapacityGB -hidetableheaders -autosize

                        • 9. Re: Re: Cannot add ESXi host to Datacenter
                          Aliakbar Kachwala

                          you can just pass the command in a single line separated by a semicolon

                          Connect-VIServer -Server localhost -User Administrator -Password password ; Get-SCSILun -VMHost esxihost -LunType disk | ft CanonicalName,CapacityGB -hidetableheaders -autosize

                          • 10. Re: Re: Re: Cannot add ESXi host to Datacenter

                            Thank you, however it will not let me format the output

                             

                            <line index="28">out-lineoutput : The object of type "Microsoft.PowerShell.Commands.Internal.For</line>

                            <line index="29">mat.FormatStartData" is not valid or not in the correct sequence. This is likel</line>

                            <line index="30">y caused by a user-specified "format-table" command which is conflicting with t</line>

                            <line index="31">he default formatting.</line>

                            <line index="32">    + CategoryInfo          : InvalidData: (:) [out-lineoutput], InvalidOperat </line>

                            <line index="33">   ionException</line>

                            <line index="34">    + FullyQualifiedErrorId : ConsoleLineOutputOutOfSequencePacket,Microsoft.P </line>

                            <line index="35">   owerShell.Commands.OutLineOutputCommand</line>