Difference between revisions of "Lab Manager"

Jump to navigation Jump to search
5,042 bytes added ,  09:30, 19 July 2012
→‎Troubleshooting: Added "Unable to Export Configuration"
(Added "SOAP API")
(→‎Troubleshooting: Added "Unable to Export Configuration")
 
(13 intermediate revisions by the same user not shown)
Line 43: Line 43:
#* Must be a sub-folder, not a root
#* Must be a sub-folder, not a root
# Enter user/pass with Write rights on UNC share
# Enter user/pass with Write rights on UNC share
== Add ESX to Lab Manager ==
# Set up a new ESX as normal then within Lab Manager
# Go to '''Manage | Resources | Hosts''' and '''Prepare''' the hosts to install the Lab Manager agent on the ESX's
# Go to '''Manage | Resources | Physical Networks''' and add network bindings for each of the ESX's
# Go to '''Manage | Resources | Hosts''' and '''Enable''' the hosts
== Put Spanned ESX Host into Maintenance Mode ==
You can't put a Lab Manager enabled ESX directly into maintenance mode, if it's also enabled for host spanning.  The service VM (called something like <code>012345-VMwareLM-ServiceVM-I6-H78</code>) won't power-down or undeploy automatically (and it can't be migrated via vMotion as it needs to stay on its ESX to enable host-spanning).
# Deployed but powered off LM VM's can't be moved either, so any on the host have to be either powered on, or undeployed
# With DRS set to '''Fully Automated''', select '''Enter Maintenance Mode''' for your ESX host
# Once all deployed (non service) VM's have migrated off, put DRS to '''Partially Automated''' and '''''cancel'''''' the ''Enter Maintenance Mode'' task
# Then '''Disable''' the host in Lab Manager, and unselect the '''Enable host for Host Spanning''' to undeploy the service VM
#* In Lab Manager, go to Manage > Resources > Hosts tab to Disable, and go into the ESX's Properties to disable host spanning
# Finally, put the host in '''Maintenance Mode'''
Once your work is complete, take the host out of maintenance mode, enable for host spanning and as LM host, then put DRS back to Fully Automated.  Its worth manually vMotioning a Lab Manager deployed VM onto the host to double check everything is back in full working order.


== Change a Deployed VM's Resources ==
== Change a Deployed VM's Resources ==
In theory a deployed VM's config shouldn't be changed, in reality its bound to be required at some point as a one off, but its quite limited on what can be acheived.   
In theory a deployed VM's config shouldn't be changed, in reality its bound to be required at some point as a one off, but its quite limited on what can be achieved.   


Any changes will be lost when the template is undeployed and its state not saved.  If this isn't wanted, or if its a regular occurrence, the VM templates should be edited (CPU and memory can be edited with Lab Manager, the VM doesn't need to be re-imported).
Any changes will be lost when the template is undeployed and its state not saved.  If this isn't wanted, or if its a regular occurrence, the VM templates should be edited (CPU and memory can be edited with Lab Manager, the VM doesn't need to be re-imported).
Line 51: Line 69:
* '''Memory''' - Update the deployed VM's config through vCentre
* '''Memory''' - Update the deployed VM's config through vCentre
* '''Network''' - Update the deployed VM's config through vCentre
* '''Network''' - Update the deployed VM's config through vCentre
* ''Disk - Can't be changed, a deployed template is a delta from the original template (think snapshotting), you must reconfigure the template''
* ''Disk - Can't be changed easily, a deployed template is a delta from the original template (think snapshotting), you must reconfigure the template.  Additional disks can be added to an undeployed machine''
 
=== Increasing Disk Size ===
# In the config, shutdown the VM
# Once shutdown, select '''Add to VM templates...'''
# Select '''Export...''' to copy the VM to a normal VM, then delete it
# Locate the VM in vCentre and modify as required
# Boot the VM up, extend the disk, and shutdown
# In Lab Manager, import the VM, and publish
# In the config, delete the VM, and then add the modified template in


== Move to a new Datastore ==
== Move to a new Datastore ==
Line 75: Line 102:


== SOAP API ==
== SOAP API ==
As of 2010, there is no [[Power_Shell|PowerShell]] or [[PowerCLI]] interface into Lab Manager.  There is an underlying SOAP interface (on which a PowerCLI interface would be built), which provides limited interaction.  This can be utilised via PowerShell scripts.
As of 2010, there is no [[:Category:PowerShell|PowerShell]] or [[:Category:PowerCLI|PowerCLI]] interface into Lab Manager, and there is unlikely to be one now that Lab Manager is going end of life.  There is an underlying SOAP interface (on which a PowerCLI interface would be built), which provides limited interaction.  This can be utilised via PowerShell scripts.


The functions below were taken from http://poshcode.org/753, note that whilst you can connect to the Lab manager web service without explicitly supplying a user/pass (assuming the logged in user has access), you do need credentials in order to be able to create the Authentication Header that's required for all API calls.  I tend to store a local copy of my user/pass (see [[Power_Shell#Store_Password_Securely|Store Password Securely]]) to make this less of a chore.
The functions below were taken from http://poshcode.org/753, note that whilst you can connect to the Lab manager web service without explicitly supplying a user/pass (assuming the logged in user has access), you do need credentials in order to be able to create the Authentication Header that's required for all API calls.  I tend to store a local copy of my user/pass (see [[Power_Shell#Store_Password_Securely|Store Password Securely]]) to make this less of a chore.
Line 140: Line 167:
</source>
</source>


=== Configuration IP's Lister ===
* '''[[Lab Manager Configuration IP List]]'''
The above script allows you to generate a email showing the external (NATed) addresses of a configuration.
=== Configuration IP's Lister and RDP Tester ===
* '''[[Lab Manager Config IP List and RDP Test]]'''
The above script is really a version 2 of [[#Configuration_IP.27s_Lister|Configuration IP's Lister]] which still allows you to generate a email showing the external (NATed) addresses of a configuration, but also allows you to test RDP access to all your VM's within the config.


== Troubleshooting ==
== Troubleshooting ==
Line 148: Line 182:
# Locate the problem network and go to '''Properties'''
# Locate the problem network and go to '''Properties'''
# Update the '''Physical Network Bindings''' for the relevant ESX
# Update the '''Physical Network Bindings''' for the relevant ESX


'''Unable to deploy VM ''VM'' in VirtualCenter. The session is not authenticated.'''<br>
'''Unable to deploy VM ''VM'' in VirtualCenter. The session is not authenticated.'''<br>
Line 156: Line 191:
# Go to the VirtualCentre tab
# Go to the VirtualCentre tab
# Click on '''OK''' to re-apply the user/pass
# Click on '''OK''' to re-apply the user/pass
'''''ESX'' does not support virtual machine hardware version "0"'''<br>
Caused by config data corruption, potentially from the machine's VMX file
# Locate the VM's config and confirm the hardware version is set correctly (eg to v7 for ESX4)
#* <code> virtualHW.version = "7" </code>
# Go into the SQL database on the Lab Manager server, perform the following queries to confirm the VM's affected and correct
#* <code> SELECT dir_id, name, hw_version FROM VirtualServer WHERE hw_version=0 </code>
#* <code> UPDATE VirtualServer SET hw_version=7 WHERE hw_version=0 </code>
#* <code> UPDATE VirtualServer SET hw_version=<correctNumber> WHERE hw_version=0 AND name='VirtualMachineName' </code>
# The VM then needs to be cloned to template and then redeployed (clone required to prevent reoccurrance)
'''vCenter Lab Manager timed out trying to read the virtual machine's file on the remote host'''<br>
Caused by either of...
* The ESX experiencing problems reading the files of the VM (and its parents) on VMFS storage
*# Check out VMFS storage!
* The VM is still partially running on an ESX (so its files are locked)
*# Run the following command on the likely ESX(s) to running VM processes
*#* <code> ps auxwww | grep -i vmx </code>
*# Kill the relevant processes, eg
*#* <code> 7135117 7179577 mks:001876-VM-Server-A /bin/vmx </code>
*#* <code> 7180174 7179577 vcpu-0:001876-VM-Server-A /bin/vmx </code>
*#* <code> 7180175 7179577 vcpu-1:001876-VM-Server-A1 /bin/vmx </code>
*#* Run <code> kill 7179577 </code>


=== Lab Manager Disconnected from ESX ===
=== Lab Manager Disconnected from ESX ===
Check/restart the Lab Manager agent service that runs on the ESX...
Check/restart the Lab Manager agent service that runs on the ESX...
* <code> service vsla-agent status </code>
* '''ESX3'''
** <code> service vsla-agent status </code>
** <code> service vsla-agent restart </code>
* '''ESX4i'''
** <code> /etc/opt/init.d/vslad status </code>
** <code> /etc/opt/init.d/vslad restart </code>


If Lab Manager keeps dropping the connection to the ESX, check activity in the Virtual Centre.  If an ESX is continually being instructed to complete tasks that fail you need to consider restarting that ESX.
If Lab Manager keeps dropping the connection to the ESX, check activity in the Virtual Centre.  If an ESX is continually being instructed to complete tasks that fail you need to consider restarting that ESX.
=== Unable to Export Configuration ===
Export of a configuration to full fat VM's fails...
* Lab Manager shows...
** '''VirtualMachine.clone task on CloneVM_Task failed'''...
* vCenter also shows...
** '''Incompatible device backing specified for device 'x'.''' for the affected VM's Clone virtual machine task
Suspect the problem is caused by a problem with the VM's config file (VMX) - to work around, create a clone of the configuration and then export from that clone.


=== Unable to Enable Datastore ===
=== Unable to Enable Datastore ===
Line 177: Line 251:
###* LM4: <code> osql -S localhost\labmanager -E </code>
###* LM4: <code> osql -S localhost\labmanager -E </code>
#* To move a VM folder up a level use <code> mv 1234 ../ </code>
#* To move a VM folder up a level use <code> mv 1234 ../ </code>
'''''INCOMPLETE !!'''''


[[Category:VMware]]
[[Category:VMware]]
[[Category:Lab Manager]]

Navigation menu