- PowerCLI Cookbook
- Philip Sellers
- 394字
- 2021-07-23 20:04:47
Joining an ESXi host to vCenter
Joining an ESXi host to vCenter is done from vCenter. The cmdlets for adding a host to a vCenter installation all require communication with vCenter. In this section, we'll connect to vCenter and add the host into inventory. All additional configuration to vCenter from PowerCLI will be covered in the next chapter.
Getting ready
Open a new PowerCLI window. This will ensure that no variables are populated and no open connection to an ESXi is lingering.
How to do it…
In this example, you will connect to a vCenter Server instead of directly connecting to an ESXi host. Our vCenter server has the hostname: vcentersrv.domain.local
.
- To connect to vCenter, use the same cmdlet that you used in the Connecting to an ESXi host or a vCenter instance recipe:
$vcenter = connect-viserver vcentersrv.domain.local
- Once connected to vCenter, you can use the
Add-VMHost
to add the host into inventory:Add-VMHost -Server $vcenter -Name esxsrv1.domain.local -Location "Primary"
- When prompted, enter the administrative account credentials for the ESXi to perform the
join
operation. - The host is now added to vCenter Server and can be administered by the server.
How it works…
Joining an ESXi to vCenter is a simple cmdlet to configure and complete. It simply links the ESXi into vCenter so that all of the additional configuration and control will be directed from the vCenter host.
At this point, connecting to the ESXi host will display a message in the GUI clients that shows it's being managed by vCenter and that all changes should be made through vCenter. That is mostly the case from PowerCLI too, but there might be additional times when configuration needs to be made directly against a host. One example would be to change multipathing settings for storage.
See also
- The Creating a virtual datacenter in vCenter, Creating a cluster and adding ESXi hosts, and Setting cluster advanced features, including HA, DRS, and EVC recipes in Chapter 2, Configuring vCenter and Computing Clusters
- C#高級編程(第10版) C# 6 & .NET Core 1.0 (.NET開發(fā)經(jīng)典名著)
- 從零開始:數(shù)字圖像處理的編程基礎與應用
- Visual C++程序設計學習筆記
- ReSharper Essentials
- JavaScript高效圖形編程
- Python Game Programming By Example
- TypeScript項目開發(fā)實戰(zhàn)
- C語言課程設計
- Java零基礎實戰(zhàn)
- 測試工程師Python開發(fā)實戰(zhàn)
- C++ Windows Programming
- AngularJS by Example
- Learning SaltStack(Second Edition)
- Mastering MeteorJS Application Development
- C++游戲設計案例教程