Labels

Friday, July 29, 2011

Understanding How Memory is managed in VMware

How memory is allocated to a virtual machine?

When we create a new virtual machine through vsphere client the wizard asks us how much memory the virtual machine should have

The amount of memory we allocate on this screen is the amount of the guest operating system will see.
Example:. Assume we have given 1 GB of memory to virtual machine. the virtual machine will never able to use more than 1 GB.
Let us assume 4 GB of physical RAM avail to run the virtual machine.
Requirements: Need to create the 4 virtual machine with 1 GB RAM each.
First virtual machine will run with 1GB and leaving the 3GB to the other virtual machines
After  configured  3 more virtual machine with 1GB each. Upto now all the machines will run as normal.
What happens when we launch a fifth machine ? will it run ?  The answer is yes.

There are 3 technologies used to manage the memory.They are
  • Idle page reclamation
  • Transparent page sharing
  • Balloon driver
Idle page reclamation:
Using this technology, ESX/ESXi will reclaim memory pages that are not being actively used by the virtual machine, clean-up the reclaimed pages and reallocate those memory pages to the other virtual machines.

Transparent page sharing:
In this technology, where the identical memory pages are shared among virtual machines to reduce the total number of memory pages need.

Balloon driver:
This driver will comes with VMware Tools. In this technology the driver forces a VM to use less memory than its configured maximum. The balloon driver requests memory from the guest operating system within virtual machine and then passes that memory back to the hyper-visor for use by other virtual machine

How Balloon driver works?
This driver is a part of the vmware Tools, It is a guest operating system specific driver, meaning that Linux VM’s would have a Linux-based balloon driver, Windows VMs would have a Windows-based balloon driver, and so.
When the ESX/ESXi host is running low on physical memory, the hyper-visor will signal the balloon driver to grow. To do this the balloon driver will request memory from the guest operating system. This causes the balloon driver’s memory footprint to grow. The memory that is granted to the balloon driver is then passed back to the hyper-visor. The hyper-visor can use these memory pages to  supply memory for the other virtual machines, which reducing the need to swap and minimizing the performance impact of the memory. When the memory pressure on the host get cleared, the balloon driver will return memory to the guest operating system.

Controlling Memory Allocation
ESX/ESXi provides some additional settings in the virtual machines configuration that affect memory allocation and memory management..On the Resources tab of a virtual machine’s properties dialog box we can see three options for controlling how a virtual machine uses the memory assigned to it.
  • Reservation
  • Limit
  • Shares
The following are the steps to edit the reservation, limit,or shares of a virtual machine
  •  Use the vSphere Client to connect to a vCenter Server or directly to an ESX/ESXi 
  • Scroll down through the inventory to find the virtual machine to be edited 
  • Right click the virtual machine, and select the Edit Settings option 

  • Click Resources tab
  • On the Resources tab, select the CPU or Memory options from the Settings list on the left
  • Adjust the Shares, Reservation and Limit values as needed





The memory reservation is optional settings for each virtual machine. The memory reservation amount specified on the Resouces tab of the virtual machine settings is the amount of actual, real physical memory that the ESX/ESXi host provide to this virtual machine for the virtual machine to power on..
The default is 0MB. 0 MB means the ESX/ESXi host does not have to provide the virtual machine with any physical memory.
 A virtual machine with a reservation is guaranteed the amount of RAM configured in its Reservation settings.

If ESX/ESXi host is not required to provide actual RAM to the virtual machine, then how the virtual machine get its memory? The answer is that it provides swap, or more specifically something called VMkernel swap
VMkernel swap is a file created when a virtual machine is powered on  with a .vswp extension. The pre-virtual machine swap files created by the VMkernel reside by default in the same data store location as the virtual machine’s configuration file and virtual disk files. By default this file will be equal to the size of the RAM that you configured the virtual machine.
Note: If the virtual machine configured with a reservation or a limit, the VMkernel swap file could differ.





Here you may get doubt.  Does a virtual machine will get all of its memory from swap when ESX/ESXi host RAM is available? NO. ESX/ESXi will attempt to provide each virtual machine with all the memory it request, upto the maximum amount configured for the virtual machine.

Example: A virtual machine configured with only 1GB of RAM cannot request more than 1GB of RAM. However when an ESX/ESXi host does not have enough RAM available to satisfy the memory needs of the virtual machines it is hosting. The technologies such as transparent page sharing, idle page reclamation and the balloon driver aren’t enough, the VMkernel is forces to page some of each virtual machine’s memory out to the individual virtual machine’s memory out to the individual virtual machine’s VMkernel swap file.

Did we can control how much of an individual virtual machine’s memory allocation can provided by swap and how much must be provided by real physical RAM? Yes. This is where a memory reservation comes into picture. By default a virtual machine has a memory reservation of 0MB, which means that potentially all of the virtual machine has a memory pages out to the VMkernel swap file if necessary.


 

Wednesday, July 27, 2011

Citrix Execution files and system Files and their uses


XenApp Architecture:


Citrix System Architecture:


.Exe Files
EncSvc.exe (Citrix Encryption Service)
Enables secure communication with RC5 128-bit encryption between XenApp Plug-ins and XenApp. This service depend on Windows Management Instrumentation Driver Extensions.
SemsService.exe Citrix EUEM (End User Experienceing Monitoring)
Collects and collates end-user experience measurements.
Citrix Licensing (Performance – mflicperf.dll)
Performance counter DLL that must be registered for Perf Mon 
CtxSFOSvc.exe (Citrix Virtual Memory Optimization)
Dynamically optimizes applications running on a XenApp server to free up server memory.

HCAService.exe (CitrixHealthMon – Health Monitoring and Recovery)
Provides health monitoring and recovery services in the event problems occur.This service depend on Citrix Independent Management Architecture service, Terminal Services
CitrixICA (Performance – icaperf.dll)
Performance counter DLL that must be registered for Perf Mon

CtxWMISvc.exe (Citrix WMI Service)
Provides the Citrix WMI classes for information and management purposes.
This service depend on  the below listed services
  • Citrix Independent Management Architecture service
  • Citrix Services Manager service
  • IPsec Policy Agent
  • Remote Procedure Call (RPC)
  • TCP/IP Protocol Driver
  • Windows Management Instrumentation Driver Extensions
XTE.exe (Citrix XTE Server – Session Reliability)
Services network requests for session reliability and SSL from XenApp components.

CdfSvc.exe (Diagnostic Facility COM Server)
Manages and controls diagnostic trace sessions, which are used to diagnose problems on a XenApp server.This service depends on Remote Procedure Call (RPC)
Cpsvc.exe (Citrix Print Manager Service)
Manages the creation of printers and driver usage within XenApp sessions.
This service supports the Citrix Universal Printing features. This service depends on Print Spooler, Remote Procedure Call (RPC)
ctxcpubal.exe(Citrix CPU Utilization Mgmt/Resource Mgmt)
One of the services for the CPU Utilization Management feature.
Manages resource consumption to enforce entitlement policies. This service depends on RPC

RadeSvc..exe (Citrix Streaming Server)
Manages the XenApp Plug-in for Streamed Apps when streaming applications. This service depends on RPC
Ctxxmlss.exe ( Ctxhttp, XML Service)
Services XML data requests sent by XenApp components

ImaAdvanceServer.exe (Citrix Server Manager, interface to OS)
Provides XenApp with an interface to the operating system. Other services use this services to perform elevated operations.

Imasrv.exe (ImaService, management service)
Mfcom.exe (COM access to Citrix farm)

.Sys Files 
Ctxpidmn.sys (Sandbox Main Driver)
Ctxrmpn.sys (RM Process Notification Driver)
CtxSbx.sys (Sandbox Filter Driver)
Ctxsmcdrv.sys (SMC Support Driver – Session Monitoring and Control)
Icacdd.sys (ICA TW Miniport)
Icareduc.sys (ICA Reduction Driver)
Pdcomp.sys (Compression Protocol Driver)
Pdcrypt1.sys (Encryption Protocol Driver)
Pdcrypt2.sys (Encryption 128 bit Protocol Driver)
Pdrframe.sys (Frame Protocol Drv for Reliable Transport)
Twexport.sys (Thinwire Support Driver)
Wdica.sys (ICA WinStation Driver)
Ctxaltstr.sys (SFO Alternate Stream Driver)


Processes in all Sessions in a server
Session 0
  • ImaAdvanceServer.exe
  • Mfcom.exe
  • Radesvc.exe
  • Cdfsvc.exe (Diagnostic Facility COM Server)
  • Cdmsvc.exe (Client Mapping)
  • Encsvc.exe (Encryption)
  • Hcaservice.exe (HCA)
  • Cpsvc.exe (Client Printer)
  • Ctxxmlss.exe (XML)
  • Imasrv.exe (IMA)
  • XTE.exe
Session 1
  • Radeobj.exe (App Streaming)
  • Pnamain.exe (PNA)
  • Ssonsrv.exe (Pass-through Authentication)
  • Wfshell.exe
  • Java
Session n
  • Wfshell.exe

Thursday, July 21, 2011

Citirx Licensing Concepts

Licensing Communication
An administrator must perform the following tasks for a license server to accept connection and license requests:
  • Add a license file to the license server
  • Configure the farm to use a specific license server
License Communication Process
The following steps describe the licensing communication process for checking out a license for a client device:
  1. A user connects to Farm A.
  2. A server in Farm A requests a license from License Server 1.
  3. License Server 1 grants the requests and checks out a license for the client device.
  4. The same users connects to Farm B.
  5. A server in Farm B requests a license from License Server 1.
  6. License Server 1 grants the requests and uses the existing license for the client device.
License Types
XenApp uses concurrent user licenses, which are licenses that are not tied to specific users.
When a server requests a license, it is reserved for a specific client device/user combination. When the user logs off from the session, the license is returned to the license pool and made available for another user. Users connecting from multiple devices will consume multiple licenses.


Microsoft Remote Desktop Services
XenApp extends the functionality of Microsoft Remote Desktop Services (formerly Terminal Services), which is a presentation virtualization platform for Windows Server.
XenApp 6 leverages Windows Server 2008 R2 security enhancements and Remote Desktop Services architecture to add dimensions of flexibility, manageability, security and Performance.

Remote Desktop Licensing
Administrators must configure a Remote Desktop Licensing server in the environment to distribute Remote Desktop licenses.
To avoid adding the Remote Desktop Licensing server to each new Remote Desktop Services server that joins the domain, administrators can configure an Active Directory group policy to automatically assign the Remote Desktop Licensing server to each new server that joins the domain.

Additional Licensing Considerations
Include the following:
  • Different connections can consume multiple licenses.
  • Most application manufacturers require user licenses for their products 
License Administration Console
The License Administration Console is a required, web-based interface that allows an administrator to maintain the license server and manage license files for that license server.
The console can be used to perform the following actions:
  • Tracking license usage
  • Reporting on current license usage
  • Configuring license alerts
  • Configuring delegated administrators


Installing Licensing
It is a best practice to install the license server first. If licensing is installed after XenApp, a policy must be configured to point to the license server.
Licensing can exist on a separate server or can share a server with another component.

Uninstalling Licensing
An administrator may needto uninstall licensing for a variety of reasons, including moving the component to another system or renaming the system. Some of the files are not deleted, such as the license file.
When the license file is moved to a server with a different name from the current hostname, the license file must be returned to Citrix and exchanged for a license file that indicates the new server name.

License Server Considerations
Additional considerations include the following:
• XenApp does not need to be on the same system as the license server.
• For fewer than 200 product servers, a shared license server is recommended


License File Management
License files store the company license information in a plain text format with authenticated content. Each license file can store information for one or more licenses; a license server can store one or more license files.
The license file is stored on a license server in the
%PROGRAMFILES%\CITRIX\LICENSING\MYFILES\ Directory

Subscription Advantage
Citrix products include a one-year membership to Subscription Advantage. This membership provides major releases minor releases and product update downloads through the MyCitrix web site. The membership includes email notifications concerning the account and new items available for members. Members can view, update and obtain benefit information and privileges on MyCitrix at any time.

High Availability Considerations
A duplicate license server is one option for creating a backup license server. The backup license server must duplicate such essential information as the hostname and the server IP
address. This is especially important if the farm or servers are pointing to an IP address instead of the server name to resolve to the license server.

Additional License Server Processes
Additional License Server processes include:
• Enabling a replacement license server
• Connecting to a different license server
• Replacing the license server

License Server Clustering
Licensing provides administrators with a 30 day recovery grace period. To ensure high availability of the license server beyond the 30 day recovery grace period, licensing supports Microsoft clustering. Clustering the license server provides users with continuous access to applications in failure situations.

Setting Multipathing Policies for LUNs


The following multipathing policies are currently supported:
Fixed — The ESX Server host always uses the preferred path to the disk when that path is available. If it cannot access the disk through the preferred path, then it tries the alternate paths. Fixed is the default policy for active/active storage devices.
Most Recently Used — The ESX Server host uses the most recent path to the disk until this path becomes unavailable. That is, the ESX Server host does not automatically revert back to the preferred path. Most Recently Used is the default policy for active/passive storage devices and is required for those devices.
The ESX Server host automatically sets the multipathing policy according to the make and model of the array it detects. If the detected array is not supported, it is treated as active/active. For a list of supported arrays, see the SAN Compatibility Guide.

Note: Manually changing Most recently used to Fixed is not recommended.

To Set the Multipathing Polices 
  • Log into the VMware VI Client, and select a server from the inventory panel.
  • Click the Configuration tab, and click Storage (SCSI, SAN, and NFS) under hardware.
  • From the list of configured datastores, select the datastore whose paths you want to view or configure, and click Properties.
The Volume Properties dialog box for this datastore opens.
  • The Extent Device panel includes information on the status of each path to the storage device. The following path information appears:
          Active- The path is working and is the current path being used for transferring data.
          Disabled – The path has been disabled and no data can be transferred.
          Standby – The path is working but is not currently being used for transferring data.
          Dead-  The software cannot connect to the disk through this path.
  • Click Manage Paths to open the Manage Paths wizard.
If you are using path policy Fixed, you can see which path is the preferred path. The preferred path is marked with an asterisk (*) in the fourth column.

The Manage Paths wizard shows the list of different paths to the disk, with the multipathing policy for the disk and the connection status for each path. It also shows the preferred path to the disk.  
 
  • Under the policy Click change
 
Select one of the following options:
  • Fixed
  • Most RecentlyUsed
Click OK, and click Close to save your settings and return to the Configuration page.