VMware Cloud Community
Yassir_bout
Enthusiast
Enthusiast

AutoDeploy & Customize Hosts Profile with PowerCli

Hi,

I'm working on AutoDeploy PoC. I want to right a PowerCli scipt to automate the addition of the distributed switch in new hosts add with AutoDeploy.

Right now, I'm able to install ESXi, add the new host in the right cluster and apply the host profile with  AutoDeploy.

I just have to write a script to automate the addition of the distribueted switch.

Any help please  ????

Screenshot - 2018-03-02 , 15_58_09.png

Preparation

==========

Configure DHCP server (option 66 & 67)

Configure TFTP server

Configure the DNS server

Commande PowerCli

====================

Set-Executionpolicy Unrestricted

Connect-VIServer -Server "nom du serveur vCenter" 

Add-EsxSoftwareDepot C:\TFTPRoot\ESXi600-201711001.zip

Get-EsxImageProfile

$os = Get-EsxImageProfile -Name "ESXi-6.0.0-20171104001-standard"

New-DeployRule -Name "Default" -Item $os -Pattern "mac=90:e2:ba:74:8c:f4"

Set-DeployOption "vlan-id" 941

New-DeployRule -Name "ClusterAtelier" -Item ClusterAtelier -Pattern "mac=90:e2:ba:74:8c:f4"

New-DeployRule -Name "HP60A" -Item "HP60A" -Pattern "mac=90:e2:ba:74:8c:f4"

Get-DeployRule -Name Default | Add-DeployRule

Get-DeployRule -Name ClusterAtelier | Add-DeployRule

Get-DeployRule -Name HP60A| Add-DeployRule

0 Kudos
1 Reply
manishkec
Contributor
Contributor

Can I know how did you create the hostprofile "HP60A" ? I suggest before creating this host profiles (HP60A) from the host, add that host to the dvs. Doing so will extract the dvs information in the profile. Then any host booted using this profile in the rule will automatically get added to the dvs as the profile apply during boot will created the dvs switch on the host. please let me know if you are looking for any more information

0 Kudos