Get-VMHost: Difference between revisions

No change in size ,  24 March 2009
no edit summary
(New page: NAME Get-VMHost SYNOPSIS Gets from a VMware Infrastructure server one or more virtual machine hosts. SYNTAX Get-VMHost [-Datastore <Datastore[]>] [-State <VMHostState...)
 
No edit summary
 
Line 1: Line 1:
NAME
=====NAME=====
     Get-VMHost
     Get-VMHost
      
      
Line 15: Line 15:
      
      
      
      
DETAILED DESCRIPTION
=====DETAILED DESCRIPTION=====
    Gets from a VMware Infrastructure server one or more objects that represent
Gets from a VMware Infrastructure server one or more objects that represent virtual machine hosts. Returns the set of virtual machine hosts that correspond to the filter criteria provided by the cmdlet parameters.  To specify a server different from the default one, use the -Server parameter.
    virtual machine hosts. Returns the set of virtual machine hosts that corre
 
    spond to the filter criteria provided by the cmdlet parameters.  To specify
When connected directly to an ESX host, the Name property of the returned VMHost object  contains either the DNS name of the host, or the IP of the ESX host, depending on which of them was specified when connecting with Connect-VIServer.
    a server different from the default one, use the -Server parameter.
    When connected directly to an ESX host, the Name property of the returned V
    MHost object  contains either the DNS name of the host, or the IP of the ES
    X host, depending on which of them was specified when connecting with Conne
    ct-VIServer.
      
      


Line 29: Line 24:
     -Datastore <Datastore[]>
     -Datastore <Datastore[]>
         If set, the command retrieves the virtual machine hosts associated with
         If set, the command retrieves the virtual machine hosts associated with
         one or more of the specified datastores. Passing values to this parame
         one or more of the specified datastores. Passing values to this parameter
         ter through a pipeline is deprecated and will be removed after one of t
         through a pipeline is deprecated and will be removed after one of the
         he following releases.
         following releases.
          
          
         Required?                    false
         Required?                    false
Line 51: Line 46:
          
          
     -Location <VIContainer[]>
     -Location <VIContainer[]>
         Specifies one or more virtual infrastructure container objects (e.g. fo
         Specifies one or more virtual infrastructure container objects (e.g. folders,
         lders, datacenters, clusters) to search for virtual machine hosts.
         datacenters, clusters) to search for virtual machine hosts.
          
          
         Required?                    false
         Required?                    false
Line 81: Line 76:
          
          
     -NoRecursion
     -NoRecursion
         Get-VMHost searches recursively from any provided starting point. Setti
         Get-VMHost searches recursively from any provided starting point. Setting
         ng this parameter disables the command recursive behavior.
         this parameter disables the command recursive behavior.
          
          
         Required?                    false
         Required?                    false
Line 92: Line 87:
     -Server <VIServer[]>
     -Server <VIServer[]>
         A VMware Infrastructure server to apply the command on. If no value is  
         A VMware Infrastructure server to apply the command on. If no value is  
         given to this parameter, the command takes the server currently specifi
         given to this parameter, the command takes the server currently specified
         ed in the $DefaultVIServer variable.
         in the $DefaultVIServer variable.
          
          
         Required?                    false
         Required?                    false
Line 102: Line 97:
          
          
     -VM <VirtualMachine[]>
     -VM <VirtualMachine[]>
         Specifies one or more virtual machines running on the virtual machine h
         Specifies one or more virtual machines running on the virtual machine hosts
         osts retrieved by the command.
         retrieved by the command.
          
          
         Required?                    false
         Required?                    false
Line 112: Line 107:
          
          
     -ResourcePool <ResourcePool[]>
     -ResourcePool <ResourcePool[]>
         Specifies one or more resource pools associated with the standalone vir
         Specifies one or more resource pools associated with the standalone virtual
         tual machine hosts retrieved by the command.
         machine hosts retrieved by the command.
          
          
         Required?                    false
         Required?                    false
Line 135: Line 130:
      
      
      
      
NOTES
=====NOTES=====
      
      
      
      
        When connected directly to ESX, the Name property of the returned VMHos
When connected directly to ESX, the Name property of the returned VMHost object  contains either the DNS name of the host, or the IP of the ESX, depending on which of them was specified when connecting with Connect-VIServer.
        t object  contains either the DNS name of the host, or the
        IP of the ESX, depending on which of them was specified when connecting
        with Connect-VIServer.
      
      
     --------------  Example 1 --------------
     --------------  Example 1 --------------
      
      
     C:\PS>Get-VMHost -Location (Get-Datacenter -Name New) -VM (Get-VM -Name "MS
     C:\PS>Get-VMHost -Location (Get-Datacenter -Name New) -VM (Get-VM -Name "MS Win XP SP2") | fl
    Win XP SP2") | fl
      
      
   
Retrieves the virtual machine host, which is located in the New datacenter and on which the MS Win XP SP2 virtual machine is hosted.
    Retrieves the virtual machine host, which is located in the New datacenter  
    and on which the MS Win XP SP2 virtual machine is hosted.
      
      
      
      
Line 160: Line 149:
      
      
      
      
RELATED LINKS
=====RELATED LINKS=====
     [[Remove-VMHost]]
     [[Remove-VMHost]]
     [[Move-VMHost]]
     [[Move-VMHost]]
     [[Set-VMHost]]
     [[Set-VMHost]]
     [[Add-VMHost]]
     [[Add-VMHost]]
[[Category: Powershell]][[Category: VI-Toolkit]]
1,274

edits