Pages

Total Pageviews

Tuesday, June 4, 2013

Restart management Agents

ESXi Management agent can be restarted in couple of ways 

DUCI 


  • Connect to ESXi Host 
  • Press F2 , provide the credentials ( Login using root)
  • Go to Trouble shooting , Navigate to Restart ,Management Agents

Local Console or ssh 

Method 1 : No Down time to VMs

  • /sbin/services.sh restart

will restart all the management agents, hostd, ntpd, sfcbd, slpd, wsman, vodb

Method 2 :

Run following commands,

  • /etc/init.d/hostd restart
  • /etc/init.d/vpxa restart


Method 3 : 

  • service mgmt-vmware restart
  • service vmware-vpxa rest

If Automatic Startup/shutdown is enabled on VMs , virtual machine may restart.


Friday, May 31, 2013

vCenter Roles and Privilages

Role and Privileges

Vcenter privileges are fairly different than the  Active directory (Discretionary access control ) . vCenter uses role based access control - RBAC .

There are three type of roles 

  • System
  • Sample
  • Custom 


System Roles

There are 3 type of system roles these are default and cannot be changed

  • NO access  - User cannt see the object
  • Read Only - User can see the object but right click options are grayed out
  • Administrator - users have all the privilege on the object


Sample Roles : default sample roles are 


  • Virtual machine power on 
  • Datastore consumer
  • Network consumer
  • Virtual Machine User
  • Resource Pool administrator
  • vmware consolidated backup user
Note : Its advised not to change the Sample roles . Its better to clone the roles and apply to the object


Custom Roles:

When you create additional roles in the vCenter are called custom roles.

How Permissions are applied and inherited ?

  • Permissions applied on the objects supersedes a permission that is inherited
  • Permissions applied on the user supersedes permission which is inherited from being part of a group.
Examples :

  • User A - has admin access on DataCenter and No Access on VM1.Result  : This implies User A can see and modify all the objects under the datacenter but he cant see VM1
  • Group_A - Power on VMGroup_B - take SnapshotUser_A - Memeber of Group_A and Group_BUser_B- Group_AUser_C- Group_BResult : User_A can power on and take snapshot of all the vmsUser_B - Can take snapshot of vms but cant power on the vmUser_C - can only power on the machine
  • Group_A : Administrator
    Group_B: Read only VM2
    User_A : Group_A , Group_B
    User_B : Group_A
    User_C: Group_B
    Result : User_A : Can see and perform admin activity on all the objects accept VM2
    User_B : Has Administrative privilege on all the object including the vm2
    User_C : Can see only VM2 , no other objects in the datacenter
  • Group_A - Power on VMGroup_B - Take Snapshot
    User_A - ReadOnly on Datacenter
    Result : Even though user is part of both groups A and B , user will be able to see only the objects but all the options will be grayed out.

Thursday, May 16, 2013

Multiple Page files - single volume

Using GUI , you can define only one page files for each volume. It is possible to create multiple page files for a single volume , it can be done by modifying registry . 


To create multiple paging files on one volume 

  • On the drive or volume you want to hold the paging files, create folders for the number of paging files you want to create on the volume. For example, C:\Pagefile1, C:\Pagefile2, and C:\Pagefile3.
  • Click Start, Click Run, type regedit in the Open box, and then click OK.
  • In the left pane, locate and click the following registry subkey: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SessionManager\MemoryManagement
  • Find the Pagingfiles value, and then double-click it to open it.
  • Remove any existing values, and add the following values:
    c:\pagefile1\pagefile.sys 3000 4000
    c:\pagefile2\pagefile.sys 3000 4000
    c:\pagefile3\Pagefile.sys 3000 4000
  • Click OK, and then quit Registry Editor.
  • Restart the computer to cause the changes to take effect.

Vmware Standalone converter

Vmware Standalone converter - This VMware product is used to convert
  1. Physical to virtual 
  2. virtual to virtual 
  3. Import virtual machines hosted in the workstation or Hyper V.
  4. Import third party backup machine which can be managed by vCenter .
This is a free product which can be downloaded from vmware website . Alternative to this Plate Spin can be used to Physical to virtual machine conversion which is of-course a paid product.The latest version of stand alone converter is 5.1.

Components
  1. Converter Standalone server : Consists of two services , Converter Standalone server and Converter Standalone worker.
  2. Converter Standalone agent : installs on the source physical machine to import to virtual machine. you can always choose uninstall the agent from physical machine once the import it complete.
  3. Converter Stand alone Client : Converter Standalone server works with client. It consists of user interface for server which provides  access for conversion and configuration wizard

How the converter works : 

  • Stand alone converter uses cloning and system re-configuration steps to create and configure the destination virtual machine so that it works successfully in the vCenter environment.Migration process is non-destructive for the source machine so you can continue using the source machine after conversion completes
  • Cloning process is copying of Physical volumes to destination virtual machine.Cloning involves copying the data from source machines hard disk and transferring the data to destination virtual machine. The Destination machine can have different geometry size, file layout and other characteristics.
  • System reconfiguration adjusts the migrated operating system to enable the function on virtual hardware/
 NOTE :  if you want both the source and destination machine to co -exist , you have to change the IP address and the computer Name.

HOT CLONING OF PHYSICAL MACHINE

Using the converter you can perform hot cloning , ie converting the physical machine when its running . It will allow you to convert the virtual machine without shutting down the source . 

How is works?

As the process is converting the running virtual machine , resulting virtual machine is not exact copy of the physical machine. While converting windows physical machine , you can set the converter to synchronize the destination virtual machine after hot cloning. Synchronization is performed from source to destination the blocks that were changes during  the initial cloning period.To avoid loss of data the standalone converter will shutdown certain services so that no critical changes are made at the source machine.

Stand alone converter can shutdown the source machine once the conversion / import is completed.When combined with Synchronization , the virtual machine can take over the source with least possible downtime . 


NOTE : when you hot clone dual boot systems , you can clone only the default operating system to which boot.ini file points . To clone the non-default OS you need to change the boot.ini file . For Linux , you can boot it and then clone using stand alone converter.


REMOTE HOT CLONE THAT ARE RUNNING WINDOWS

  • Standalone converter installs the agent on the source machine and agent takes snapshot of the volumes.i.e VSS snapshot feature of windows is used.
  • Standalone converter create the destination machine and copies the volumes from the source machine to destination machine.
  • Agent installs the required drives to allow the operating system to boot in a virtual machine and personalize the virtual machine. ex change the Ip address.
  • optionally uninstall the agent on the physical source machine.
Pre- requisite : 

  • Turn of Simple file sharing at the source machine 
  • Ensure file and print sharing is not blocked in the firewall
  • Sys prep should be installed on the Standalone converter server - used for guest customization. If guest OS is windows 2003 , sys prep should be copied to %ALLUSERSPROFILE%\Application Data\VMware\VMware vCenter Converter Standalone\sysprep\svr2003 .


HOT CLONING OF LINUX MACHINE 

Unlike windows , there are no agents installed on the source machine . instead of that a helper virtual machine is created at the destination , ie esx/i host .

Working ??

  • The converter creates a empty helper virtual machine at the destination which will be used as the container during the migration. The helper machine boots from the ISO file that is located on the converter standalone server
  • Helper machines connects to the source using SSH and starts retrieving the data from source, you can always select the source volumes that need to be copied .
  • Once copy is completed , destination virtual machine is reconfigure to boot as virtual machine.
  • Converter stops the helper machines once the conversion.

DATA CLONING 

Volume Based - 
  • Volumes are copied from source to destination . 
  • All the dynamic files are read but converted to basic disk at the destination . 
  • There are two type File System level and Block level. File level is used when destination disk is smaller than the original disk or when FAT volume is re-sized. Block level is used when preserve or larger volume size is selected for NTFS source volume.
  • Supported for import existing virtual machine and hot cloning.

DISK Based

  • Supported for import of existing virtual machine.
  • Transfers all the sector from all the disk and preserves the volume metadata.disk properties are same as the source
  • Supports both basic and dynamic disks
Linked Clone 

Is the fastest method of cloning..


SYSTEM SETTINGS AFTER CONVERSION

Following source computer settings are not changed 
  • Operating system settings i.e computer name , security ID , user accounts , profiles.
  • Application data and data files
  • Volume serial numbers for each disk partition.

Changes after conversion 
  • CPU Model and serial number 
  • Ethernet adapters
  • Graphic Cards
  • Disks and Partitions
  • Primary disk controllers


PORT REQUIREMENT



P2v of Linux Machine

V2VWindows Machine

P2 V Window Machine

LIMITATIONS

  • Converter Standalone cannot detect any source volumes and file systems that are located on physical disks larger than 2TB.
  • Hybrid disk cloning are not supported 
  • Synchronization is supported only for volume-based cloning at the block level and Scheduling synchronization is supported only for managed destinations that are ESX 4.0 or later.
  • When you convert a virtual machine with snapshots, the snapshots are not transferred to the destination virtual machine.
KEDB

  • Physical to virtual machine conversion fails at 1 %
    This error is usually caused due to the bad sector in the source machine  and due to VSS error. Analyse and defragment the disks in the source machine and try again. If it doesn't work contact the hardware vendor.

Tuesday, April 23, 2013

Performance Monitoring

Commonly used performance monitoring tool :

=> vSphere performance chart - access via both vsphere client as well as  web client.
=> esxtop or resxtop : individual ESX monitoring tool .
=> guest Monitoring tools : Perfmon , IOmeter

For virtual platform always two layers of monitoring is required , i.e. host level and guest level and it should be monitored over a period of time. 

Note :
* resxtop in batch mode cannot be used in vMa because of bug as of now .
http://kb.vmware.com/selfseOrvice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2008122
* Avoid using guest monitoring tools which depend on time synchronization .
* when vsphere client is directly connected to esx host only the real time  performance data is available and this data is stored in flat files of ESXi Host  

Vmware performance Data is available in 2 type i.e overview and advanced .

Over view : 
Depending on the object you selected, performance in the overview plan is displayed.

Advanced : 
Displays the statistical data of esxi host or any object in the vcenter like datastore, cluster, resource pool , VM , vapps. Available chart options are 
# CPU
# Memory 
# Disk 
# Management Agent
# Network and 
# System

Chart Types : 
# Line Graph
# Stacked Graph 
# Stacked Graph per VM  (Only on  ESX)
# Bar chart (Storage Metrics)
# Pie Chart (Storage Metrics)

Counter : 
Depending on the chart option you can select the Object , For ex , if you select CPU as char type you can see the objects as CPU usage , CPU ready time etc. Under counter you can see description of counter , Roll up , unit and internal name . 

Statistics at different Granularity:

These are predefined values and cant be changed . 



Statistic Type :

# Rate : value over current interval.  ex - Cpu usage 
# Delta : changed from previous interval. ex - cpu ready time 
# absolute : independent of interval .  ex- Memory Active 

Roll up : conversion function between the statistics 
# average  : avg of data points : CPU usage 
# sum : sum of data points : CPU ready time 
# latest : latest data point  : Uptime


Note : 
* For real time data , its current max and current min 
* For historical data its avg max and avg min

You can save the performance report in JPEG, BMP, PN BacG,GIF and in excel format.

resxtop :

It can  be run in following mode 
# Interactive (Default): real time 
# Batch  : output is redirected to a file 
# Replay : used for tech support using vm-support command and is replayed using the esxtop

Usage : Login to the system which has vcli and should have administrative role on Esxi host

Interactive Mode : 

# run resxtop --server esxhost --username root . This will prompt for the password.
# if you have connected to vcenter use following 
resxtop --server vc --username userid --password vcpwd -vihost esxhot

# type the following to change the behavior 
c =>CPU 
m=>Memory
d =>disk adapter
u => disk device
f => add or remove column 
v =>virtual machine view
n => network view
h => help
q => quit 

if you type d , resxtop would display Adapter , Path , Npth,CMDs,Reads,writes,Mbreads, MBWRTN/s,DVAG/cmd,KAVG/cmd,GAGV/cmd,QAVG/cmd.

when you press f column names will be displayed . The name which begins with * indicate the column is added to the output.

Note : 
* Options are case sensitive .
* Space bar is used to return to the screen .
* W is used to save the configuration.

Batch Mode 
resxtop -a -b >>file.csv

a - all parameters
b - batch mode 

Note : 
*Always start the VM before enabling the batch mode because newly added VM counter will not stored once the batch mode is enabled.

Replay mode :
vm-support -s -d 300 - I 30 

resxtop -r filename  (replay)

-s : restrict the collection of diagnostics data 
-d : duration logging for 300 sec ie 5 min   
-I : sampling interval  i.e each sample will be collected after 30 sec 


You can use perfmon to view the resxtop output file.

Guest Monitoring 
From 5.1 version Vmware has started adding additional Dlls which are installed on guest os using the vm toll. But this parameters are disabled by default . you need to enable these dlls to use them in the perfmon under the guest os . Extra counter that are added are  VM Processor and VM Memory.

tools.guestlib.enableHostInfo => true in .vmx file.

Tuesday, April 16, 2013

Configure ESXi

NTP Configuration on ESXi Host


vSphere Client :




Web client





DNS and Routing Config


Using ESXi DCUI console :






 VC client





Hyper Threading 

Hyper threading is the advanced CPU feature available on Intel NEHALEAM  CPU series , which allows cpu to run two threads simultaneously.Its helps to improve the CPU performance by 0 - 40 % on supported systems.


Os can recognize  whether physical cores or Hyperthreded cores but application will not be able to distinguish .


ESX  Behavior:


Esxi scheduler can distinguish between the Physical cores and the hyperthreded cores. scheduler will allocate the physical cores untill physical cores are loaded .If there are additional vCPUs requesting CPU resources they will then be assigned to the additional logical cores. By this method HT has no impact on performance until more vCPUs are concurrently executing than there exist physical cores.




To enable Hyper-threading , this need to be first enabled in the BIOS of the host . 

Configuration using vSphere client:

Hyperthreading - web client





Hyperthread config for VM 



VM level sharing  :

  1. Any - Default - allows VMs to share virtual core from other VMs as well. This is set by default.
  2. None -Virtual Machine get exclusive access to the core the other thread who wants to access the core has to wait.
  3. Internal  -VMs are allowed to share cores from the same physical cores


Memory compression cache
 ESX Uses Memory compression techniques i.e GZIP to extend the use of RAM which will reduce the swapping of memory pages . Memory compression is enabled by default and improves the performance when over-committing the memory by limiting the swap to disk .This technique divide VM swapping memory to 4KB and tried to compress them to 2KB. If compress success, then, you can save 50% space, if it fails, VM still swap the original 4KB to physical disk.



Enabling/Disabling Memory Compression

Open the Virtual Center and select Hosts and Clusters
Select a host and click the Configuration tab
Select Software | Advanced Settings
Select Mem.MemZipEnable, 1 for on, 0 for off


Configuring Memory Compression
Open the Virtual Center and select Hosts and Clusters
Select a host and click the Configuration tab
Select Software | Advanced Settings
Select Mem.MemZipMaxPct. 
This defaults at 10% of the RAM for caching and can be altered from 5% to 100%


Note : Compression process uses 2 - 3 % of Host CPU and time of compression is 20 ms. Compressed Memory is placed in the VM Memory not the Host Memory .




ESXi Licensing

You can add any number of licenses to  vSphere environment using the vsphere license key. Esxi license is socket based . There is not more restriction on the Memory ( vRAM entitlement )

Home => Administration => Licensing => Manage Vsphere License => Add license key 











Vcenter installation


Steps

  1. DNS Sever needs to be reached from New vCente Sever . DNS is one of the Main c0mponenet of Vcenter
  2. Install windows 2008 R2 operating system (From vSphere 4.1 , vcenter is supported only on 64 Bit OS)
  3. Enable Application server role to install  .Net Frame work 3.5.1 which is pre-requisite for SQL 2008 Standard Edition 

  1. Install SQL 2008 server  on vCenter server
Note : Don’t install the Reporting service in vCenter server as it uses 80 and 43 ports



  1. Disable the Dynamic Port






  1. Mount the vCenter ISO

  2. Browse to  I:\Single Sign On\DBScripts\SSOServer\schema\mssql Copy the files to Management studio of SQL 2008
     
CREATE LOGIN RSA_DBA WITH PASSWORD = '<CHANGE DBA PASSWORD>', DEFAULT_DATABASE = RSA

CREATE LOGIN RSA_USER WITH PASSWORD = '<CHANGE USER PASSWORD>', DEFAULT_DATABASE = RSA

Change the password and make a note of it. This password is required for further installations. First Script is used to create the data bases called RSA which is used for Single Sign On.

  1. Create a new database for Vcenter and Upgrade manager – VCDB and VCUPDATEDB
Set recovery model as Simple for ease of Management.

  1. Create a System DSN
 
 
  1. Now the pre-requisites for Vcenter 5.1 one is ready . We are good install vcenter 5.1
  2. Vcenter Single Sign on Installation
    Change the permissions of the RSA_DBA  and RSA_User on RSA database
    Database User : RSA_DBA
    Database User : RSA_User
    Database Instance: vcdb

  3.  
 




Access rights on the Single Sing on Data Bases








Inventory Services


User Id created while installing Single Sing On




Vcenter Server Installtion





 
 
 
 
 This would complete the installation in vCenter 5.1