Chinaunix首页 | 论坛 | 博客
  • 博客访问: 661807
  • 博文数量: 291
  • 博客积分: 10025
  • 博客等级: 上将
  • 技术积分: 2400
  • 用 户 组: 普通用户
  • 注册时间: 2004-12-04 12:04
文章分类

全部博文(291)

文章存档

2008年(102)

2007年(112)

2006年(75)

2004年(2)

我的朋友

分类:

2007-11-13 16:44:32

Tip List:
Networking:




ESX Server:












Troubleshooting:



VirtualCenter:







Virtual Machine:















-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Networking:


How does network traffic route on vSwitches?
Same vSwitch network traffic stays within the server and travels at the speed of the subsystem. Virtual Switches allow VM guest communication over the switch at maximum bus/processor capability which on current hardware technology should easily exceed 100Mbps.

Same vSwitch is 'Routed Locally' doesn't hit any pNICs

Same vSwitch different PortGroup/VLAN same thing is 'Routed Locally' doesn't hit any pNICs

Between different vSwitches is 'Routed Externally' ie needs to leave one pNIC and come in the other pNIC of the other vSwitch.

How can I display what VLAN tags are configured on a physical switch that my ESX server connects to?
You can see this in the VI client by clicking on the Configuration tab, and then Network Adapters. If you hover the mouse over the "Networks" field of any row in the table and your upstream switch is configured with VLAN tags you will see a whole list of VLAN tags that have been sniffed off of the network.

A better more accurate way to do this via the Service Console is with the esxcfg-info command. The Vlans and networks are listed under the network hint for each adapter. You can type esxcfg-info -n | grep -E -i "_name|Hint" to see a list of all of the network hints for each adapter.
 
If you want to display what is configured on the ESX vSwitch side you can type esxcfg-vswitch –l to display this.

How can I set a static MAC address for my VM?
This is useful for software that is licensed by the MAC address of the server it is running on or if you migrate a physical server to virtual and want to keep the same MAC address. A VM’s MAC address will change if the location of the VM changes, ie. different path on the same host. During a hot migration (Vmotion) the location of the VM does not change, this is also true of a VM that changes hosts due to HA/DRS migration. During a cold migration the location of the VM does change so the MAC address of the VM will change.

MAC addresses are hex values and consist of six groups of hex numbers. The first 3 octets of the MAC address is a unique code assigned to each NIC vendor, this is also called the Organizationally Unique Identifier (OUI), VMware’s OUI is “00:50:56”. The last 3 octets are assigned to all of the NIC’s for that vendor. Each MAC address must be unique to avoid conflicts with other network devices. You do not have to use the VMware assigned range (00:50:56) for your NIC’s. If you are coming from a physical server you can use the previous NIC’s range instead, (ie. HP/Compaq NIC’s use 00:08:02) as the first 3 octets. Just make sure the physical NIC and virtual NIC with the same MAC address are not active on the same physical network at the same time. There are several methods for setting a static MAC address on a VM which are listed below. If you use the first method you must stay inside VMware’s allowed MAC addresses (00:50:56:00:00:00 – 00:50:56:3F:FF:FF) or the VM will not start

Editing the VMX file of the VM:
• Edit the VMX file of the VM
• Change the following line from ethernetN.addressType="vpx" to ethernetN.addressType="static" (N is the number of your ethernet adapter, usually 0)
• Next change the line “ethernetN.GeneratedAddress” to “ethernetN.address” and then change the current MAC address to “00:50:56:XX:YY:ZZ” (again N is the number of your ethernet adapter and XX is a valid hex number between 00 and 3F, and YY and ZZ are valid hex numbers between 00 and FF. The value for XX must not be greater than 3F in order to avoid conflict with MAC addresses that are generated by the VMware Workstation and VMware GSX Server products.)
• Power your VM back on. Login to the OS, go to the CMD prompt and type “ipconfig /all”, your manually assigned MAC address should be listed for the NIC that you changed

Setting the NIC properties in Windows:
• Edit the Local Area Connection propeties for the NIC you want to change
• Click the Configure button next to the NIC name
• On the Advanced tab select NetworkAddress
• In the Value field enter a new value for the MAC address, enter only numbers or letters, no spaces, dashes or colons. This MAC address can be any valid hex numbers between 00 and FF for any of the octets
• Click OK and that’s it, the new MAC address takes effect immediately and will override any MAC address set by Vmware

ESX Server:

How can I specify an alternate location for VM snapshot files?
To specify a new directory or datastore for snapshot files follow the below procedure. When you specify a new working directory for a VM the vswp file that is created when the VM is powered on is also stored in that location. If your VM is on shared storage and you specify local storage as a location you will not be able to use Vmotion/HA/DRS.
• Power off your VM
• Login to service console
• Edit the VMX file of your VM with Nano or Vi
• Add a new line using the following syntax: workingDir = "/vmfs/volumes/SnapVolume/Snapshots/"
• Optionally if you want your vswp file to stay in the VM’s directory add the following line to the VMX file: sched.swap.dir = "/vmfs/volumes/VM-Volume1/MyVM/" (You do not need to worry about updating the existing “sched.swap.derivedName” parameter, it is generated by the VM and written to the config file each time the VM powers on.)
• Power on your VM, your vswp, vmsn and snapshot (delta-vmdk) files will now be located in this directory

How do I create an account so I do not have to use root?
This is the more secure way of logging into ESX without using the root account. You can create a user to do this using either the VI client or the Service Console. The VI Client is more difficult because it will not allow you to set the UID of the new user to 0 and will not let you ignore the password warnings like the Service Console will.

Service Console method:
• Login to service console
• Type “useradd sshuser” (or whatever username you want to use) to add the user
• Type “passwd sshuser” to set the password for this user
• Type “usermod –g root sshuser” to add the user to the root group
• Type “usermod –u 0 –o sshuser” to change the UID of the user to zero to match root

VI Client method:
• Start VI Client and connect to the ESX server directly instead of the VirtualCenter server, login as the root user
• Select the Users and Groups tab
• Right-click inside the Users view and select Add
• Enter a name for your user in the Login field, ie. sshuser. You can leave the User Name field blank
• Enter a password for the user (Password most be sufficiently complex and long enough or the create user operation will fail)
• Put a checkmark next to “Grant shell access for this user”
• Enter root in the Group field and click the Add button
• Login to service console
• Type “usermod –u 0 –o sshuser” to change the UID of the user to zero to match root

What are the ESX specific commands that can be used on the Service Console?
Below is a list of the commands, more detail for using these commands can be found in the Server Configuration Guide (). In general (with a few exceptions) anything that can be done with these commands can also be done in the VI client, sometimes the situation requires doing these directly on the service console. Also Mike Laverick has put together a great guide on using a lot of these commands ()

Networking
Esxcfg-firewall – Configures the service console firewall ports
Esxcfg-nics – Prints a list of physical network adapters along with information on the driver, PCI device, and link state of each NIC. You can also use this command to control a physical network adapter’s speed and duplexing
Esxcfg-route – Sets or retrieves the default VMkernel gateway route
Esxcfg-vmknic - Creates and updates VMkernel TCP/IP settings for VMotion, NAS, and iSCSI
Esxcfg-vswif – Creates and updates service console network settings. This command is used if you cannot manage the ESX Server host through the VI Client because of network configuration issues
Esxcfg-vswitch – Creates and updates virtual machine (vswitch) network settings

Storage
Esxcfg-mpath - Configures multipath settings for your Fibre Channel or iSCSI disks
Esxcfg-nas – Manages NAS mounts. You use this command to add, delete, list, and change the attributes of NAS devices
Esxcfg-swiscsi – Configures your software iSCSI software adapter
Esxcfg-vmhbadevs – Prints a map of VMkernel storage devices to service console devices (no VI client equivalent)

General
Esxcfg-advcfg - Configures advanced options for ESX Server.
Esxcfg-auth – Configures authentication (no VI client equivalent)
Esxcfg-info - Prints information about the state of the service console, VMkernel, various subsystems in the virtual network, and storage resource hardware
Esxcfg-resgrp - Restores resource group settings and lets you perform basic resource group management
Esxcfg-upgrade - Upgrades ESX Server from ESX Server 2.x to ESX Server 3.x. This command is not for general use

Boot/diagnostic
Esxcfg-boot – Configures bootstrap settings (no VI client equivalent)
Esxcfg-dumppart - Configures a diagnostic partition or searches for existing diagnostic partitions
Esxcfg-init - Performs internal initialization routines (no VI client equivalent)
Esxcfg-linuxnet - Converts vswif to eth when booting ESX Server into service-console-only mode rather than into ESX mode (no VI client equivalent)
Esxcfg-module - Sets driver parameters and modifies which drivers are loaded during startup (no VI client equivalent)

How can I display disk/directory information on the Service Console?
Type “df –h” to show drives and space
Type “fdisk –l” to show physical drive information
Type “cat /proc/scsi/scsi” to show SCSI device information
Type “vdf –h” to show vmfs volumes and space
Type “ls –ltr” to show files and space

Why do my VMFS volumes have both a name and a long string of numbers and letters?
When you create a VMFS volume you are prompted for a name for it. This name is not what the Service Console uses to reference the volume, it is purely to make it easier for the user to identify the volume. The Service Console actually uses a unique identifier called a UUID to reference the volume. The name you specify when you create it is a user-defined device name which is a symbolic link to the UUID. This is done to solve the problem of changing the device name, when you change the name you are only changing the user-defined device name and not the UUID of the volume. So when you look in your /vmfs/volumes directory you will see both a UUID, ie. 4404e8b4-bcfd52fc-1e4b-0017a4a91076 and the symbolic link, ie. ServerA-Local. Clicking on the symbolic link simply takes you to the UUID directory, it is a lot easier to remember this then the long UUID of a volume.

For more on this see this link: http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/sysadmin-guide/ch-devlabel.html

How do I create a NFS volume on a Windows Server to use for storing ISO files for my VM’s?
You can do this if you have Windows 2003 Server R2 which has built-in NFS Services
• On the Windows 2003 Server make sure “Microsoft Services for NFS” in installed. If not you need to add it under Add/Remove Programs, Windows Components, Other Network File and Print Services
• Next go to folder you want to share and right-click on it and select Properties
• Click on the NFS Sharing tab and select “Share this Folder”
• Enter a Share Name, check “Anonymous Access” and make sure the UID and GID are both -2
• In VirtualCenter, select your ESX server and click the “Configuration” tab and then select “Storage”
• Click on “Add Storage” and select “Network File System” as the storage type
• Enter the Windows Server name, the folder (share) name and a descriptive Datastore Name
• Once it finishes the configuration you can now map your VM’s CD-ROM devices to this new VMFS volume

How do I manually install the VC management agent?
If after upgrading VirtualCenter you find some of your ESX hosts disconnected you can manually upgrade the management agent on the ESX server by following the below steps:
• First log into the ESX server console and check the version on the servers that are disconnected by typing “vpxa- v” The version needs to match the version of VirtualCenter being used. 
   - VC 2.0.1 build number is 32042
   - VC 2.0.1 build number is 32042
   - VC 2.0.1 Patch 1 build number is 33643
   - VC 2.0.1 Patch 2 build number is 40644
• Open the folder for the VC 2.0 installation. By default this will be "C:\Program Files\VMware\VMware VirtualCenter 2.0\upgrade"
• You need to use the correct file for different version of ESX server. You can find your answer in bundleversion.xml
   - 2.0.1+ = vpx-upgrade-esx-0-linux-*
   - 2.1.0+ = vpx-upgrade-esx-1-linux-*
   - 2.5.0 = vpx-upgrade-esx-2-linux-*
   - 2.5.1 = vpx-upgrade-esx-3-linux-*
   - 2.5.2 = vpx-upgrade-esx-4-linux-*
   - 2.5.3+ = vpx-upgrade-esx-5-linux-*
   - 3.0.0+ = vpx-upgrade-esx-6-linux-*
   - e.x.p = vpx-upgrade-esx-6-linux-*
• Copy file "vpx-upgrade-esx-y-linux-xxxxx" to your ESX host, where y and xxxxx are based on bundleversion.xml. xxxxx is the build number, ie. vpx-upgrade-esx-6-linux-40644. Use a secure copy utility such as WinSCP or PuTTY PSFTP to copy this file to the ESX server.
• Login to the ESX server as root.
• In the directory where you copied the upgrade bundle run the command: sh ./ vpx-upgrade-esx-y-linux-xxxxx (xxxxx is the build number)
• Once the install is complete run the command “service vmware-vpxa restart” followed by “service mgmt-vmware restart”
• Check the version again by typing “vpxa –v”, the version should now be the new version. Now open your VI Client, try to connect to the ESX host.

How can I find vmdk files that are orphaned from VM’s and old snapshot files?
• Login to service console
• Change to your /vmfs/volumes/ directory
• Type find -iname "*-flat.vmdk" -mtime +7 -ls to find –flat vmdk files that have not been modified in 7 days
• Type find -iname "*-delta.vmdk" -mtime +7 -ls to find snapshot files that have not been modified in 7 days

How do I create a ISO mount point that points to a Windows Server for storing ISO files for my VM’s?
You can create a mount point inside /vmimages so your VM’s can access ISO files when needed. You could just create a directory on your VMFS volume and copy them there but this takes valuable disk space away from the ESX server. You can also use this technique to create other mount points on the ESX server if you need to copy files from a Windows server to or from it for patches and other things.
• First you will have to open the firewall port in ESX by typing in the service console “esxcfg-firewall -e smbClient”. This opens outbound TCP ports 137 – 139 and 445.
• Next make sure the Local Security Policy on the Windows Server you are going to map to has the following settings under Security options. If you do not do this you may get a “Stale NFS Handle” or “Permission denied” error when trying to mount.
   - Microsoft network client - digitally sign communications (always) – DISABLED
   - Microsoft network client - digitally sign communications (if server agrees) – DISABLED
   - Microsoft network server - digitally sign communications (always) – DISABLED
   - Microsoft network server - digitally sign communications (if server agrees) – DISABLED
• Next type “cd /vmimages” and then “mkdir ISO”
• Next type “mount -t smbfs -o username= //windows server/share /vmimages/ISO” you can also use a windows domain username by typing “username=,workgroup=”
• You will be prompted for a password for the user account you are using.
• You can type “cd /vmimages/ISO” and do “ls” and you should see all your files. You can now map your VM’s CD-ROM using the Datastore ISO file device type and select the /vmimages/ISO folder.
• If you no longer need this mount point you can un-mount it by typing “umount /vmimages/ISO”
• To automatically have your ESX server mount this when it restarts do the following:
   - Edit /etc/fstab using Nano or Vi
   - Add the following line to the bottom of the file: “//windows server/share /vmimages/ISO smbfs noauto,username=,password= 0 0”
   - Edit /etc/rc.local using Nano or Vi
   - Add the following line to the bottom of the file “mount –a”

How can I login to my ESX server using Active Directory instead of a local Linux account?
PAM (Pluggable Authentication Modules) authentication gives you the ability to use your Active Directory passwords to login to the ESX Service Console. You still need to create a identical account on the ESX server but once you do that you can login using your AD password after PAM is configured. The advantage of this is password management, you do not have to manage ESX passwords separately and can leverage AD’s powerful account management features. Prior to setting this up you want to ensure that your ESX servers sync time from the same sources as your AD servers, if you use NTP on both systems then this should not be an issue. Kerberos is very sensitive to time variations and by default in AD environments  requires computer clocks to be synchronized within five minutes. If your ESX servers are not time synced with AD you will probably run into login issues (you will see clock skew too great errors in /var/log/messages). Below are the steps to set this up on the ESX server.

• Login to service console
• If you’re adding a user that does not exist in the Service Console you must first add it. Linux user accounts are stored in the etc/passwd file, you can open this file with Nano to see all the accounts that are created. Alternately you can load the VI client and connect directly to the ESX server and click the Users & Groups tab to see user accounts.
• To add a account type “useradd ” The username must match the samaccountname of the AD user. Alternately you can add the user using the VI client by clicking “Add” in the Users view.
• Next you need to enable PAM authentication in ESX, you use the esxcfg-auth command for this like below:
> esxcfg-auth -–enablead -–addomain=addomain.com -–addc=dcname.addomain.com -–krb5realm=addomain.com –-krb5kdc= dcname.addomain.com –-krb5adminserver= dcname.addomain.com
> “–-enablead” enables Active Directory authentication
> “—addomain” sets the Active Directory domain
> “--addc” sets the Active Directory domain controller, use this multiple times to add domain controllers for redundancy
> “—krb5realm” sets the Kerberos realm (AD domain)
> “—krb5kdc” sets the Kerberos Key Distribution Center (Domain Controller)
> “—krb5adminserver” sets the Kerberos Admin Server (Domain Controller)
• This takes effect immediately, log back in to the console and you should be able to use your AD password for that account. If you run into difficulty you can check the /var/log/messages file for errors. Also ensure that your ESX server can resolve the FQDN of the AD server you entered above.
• If you plan on logging in using the VI client directly to the ESX server you will first need to click on the Permissions tab in the VI Client and add a permission for the user.
• If you wish to disable this type “esxcfg-auth –-disablead”. Esxcfg-auth writes the configuration information to various files including /etc/krb5.conf

How can I display disk/directory information on the Service Console?
• Type “df –h” to show drives and space (no vmfs)
• Type “fdisk –l” to show physical drive information
• Type “cat /proc/scsi/scsi” to show SCSI device information
• Type “vdf –h” to show vmfs volumes and space
• Type “ls –ltr” to show files and sizes

Why did my all my VM's shutdown and restart when I restarted the mgmt-vmware service on the ESX console?
This behavior is caused by a nasty bug that was introduced in ESX 3.0.1. If you have Virtual Machine Auto Startups enabled on your ESX host and restart the mgmt-vmware service on the ESX service console it will cause all of your VM's on that host to shutdown and restart. This bug was fixed in the 5/15/07 ESX server patches. If you need to restart the mgmt-vmware service and do not have this patch you must disable Auto Startups first. Installing the patch will prevent this from happening.
Patch link:
KB Article:
My post on Vmtn (I got bit by this bug):

Troubleshooting:

How do I troubleshoot ESX server issues?
You can check several log files on the ESX server based on the problem you are experiencing, these include:
• Vmkernel - /var/log/vmkernel – records activities related to the virtual machines and ESX server
• Vmkernel Warnings - /var/log/vmkwarning – records activities with the virtual machines
• Vmkernel Summary - /var/log/vmksummary - Used to determine uptime and availability statistics for ESX Server; human-readable summary found in /var/log/vmksummary.txt
• ESX Server host agent log - /var/log/vmware/hostd.log - Contains information on the agent that manages and configures the ESX Server host and its virtual machines (Search the file date/time stamps to find the log file it is currently outputting to.)
• Service Console - /var/log/messages - Contain all general log messages used to troubleshoot virtual machines or ESX Server
• Web Access - /var/log/vmware/webAccess - Records information on Web-based access to ESX Server
• Authentication log - /var/log/secure - Contains records of connections that require authentication, such as VMware daemons and actions initiated by the xinetd daemon.
• VirtualCenter agent - /var/log/vmware/vpx - Contains information on the agent that communicates with VirtualCenter
• Virtual Machines - The same directory as the affected virtual machine’s configuration files; named vmware.log - Contain information when a virtual machine crashes or ends abnormally

How do I check my ESX & VirtualCenter versions?
• ESX Server
>Login to service console
>Type “vmware –v” – ie. “VMware ESX Server 3.0.1 build-32039”
>Type “esxupdate –l query” to see what updates are installed.
• ESX Server management agent
>Login to service console
>Type “vpxa –v” – ie. “VMware VirtualCenter Agent Daemon 2.0.1 build-40644”
• VirtualCenter Server
>Check VC Server log file with the latest date in C:\WINDOWS\Temp\vpx – ie. “Log for VMware VirtualCenter, pid=4928, version=2.0.1, build=build-40644”
>Optionally local the VI Client on the VirtualCenter server and select Help, then About.
• License Server
>On the License Server, load the Vmware License Server Tools (LMTools) client and select Help, About – ie. 10.13
>Optionally, right-click on either lmgrd.exe or lmtools.exe which is usually located in C:\Program Files\Vmware\Vmware License Server and select properties, then click on the Version tab and select “File Version”
• Virtual Infrastructure Client
>Load client
>Select Help from the top menu and then About Virtual Infrastructure – ie. “Version 2.0.1 Build 40644” this should match your VC Server
• Vmware Tools (on a VM)
>Right-click on icon inside VM
>Click on About tab – ie. “build-32039” this should match your ESX server version
• Vmware Tools (on a ESX Server)
>Login to service console
>Type “rpm –qa | grep VMware-esx-tools” – ie. “VMware-esx-tools-3.0.1-32039”

VirtualCenter:

How can I modify the ESX/VC UI web page?
It is not recommended to do this extensively because future product upgrades will overwrite the web files. Some people wish to remove the download links on the page or force a redirect directly to the login page.
• To modify the login page on the ESX server edit the 'index.html' file from within /var/lib/vmware/hostd/docroot
• To modify the login page on the VirtualCenter Windows server edit the ‘index.html’ in C:\Documents and Settings\All Users\Application Data\VMware\VMware VirtualCenter\docRoot
• To comment out the download links simply comment out the code. You must place your comment start and end tags in the right locations so the page works properly. Add and add --> after the second tag to comment out the two download links under getting started. Remember to always make a backup copy of the index.html before editing it.
• To set the main UI page to automatically re-direct to the login page then add the following line at the beginning of the index.html file o o If you do not want the main page to show before the redirect either delete all the other code in the file or add a at the very bottom of the file, this comments ouot all the code in the file except the first line.

How do I register an existing Virtual Machine in VirtualCenter?
If you have an existing VM that was removed from VirtualCenter and just need to add it back in then follow the below steps
• Select the ESX server in the VirtualCenter that the VM files are located on
• On the summary tab right-click on the datastore that the VM files are located on and click “Browse Datastore”
• Select the folder that the VM files are located in
• Right-click on the VMX file for the VM and select “Add to Inventory”
• Select a name and location for the VM and click Next
• Select the Host or Cluster for the VM and click Next
• Select a Resource Pool and click Next
• Click Finish and the VM will now appear in VirtualCenter

How does the HA (High Availability) feature work?
VMware HA continuously monitors all ESX Server hosts in a cluster and detects failures. An agent placed on each host maintains a "heartbeat" with the other hosts in the cluster and loss of a heartbeat initiates the process of restarting all affected virtual machines on other hosts. You create and manage clusters using VirtualCenter. The VirtualCenter Management Server places an agent on each host in the cluster so each host can communicate with other hosts to maintain state information and know what to do in case of another host's failure. (The VirtualCenter Management Server does not provide a single point of failure.) If the VirtualCenter Management Server host goes down, HA functionality changes as follows. HA clusters can still restart virtual machines on other hosts in case of failure; however, the information about what extra resources are available will be based on the state of the cluster before the VirtualCenter Management Server went down. HA monitors whether sufficient resources are available in the cluster at all times in order to be able to restart virtual machines on different physical host machines in the event of host failure. Safe restart of virtual machines is made possible by the locking technology in the ESX Server storage stack, which allows multiple ESX Servers to have access to the same virtual machines file simultaneously.

Host failure detection occurs 15 seconds after the HA service on a host has stopped sending heartbeats to the other hosts in the cluster. A host stops sending heartbeats if it is isolated from the network. At that time, other hosts in the cluster treat this host as failed, while this host declares itself as isolated from the network. By default, the isolated host powers off its virtual machines. These virtual machines can then successfully fail over to other hosts in the cluster. If the isolated host has SAN access, it retains the disk lock on the virtual machine files, and attempts to fail over the virtual machine to another host fails. The virtual machine continues to run on the isolated host. VMFS disk locking prevents simultaneous write operations to the virtual machine disk files and potential corruption.

If the network connection is restored before 12 seconds have elapsed, other hosts in the cluster will not treat this as a host failure. In addition, the host with the transient network connection problem does not declare itself isolated from the network and continues running. In the window between 12 and 14 seconds, the clustering service on the isolated host declares itself as isolated and starts powering off virtual machines with default isolation response settings. If the network connection is restored during that time, the virtual machine that had been powered off is not restarted on other hosts because the HA services on the other hosts do not consider this host as failed yet. As a result, if the network connection is restored in this window between 12 and 14 seconds after the host has lost connectivity, the virtual machines are powered off but not failed over.

For more information on HA see and and

How can I purge old statistic data from the VirtualCenter database?
The size of the Statistics database (VPX_HIST_STAT) will vary based on the number of hosts & VM’s managed, frequency of performance data collection, collection level and type of database. Each stat sample collected is about 60 bytes for SQL, 100 bytes for Oracle, and each event stored is 1600 bytes for SQL, 600 bytes for Oracle. Using default settings, the statistical data for 25 hosts running 8-16 VMs per host will plateau around 40-60 MB in a year (80-140 MB if set to “full”). Each month, the average number of events generated will also consume about 190 MB in SQL, and 70 MB in Oracle. Total DB size after a year is expected to be around 2.20 Gb in SQL, and 1.0 Gb in Oracle. Using default settings, the statistical data for 75 hosts running 8-16 VMs per host will plateau around 90-150 MB in a year (200-330 MB if set to “full”). Each month, the average number of events generated will also consume about 190 MB in SQL, and 70 MB in Oracle. Total DB size after a year is expected to be around 2.40 Gb in SQL, and 1.2 Gb in Oracle.

The statistic sample frequency and retention is specified in the VI client. Select Administration, VirtualCenter Management Server Configuration from the top menu then select Statistics. The default settings are:

• Past Day – 5 minutes per sample, 288 total samples
• Past Week – 15 minutes per sample, 672 total samples
• Past Month - 60 minutes per sample, 720 total samples
• Past Year – 1440 minutes per sample, 365 total samples

For example if you wanted to collect less statistical data you could change the settings to something like below:

• Past Day – 15 minutes per sample, 96 total samples
• Past Week – 60 minutes per sample, 168 total samples
• Past Month - 120 minutes per sample, 360 total samples
• Past Year – 1440 minutes per sample, 365 total samples

Or if you wanted to collect more statistical data you could change the settings to something like below (caution your database will be very large):

• Past Day – 1 minutes per sample, 1440 total samples
• Past Week – 5 minutes per sample, 2016 total samples
• Past Month - 30 minutes per sample, 1440 total samples
• Past Year – 60 minutes per sample, 8760 total samples

You can also delete any ones you do not want, for example if you only want a weeks worth of data then delete the Past Month and Past Year. Once the total samples number has been reached the older samples are automatically purged from the database. If you modify these values you must follow these rules:

• The new sampling period must be a multiple of a previous one. In the defaults you’ll notice that week (15) is a multiple of day (5), month (60) is a multiple of week(15) and year (1440) is a multiple of month (60).
• The new sampling length must be longer than a previous one. Week (15) is longer then day (5), etc.
• The user-specified name of the historical interval must be unique. (In case you add new ones)

Note: Existing data is reset (lost) when you change the interval configuration. However, only the data for that interval is reset. For example, if you change only the weekly time interval, the daily and monthly data are retained.

You can also specify the amount of statistical detail that is captured by setting the Statistic Collection Level. The default for this setting is Level 1 which includes basic metrics, it can be changed anywhere up to Level 4 which provides the most statistical detail but can significantly increase the size of the database and can cause additional performance overhead. You can also change the number of threads that are used for collecting performance statistics from managed hosts. Use multiple threads to increase the number of managed hosts and take advantage of the additional processor.


阅读(901) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~