Virtual Centre: Difference between revisions
m (→Troubleshooting: Added "Virtual Machine won't export") |
(→SQL Database: Added SQL maintenance) |
||
Line 84: | Line 84: | ||
# Login using the VI Client and ensure everything looks good (clusters, ESX's, VM's, Alarms, Guest Customisations etc) | # Login using the VI Client and ensure everything looks good (clusters, ESX's, VM's, Alarms, Guest Customisations etc) | ||
=== SQL Database Maintenance === | |||
''Summary of maintenance info from http://www.vmware.com/files/pdf/vc_microsoft_sql_server.pdf'' | |||
====Index Fragmentation==== | |||
'''This maintenance procedure can be performed inline (ie without stopping the DB or VirtualCenter)''' | |||
# Log into the SQL database using Query Analyser | |||
## Run up SQL Query Analyzer, and log into the SQL server | |||
# Perform query to check the level of fragmentation (may take 2 mins or so to run). Create and execute the following query; | |||
#* <code> USE DB </code> (replace DB with whatever the database is called | |||
#* <code> GO </code> | |||
#* <code> DBCC SHOWCONTIG (VPX_HIST_STAT,VPXII_HIST_STAT) </code> | |||
#* <code> GO </code> | |||
# Check the query results for either of the following bad conditions | |||
#* Scan Density < 90% | |||
#* Logical Scan Fragmentation > 10% | |||
# If required, perform defragmentation by running the following query (will take some time depending on level of fragmentation) | |||
#* <code> DBCC INDEXDEFRAG ('DB', 'VPX_HIST_STAT', 'VPXII_HIST_STAT') </code> | |||
#* <code> GO </code> | |||
# Reheck the level of fragmentation using the following query (if Logical Scan Fragmentation is still > 30%, then may need to do reindex) | |||
#* <code> DBCC SHOWCONTIG (VPX_HIST_STAT,VPXII_HIST_STAT) </code> | |||
#* <code> GO </code> | |||
# Update the statistics to continue providing accurate metrics, use the following query; | |||
#* <code> UPDATE STATISTICS VPX_HIST_STAT WITH FULLSCAN </code> | |||
#* <code> GO </code> | |||
You may occasionally encounter a deadlock issue that causes the INDEXDEFRAG session to | |||
terminate. If the session terminates in this way, there is no adverse impact on the database, and the | |||
database continues running normally. You can issue the INDEXDEFRAG command again and the operation | |||
resumes where it left off. | |||
====Index Reindexing==== | |||
'''This maintenance procedure can only be performed with the database offline, the VirtualCenter Server Service must be shutdown''' | |||
# Perform query to check the level of fragmentation (may take 2 mins or so to run). Create and execute the following query; | |||
#* <code> USE DB </code> | |||
#* <code> GO </code> | |||
#* <code> DBCC SHOWCONTIG (VPX_HIST_STAT,VPXII_HIST_STAT) </code> | |||
#* <code> GO </code> | |||
# Check the query results for either of the following bad conditions | |||
#* Scan Density < 70% | |||
#* Logical Scan Fragmentation > 30% | |||
# Stop the VirtualCenter Server Service | |||
# Reindex the table by running this query; | |||
#* <code> DBCC DBREINDEX ('VPX_HIST_STAT', '', 70) </code> | |||
#* <code> GO </code> | |||
# Once complete, restart the VirtualCenter Server Service | |||
===Other Tasks=== | |||
Its also possible to delete old data from the database, this is achieved by running a script against the database, see http://kb.vmware.com/kb/1000125 for further info. | |||
== Troubleshooting == | == Troubleshooting == |
Revision as of 10:48, 6 April 2010
General Configuration
Sysprep Setup
The following Sysprep support directories were created during Virtual Center installation, these need to be populated in order for the VC to be able to sysprep VM's as they are deployed using Guest Customisation:
<ALLUSERSPROFILE>\Application Data\Vmware\VMware VirtualCenter\sysprep ...\1.1\ ...\2k\ ...\xp\ ...\svr2003\ ...\xp-64\ ...\svr2003-64\
where <ALLUSERSPROFILE>
is usually C:\Documents And Settings\All Users\
. Windows 2008 (and Vista) don’t need sysprep files as the function is built into the OS.
Download the ‘System Preparation Tool’ or ‘Deployment Tools’ package that contains ‘sysprep’ from the Microsoft download centre. Make sure that you download the correct version for the guest operating system and ‘Service Pack’ that you want to customize.
1.1: In the case of the generic version 1.1 simply run the downloaded executable to extract the files then copy the contents of the Tools directory into the appropriate directory (see below).
Windows 2000: In the case of Windows 2000 simply run the downloaded executable to extract the files into the appropriate directory (see below).
Win XP: In the case of XP run the downloaded executable to create deploy.cab then use something like WinZip to extract the files into the appropriate directory (see below).
Windows 2003: In the case of Windows 2003 the downloaded executable is a Hot Fix which must be run (Installed) on a matching OS to create deploy.cab then use something like WinZip to extract the files into the appropriate directory (see below).
TomCat Memory Throttle
The Tomcat webserver (used to provide VC Web-services), can be very memory hungry (up to 1GB) in comparison to when it ran on VC v2.5 (normally around 50MB). This can be throttled down, though this is only recommended for small, non-production installations (<10 ESX's).
- Edit the registry to put a ceiling on the Java VM's memory usage
- Append
--JvmMx=256
(MB) to end ofHKLM\SYSTEM\CurrentControlSet\Services\vctomcat\ImagePath
- Append
- Restart the service
VMware VirtualCenter Management Webservices
Update Manager
Import updates from another VC
Useful when you've a isolated VC (without internet access), and another with a full compliment of updates.
- Copy the updates from to the VC, copy the entire Data directory
- Default location for updates
C:\Documents and Settings\All Users\Application Data\VMware\Vmware Update Manager\Data
- Default location for updates
- On the isolated VC, run a version of the following example command to update the Update Manager database
vmware-updateDownloadCli -p <path to patches>\Data -f esx -U <user ac>
Scan/Remediate fails
- Error: VMware Update Manager had a failure
- Detail: Patch metadata for <ESX> missing, please download patch metadata first, despite the fact that Update Manager is fully up to date.
/var/log/vmware/esxupdate.log
shows connection errors
- On the VC, stop the VMware Update Manager Service
- Edit vci-integrity.xml file
- Normally found in
C:\Program Files\VMware\Infrastructure\Update Manager\
- Normally found in
- Edit the following entry, adding the VC IP address
<PatchDepotUrl>http://VC-IP/vci/hostupdates/hostupdate</PatchDepotUrl>
- Restart the VMware Update Manager Service
SQL Database
Migrate SQL2000 to SQL2005
This should be fairly painless (so long as your DBA knows his stuff!).
Before you start, you must ensure the Virtual Centre is using a SQL Native Client driver to access the database (see VMware KB1003391)...
- Open up ODBC Data Source Administrator, and go to the System DSN tab
- Check that the driver you're using is SQL Native Client
- If not, you'll need to upgrade...
- Download from Microsoft and install SQL (see the VMware KB link above)
- Stop your Virtual Centre Server service
- Rename your existing DSN (eg append "old" to it)
- Create a new DSN using the new driver but otherwise exactly the same as the previous (the name MUST be the same)
- Restart the Virtual Centre Server service
- Login using the VI Client and ensure everything looks good (clusters, ESX's, VM's, Alarms, Guest Customisations etc)
To complete the migration...
- Stop the Virtual Centre Server service
- Backup the database (and log files) from your old SQL 2000 server
- Restore the database (and log files) to your new SQL 2005 server
- Ensure that your Virtual Centre's database account is the db_owner of the Virtual Centre database on SQL 2005 (as it was on the SQL2000 database)
- Change the ODBC DSN settings on the VC server so it points to the SQL 2005 server (just change the server name, if you need to specify a non-standard TCP port use
<SERVER>, <PORT>
rather than<SERVER>:<PORT>
) - Restart the Virtual Centre Server service
- Login using the VI Client and ensure everything looks good (clusters, ESX's, VM's, Alarms, Guest Customisations etc)
SQL Database Maintenance
Summary of maintenance info from http://www.vmware.com/files/pdf/vc_microsoft_sql_server.pdf
Index Fragmentation
This maintenance procedure can be performed inline (ie without stopping the DB or VirtualCenter)
- Log into the SQL database using Query Analyser
- Run up SQL Query Analyzer, and log into the SQL server
- Perform query to check the level of fragmentation (may take 2 mins or so to run). Create and execute the following query;
USE DB
(replace DB with whatever the database is calledGO
DBCC SHOWCONTIG (VPX_HIST_STAT,VPXII_HIST_STAT)
GO
- Check the query results for either of the following bad conditions
- Scan Density < 90%
- Logical Scan Fragmentation > 10%
- If required, perform defragmentation by running the following query (will take some time depending on level of fragmentation)
DBCC INDEXDEFRAG ('DB', 'VPX_HIST_STAT', 'VPXII_HIST_STAT')
GO
- Reheck the level of fragmentation using the following query (if Logical Scan Fragmentation is still > 30%, then may need to do reindex)
DBCC SHOWCONTIG (VPX_HIST_STAT,VPXII_HIST_STAT)
GO
- Update the statistics to continue providing accurate metrics, use the following query;
UPDATE STATISTICS VPX_HIST_STAT WITH FULLSCAN
GO
You may occasionally encounter a deadlock issue that causes the INDEXDEFRAG session to terminate. If the session terminates in this way, there is no adverse impact on the database, and the database continues running normally. You can issue the INDEXDEFRAG command again and the operation resumes where it left off.
Index Reindexing
This maintenance procedure can only be performed with the database offline, the VirtualCenter Server Service must be shutdown
- Perform query to check the level of fragmentation (may take 2 mins or so to run). Create and execute the following query;
USE DB
GO
DBCC SHOWCONTIG (VPX_HIST_STAT,VPXII_HIST_STAT)
GO
- Check the query results for either of the following bad conditions
- Scan Density < 70%
- Logical Scan Fragmentation > 30%
- Stop the VirtualCenter Server Service
- Reindex the table by running this query;
DBCC DBREINDEX ('VPX_HIST_STAT', , 70)
GO
- Once complete, restart the VirtualCenter Server Service
Other Tasks
Its also possible to delete old data from the database, this is achieved by running a script against the database, see http://kb.vmware.com/kb/1000125 for further info.
Troubleshooting
VMware VirtualCentre Server service won't start
Service-specific error 2 (0x2)
- Caused by the SQL service being unavailable, therefore investigate why this is so.
If SQL is running on the same server, and the service failed after a reboot, its likely that its starting too quickly and SQL isn't ready. Either, make the service automatically restart after X mins (good practise anyway), and/or make the service depend on SQL.
To make the VirtualCentre Server service depend on the SQL service
- Find the name of the SQL service
- Find the MSSQL key in the following hive (will probably be MSSQL, MSSQL$SQLEXPRESS, etc)
HKLM\System\CurrentControlSet\Services
- Make VC service dependant on it
- Browse to
HKLM\System\CurrentControlSet\Services\vpxd
- Add the name of the SQL service to the
DependOnService
value (there must be a blank line at the end still)
- Browse to
Virtual Machine won't export
Failed to Export Virtual Appliance: An item with the same key has already been added
- Caused by VM being exported having a running snapshot.
To resolve
- Delete / Consolidate VM's snapshot(s)