Sunday, January 8, 2017

VMware vCenter Server 6.x Appliance services: how to find svc status or start/stop

In VMware vCenter Server 6.0 and later, VMware recommends to use the vSphere Web Client or Service Control command-line tool to check, stop, start, or restart vCenter Server Appliance services.
Status of vCenter appliance services can be checked either from vCSA appliance shell or by using web client.

Note: To access vCSA appliance shell, same like ESXi, access to the appliance console and press Alt+F1, we can also access appliances shell over ssh using putty but for that we should have enabled ssh first and that can be done either from vCSA direct console or from web client console.

Listing the vCenter Server Appliance services

To list the vCenter Server Appliance services within the vSphere Web Client:
  1. Log in to the vSphere Web Client with a vCenter Single Sign-on administrator account.
  2. Navigate to Administration > Deployment >  System Configuration.
  3. Click Nodes, select the vCenter Server Appliance node and click the Related Objects tab.

To list the vCenter Server Appliance services using the command-line:
  1. Log in as root through an SSH or console session on the vCenter Server Appliance.
  2. Run this command to enable the shell:

    shell.set --enabled true
  3. Run this command to launch the shell:

    shell
  4. Run this to change directories to /bin:

    cd /bin
  5. Run this command to list the vCenter Server Appliance services:

    service-control --list


6.  To view the current status of the vCenter Server Appliance services, type the command:

service-control --status

To check the status of any specific service, for ex. vmware-vpxd

service-control --status vmware-vpxd

To Start / Stop or Restart a vCenter Server Appliance services
To start/stop/restart the vCenter Server Appliance service using the vSphere Web Client:
  1. Log in to the vSphere Web Client with a vCenter Single Sign-on administrator account.
  2. Navigate to Administration > Deployment >  System Configuration.
  3. Click Nodes, select the vCenter Server Appliance node and click the Related Objects tab.
  4. Right-click on the service you would like to start/stop/restart and select desired option.
To start the vCenter Server Appliance service if it is was stopped using the command-line:
  1. Log in as root through an SSH or console session on the vCenter Server Appliance.
  2. Run this command to enable the shell:

    shell.set --enabled true
  3. Run this command to launch the shell:

    shell
  4. Run this command to change directories to /bin:

    cd /bin
  5. Run this command to list the vCenter Server Appliance services:

    service-control --list
Now, Run this command to start a specific service:

service-control --start servicename

or

Run this command to stop a specific service:

service-control --stop servicename

You may also start all services by typing the command:

service-control --start --all

or

Stop all services by typing the command:

service-control --start --all

To perform a dry run of the command, add the option --dry-run to the command, doing so will display what actions the command will run without executing the actions. For example, type the command:

service-control --stop --all --dry-run     or   service-control --start --all --dry-run

Note: To restart a vCSA appliance server you first need to stop and then start the services as there is no restart switch via shell cmd.


Reference: VMware kb# 2109887, VMware vSphere 6.5 Documention 

Note: For VCSA 5.x appliance services, please refer to kb# 2054085

That's it... :)


Sunday, January 1, 2017

How to Reset vCenter SSO admininstrator password in vSphere 6.x

You might have faced this, specially in you homelab env ;) , where after a long time when you tried to login on to vCenter SSO and couldn't recall the SSO administrator account "administrator@vsphere.local" password.

Here the good things is, the process of resting SSO administrator account password is pretty state forward, and we can easily reset the "administrator@vsphere.local" password.

To reset the administrator@vsphere.local password:

On a Windows Platform Services Controller or vCenter Server with Embedded Platform Services Controller:

  1. Log in to vCenter Server with a domain administrator account. If the Platform Services Controller is installed separate from vCenter Server, log in to the Platform Services Controller server.
  2. Open an elevated command prompt.
  3. Run C:\> "%VMWARE_CIS_HOME%\vmdird\vdcadmintool.exe".

    This console loads:

    ===============================
    Please select:
    0. exit
    1. Test LDAP connectivity
    2. Force start replication cycle
    3. Reset account password
    4. Set log level and mask
    5. Set vmdir state
    ===============================

  4. Press 3 to enter the Reset account password option.
  5. When prompted for the Account UPN, enter: administrator@vSphere_Domain_Name.localBy default, this is: administrator@vSphere.localA new password is generated.
Notes:
  • If you customized your vSphere Domain name, provide the customized domain name.
  • If the prededing steps fail with a domain administrator account, use a local administrator account.
    6. Use the generated password to log in to the administrator@vSphere.local account.
    7. After the password is regenerated, log in to vSphere Web Client and change the password.

    On the Platform Services Controller or vCenter Server with Embedded Platform Services Controller Appliance
    1. Log in to vCenter Server Appliance using SSH as the root user.
    2. Run this command to enable access the Bash shell:

      shell.set --enabled true
    3. Type shell and press Enter.
          4.  Now run /usr/lib/vmware-vmdir/bin/vdcadmintool
            
            5. Press 3 to enter the Reset account password option.

            6. When prompted for the Account UPN, enter: administrator@vSphere_Domain_Name.local
                By default, this is: administrator@vSphere.local


    Once you press enter, a new password is generated.

    Note: If your vSphere Domain name is customized, provide the customized domain name.

          7. Use the generated password to log in to the administrator@vSphere.local account.
          8. Once you log in to the vSphere Web Client, change the password.
      Reference: VMware kb# 2034608

      That's it... :)


      Saturday, December 31, 2016

      Useful links to know more about VMware Cloud on AWS

      As most of us would be aware, in Oct this year VMware and AWS announced a partnership where VMware Cloud would run on AWS infra…This VMware vSphere-based cloud service running on AWS that will make it easier to run any application and can be also connected to inhouse existing VMware virtual infrastructure…for detailed info please refer to below listed links.

      VMware and Amazon Web Services Announce Strategic Partnership

      VMware Cloud on AWS – A Closer Look

      In the Works – VMware Cloud on AWS

      VMware Cloud on AWS

      VMware Cloud on AWS: The Only Way to Extend Your VMware Environment into AWS

      VMware on AWS: A one-way ticket to the cloud

      VMware Cloud on AWS - Overview

                                         

      Components of VMware Cloud on AWS

                                                         Thanks to Amazon/VMware for this nice Graphic
      VMware Cloud on AWS Demo…



      For more videos – check out the VMware Cloud on AWS YouTube Playlist HERE.

      Note: As per the information available so far, As part of the deal, VMware will be AWS's preferred private cloud partner and Amazon will be VMware's preferred partner in the public cloud and VMware Cloud on AWS will go live sometime in 2017.

      I would add more related links here in future.....

      That's it for now..........Wish you all A VERY Happy New Year ... :)


      Saturday, December 24, 2016

      VMware Product Walkthroughs site - self-paced demos with screenshots

      I am not sure how many of us aware of VMware Feature Walkthrough Site, I personally found it very useful as its a great resource for stepping through a self-paced demo of a particular VMware product or feature.

      This site (https://featurewalkthrough.vmware.com) provides great technical overviews and step-by-step guidance for installing, configuring and managing VMware solutions. The content here has some great info including product demos which help to explain what a given product does and what it offers. .

      Currently following VMware Solutions are listed here,

      vSphere 6
      vSphere 6.5
      vSphere with Operations Management
      vRealize Suite
      vRealize Network Insight
      Virtual SAN
      vCenter Site Recovery Manager
      NSX
      vCloud Air
      VMware Integrated OpenStack
      SAP on SDDC

      Each walkthrough includes screen shots with relevant steps highlighted and text explaining the process.

      That's it... :)


      Wednesday, December 21, 2016

      vSphere's Datacenter Command-Line Interface: Getting Started with Datacenter CLI

      This post was originally published on VMware vSphere Blog and I am just re-posting it here for future reference...


      Datacenter Command-Line Interface (DCLI) is one of vSphere’s newest CLIs. DCLI works exclusively with the vSphere Automation API (REST API for vSphere) to provide both an interactive and scriptable mode to monitor and manage all features made available to the REST based API.
      With the vSphere 6.5 release, DCLI has picked up a ton of new functionalities! DCLI can now interact with the vCenter Server Appliance (VCSA), perform VM tasks, receive environmental vSphere information, managing vSphere Tags, and work with the Content Library. This is definitely a great tool to have in the toolbox for anyone accessing a vSphere environment.


      Accessing DCLI

      DCLI is able to be installed on a multitude of Windows and Linux systems as part of the vSphere Command-Line Interface (vCLI). DCLI is also automatically included within the vCenter Server Appliance (VCSA) as well as being included as part of the installation process for vCenter Server on Windows.


      Using DCLI

      There are two ways to use DCLI, either in an interactive shell or via scripting mode. Both methods have their benefits, so it comes down to either preference or what fits the use case at the time.


      Interactive Shell

      DCLI’s interactive shell has several great features, such as tab complete and session history retention and the ability to find a namespace just by starting it off with the first few characters.


      Accessing DCLI’s Interactive Shell

      Here’s an example workflow of using DCLI’s interactive shell:
      • Start DCLI with the following options (Note: options start with a + in DCLI)
        • +server -> The vCenter name/IP to connect to
        • +skip-server-verification -> Instruct DCLI to ignore any certificate warnings
        • +interactive -> Start the interactive mode
      Once in the interactive shell, you can either hit tab and see the namespaces available or start typing in the name of the object you’d like to begin viewing or working with.
      The example below shows a tab complete example when working with VM objects:


      Here’s an example on retrieving the VCSA’s system version and then how the session history works:  
      As seen above, just by typing in the first letter of a prior command allows the user to recall that command without having to type the entire line. The history will persist through sessions as well, making this a very nice feature!


      Scripting Mode

      The scripting mode allows DCLI commands to be used within scripts. These scripts can then be turned into more extensive workflows and/or scheduled tasks.
      Calling DCLI commands through the scripting mode is fairly similar to interactive mode, but a server has to be specified each time. The full namespace has to be referenced as well.
      Here’s an example of retrieving the VCSA’s system version and then retrieving a list of VMs:


      Here is an example of a bash script to create 10 VMs on a given datastore, resource-pool and folder:
       
      #!/bin/bash
      
      COUNTER=0
      
      while [ $COUNTER -lt 10 ]; do
      
      echo Creating LoopVM$COUNTER
      
      dcli com vmware vcenter vm create --name LoopVM$COUNTER --guest "SLES_12_64" --resource-pool "resgroup-9" --folder "group-v7" --datastore "datastore-12"
      
      let COUNTER=COUNTER+1
      
      done
      
      bold=$(tput bold)
      
      normal=$(tput sgr0)
      
      echo ${bold}--- VM List ---${normal}
      
      dcli com vmware vcenter vm list
      

      Output Formatting

      DCLI also has the ability to change how the output from commands are handled. The formatter allows users to specify outputs of CSV, HTML, JSON, Simple, Table, or XML.
      Here’s an example of using the formatter by showing a list of the hosts and then specifying the “+formatter json” parameter to receive the same output in JSON:


      Credential Store


      One of the other big capabilities of DCLI is storing credentials with the Credential Store. This streamlines the process of connecting to the same vCenter repeatedly, and even more so when working in scripting mode.
      The first time a user connects to a vCenter server, they will be prompted to store the credentials to the credstore. After that initial save, the credstore will be referenced with each connection to that server. If needed, credentials can be specified at the command line to over-ride the values stored in the credstore.
      Users can also work with the credstore to either populate credentials with the “+credstore-add +username user” parameter, remove credentials with the “+credstore-remove +user user +server servername.fqdn”, and list what credentials already exist with the “+credstore-list” parameter.
      Here’s an example output from using the “+credstore-list” parameter within an interactive mode session:
      Retrieving a list of credentials from DCLI's credstore


      Demonstration

      Here’s a demonstration video showing DCLI’s interactive mode in action! The video details connecting to a VCSA, entering DCLI’s interactive mode, displaying some general environmental information as well as pointing out some of the benefits when using interactive mode, and lastly it creates a VM and shows all the important information about that new VM.
      Pay close attention to that VM creation command, there’s a sneak peak of an upcoming post in this series on DCLI.


      Conclusion

      DCLI has, relatively, flown under the radar up until this point. Interactive mode allows even brand new users to easily access and run commands within moments of connecting and without knowin the name of the name spaces or reading documentation. Scripting mode lets users have those same great commands available outside of the interactive shell and utilize them in a standalone basis or within a scheduled task or cron job. These commands can easily be used with the formatter option to produce a variety of outputs and allow quick integration into other products.

      DCLI is a great and intuitive CLI that should be added to anyone’s toolbox!
      For more information on getting started with DCLI, see the DCLI Reference.

      That's it... :)