Showing posts with label vCenter. Show all posts

How to manage vCenter Services



In certain cases where we need to restart the VMware vCenter Services, the best practices are to restart the services using the command line provided by VMware instead of doing it from the services console specifically on Windows vCenter Server. This is important as there are multiple Vmware Services which are dependant on other services and the command lines make sure they are managed in a specific order as recommended by Vmware

Below are the command lines to restart All VMware Services, Specific VMware Service or to check the status of Services on Windows hosted vCenter Server or an Appliance hosting vCenter Server

A) On Windows vCenter Server
  1. Login\RDP to vCenter Server
  2. Open Command Prompt as Admin
  3. Go to the following location
  4. C:\Program Files\VMware\vCenter Server\bin
    Note: If your vCenter Suite is installed on any other drive other than C:\, please replace the Drive Letter
  5. Run the below commands based on your requirement
service-control --start --all > To Start All Vmware Services
service-control --start servicename > To Start Specific Vmware Service
service-control --stop --all > To Stop All Vmware Services
service-control --stop <servicename> > To Stop Specific Vmware Service
service-control --status > To check Status of all VMware Services

B) On Appliance vCenter Server
  1. SSH Putty to vCenter
  2. Go to the Path /usr/bin/
  3. Run the command

service-control --start --all > To Start All Vmware Services
service-control --start servicename > To Start Specific Vmware Service
service-control --stop --all > To Stop All Vmware Services
service-control --stop servicename > To Stop Specific Vmware Service
service-control -status > To check Status of all VMware Services


Restart Management Agents on ESXi Hosts


In this post, I am providing steps in brief to restart the Management Agents on ESXi Hosts using 2 methods : Either by connecting to the Host via a Secure SSH Putty Session OR by taking a remote session of the ESXi Host.

Please note that by restarting the Management Agents, there is no impact to running VMs on this Host, It restart the Management Services which help in communicating with VCenter this Host is connected to.

A) By SSH Putty Session
Run the following commands to restart the Management Agents
/etc/init.d/hostd restart
/etc/init.d/vpxa restart

To check the status of these agents, run the following commands
/etc/init.d/hostd status
/etc/init.d/vpxa status

B)  From Remote Console

  1. Connect to the console and Press F2 to Login
  2. Enter Root Username and Password
  3. Navigate to Troubleshooting Mode Options -> Restart Management Agent and Press Enter
  4. Press F11 to confirm the Management Agent Status



What if vCenter Server\Appliance is Down?



The best thing about Vmware platform is the centralized management of all the resources using vCenter Server. Using vSphere or Web Client we all connect to vCenter Server to administer the virtual datacenter. Imagine if there was no vCenter Server and we had to connect to each ESXi host manually and manage the VMs. Yes, it sounds like a tedious task.
vCenter Server also provides multiple features like DRS, sRDS, vMotion, HA, FT etc. Today we are talking about a scenario where the vCenter Server or Appliance goes down and what are its impact on each of these functionalitiess. Let's check the impact of each of these functionalities below

Management :
Managing the environment won't have much impact as we can still connect to each ESXi host via SSH or vSphere client and manage the servers. It is not easy but there is no impact to the environment

Virtual Machines & ESXi Hosts:
There is no dependency of vCenter server on functionality or uptime of any other Virtual Server or ESXi Host. The Hosts can still be connected via SSH or vSphere Client and all the Virtual machines are still working

Distributed Resource Scheduling:
DRS works with vCenter Server to balance the resources and Virtual Machines across ESXi Hosts using DRS Clusters, the DRS functionality will fail if the vCenter server is down

vMotion\svMotion:
vMotion and svMotion features are spanned across hosts and since it is a feature is based on DRS, Both vMotion and svMotion will fail if vCenter server is down

High Availability:
HA will have medium impact as the Hosts\Clusters configured with HA enabled will have the HA running even if vCenter Server is down. However we would not be able to change any settings like Admission Control Policies while the vCenter Server is down.

Fault Tolerance:
FT will also work in case of all Virtual Machines which are configured before vCenter Server went down. No Changes can be done once the vCenter server is down.

Distributed Switch:
Distributed Switch would still continue to work even after vCenter Service is down. It will still connect to the Network it is configured on.

VM Snapshots:
There would be no issues in taking the snapshots of a Virtual Machine. We need to connect to ESXi host and take the VM snapshot.

Virtual Update Manager:
Since Virtual Update Manager is a vCenter plugin, the functionality of VUM will fail while the vCenter is down.

Note:
We have tested these features and impacts mentioned above only on vCenter Server 5.x version only. 

Location of vCenter Server Logs on Windows Server and Appliance


Location of vCenter Server Logs on Windows Server and Appliance

The main focus of this post is to mention the location of vCenter Server Logs. These logs are very necessary for Technical Troubleshooting related to vCenter Server. As we know vCenter Server service can be installed on Windows Server as well as on an Appliance. The location of this logs also varies on different Operating Systems. There are more detailed articles on VMware blogs for more indepth logs and their locations for various VMware products. Here I am only focussing on vCenter Server Logs. In the upcoming posts I will also provide locations of various other VMware products.

There are 2 methods to fetch the VMware vCenter logs
1. By Connecting to VMware vsphere client or web client and logging onto the vCenter Server
2. By either taking a RDP session to vCenter Server [Hosted on Windows Server] and accessing the share paths given below OR by connecting to vCenter Server via SSH [Hosted on Appliance]

1. By Connecting to VMware vsphere client or web client and logging onto the vCenter Server
a. Connect to VMware vCenter via vsphere or web client
b. Go to Home screen -> Click on System Logs
c. At the top, click on Export System Logs
d. On the next prompt, select the VCenter Tree and enter the destination where you need the logs to be exported.

2. By either taking a RDP session to vCenter Server [Hosted on Windows Server] and accessing the share paths given below OR by connecting to vCenter Server via SSH [Hosted on Appliance]

A) On Windows Server having vCenter Server Service Installed
> vCenter Server 5.X and earlier version [if installed on Windows XP, 2000 or 2003] -> %ALLUSERSPROFILE%\Application Data\VMware\VMware VirtualCenter\Logs

> vCenter Server 5.X and earlier version [if installed on Windows Vista, 7 or 2008] -> C:\ProgramData\VMware\VMware Virtualization\Logs\

> vCenter Server 6.0 -> %ALLUSERSPROFILE%\VMWare\vCenterServer\logs

Note: If the vCenter Service is running with a different account, then the logs would be present under that accounts profile instead of %ALLUSERPROFILE%

B) On Appliances having vCenter Server Service Installed
> vCenter Server Appliance 5.X -> /var/log/vmware/vpx

> vCenter Server Appliance 5.X UI -> /var/log/vmware/vami


> vCenter Server Appliance 6.0 -> /var/log/vmware/

>> References:
https://kb.vmware.com/selfservice/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=1021804


https://kb.vmware.com/selfservice/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=2110014