Catégories
Auto-Deploy VMware

Configuration&Utilisation de AutoDeploy avec l'appliance vCenter Server

Il existe déjà plusieurs tutoriels sur le net concernant le déploiement de serveurs ESX avec Auto-Deploy, cette nouvelle fonctionnalité apparue avec vSphere5 qui permet de déployer des serveurs ESX en mode stateless

http://www.vmware.com/files/pdf/products/vsphere/VMware-vSphere-Evaluation-Guide-4-Auto-Deploy.pdf

Voici une procédure pour déployer des serveurs ESX avec l’appliance vCenter5.

Première étape :

Démarrage du service AutoDeploy depuis l’interface d’administration de appliance

 

 

 

 

Configuration du DHCP

il existe un fichier modèle pour le dhcp /etc/dhcpd.conf.template cependant voici la version que j’utilise

allow booting;
allow bootp;
deny duplicates;
ddns-update-style none;

include « /etc/dhcpd.deploy.conf »;

subnet 192.168.0.0 netmask 255.255.255.0 {
option domain-name « ad.local »;
option domain-name-servers 192.168.0.102;

range 192.168.0.191 192.168.0.183;
allow unknown-clients;
option gpxe.no-pxedhcp 1;
next-server 192.168.0.133;
filename « undionly.kpxe.vmw-hardwired »;

Configuration du service DHCP

Fichier /etc/sysconfig/dhcpd (en gras les valeurs modifiées)

DHCPD_INTERFACE= »eth0 »

DHCPD_IFUP_RESTART= » »

DHCPD_RUN_CHROOTED= »yes »

DHCPD_CONF_INCLUDE_FILES= »/etc/dhcpd.deploy.conf »

DHCPD_RUN_AS= »dhcpd »

DHCPD_OTHER_ARGS= » »

DHCPD_BINARY= » »

Configuration du service ATFTP

Fichier  /etc/sysconfig/atftpd (en gras les valeurs modifiées)

ATFTPD_OPTIONS= »–daemon –user root »

ATFTPD_USE_INETD= »no »

ATFTPD_DIRECTORY= »/tftpboot »

ATFTPD_BIND_ADDRESSES= » »

 

Démarrage du service DHCP

vcenter5:/etc # /etc/init.d/dhcpd start
Starting DHCP server [chroot] done

Démarrage du service TFTP

vcenter5:/etc # /etc/init.d/atftpd start
Starting Advanced Trivial FTP server done

Pour les tests, j’ai procédé à la création de serveur ESX en mode nested.

A cette étape, les services autodeploy sont bien démarré cependant aucune image n’a été configurée. Dans la deuxième capture, nous pouvons voir les paramètres de la machine qui sont détectés par autodeploy. Ces paramètres nous servirons plus tard dans le déploiement des images dans la notion de pattern.

Nous allons maintenant configurer autodeploy afin de déployer notre premier serveur en mode stateless

Ouvrer une invite de commande powercli

#Connexion au serveur vCenter

Connect-VIServer 192.168.0.133
AVERTISSEMENT : There were one or more problems with the server certificate:

* A certification chain processed correctly, but terminated in a root
certificate which isn’t trusted by the trust provider.

* The certificate’s CN name does not match the passed value.

Name Port User
—- —- —-
192.168.0.133 443 root

Ajout d’un dépôt (dossier dans lequel se trouve l’image offline, exemple: VMware-ESXi-5.0.0-469512-depot.zip)

Add-EsxSoftwareDepot « D:RessourcesProduitsVMwarevSpherevSphere 5.0VMware-ESXi-5.0.0-469512-depot »

Depot Url
———
file:///D:/Ressources/Produits/VMware/vSphere/vSphere%205.0/VMware-ESXi-5.0….

Affichage des images contenues dans le repot

Get-EsxImageProfile

Name Vendor Last Modified Acceptance Level
—- —— ————- —————-
ESXi-5.0.0-469512-no-tools VMware, Inc. 19/08/2011 0… PartnerSupported
ESXi-5.0.0-469512-standard VMware, Inc. 19/08/2011 0… PartnerSupported

PowerCLI C:> Get-EsxImageProfile |select Name

Name
—-
ESXi-5.0.0-469512-no-tools
ESXi-5.0.0-469512-standard

Création d’une règle pour déployer un serveur ESX avec l’image ESXi-5.0.0-469512-standard

New-DeployRule -Name « FirstESX » -Item « ESXi-5.0.0-469512-standard » -Pattern « ipv4=192.168.0.1-192.168.0.254

Downloading net-ixgbe 2.0.84.8.2-10vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading ata-pata-hpt3x2n 0.3.4-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading ehci-ehci-hcd 1.0-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading ata-pata-atiixp 0.4.6-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading scsi-megaraid2 2.00.4-9vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading uhci-usb-uhci 1.0-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading net-r8168 8.013.00-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading ohci-usb-ohci 1.0-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading scsi-qla4xxx 5.01.03.2-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading ata-pata-sil680 0.4.8-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading scsi-megaraid-sas 4.32-1vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading scsi-aic79xx 3.1-5vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading ata-pata-amd 0.3.10-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading net-bnx2 2.0.15g.v50.11-5vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading misc-drivers 5.0.0-0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading sata-ahci 3.0-6vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading scsi-fnic 1.5.0.3-1vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading ata-pata-pdc2027x 1.0-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading net-cnic 1.10.2j.v50.7-2vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading scsi-hpsa 5.0.0-17vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading sata-sata-sil 2.3-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading net-igb 2.1.11.1-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading net-e1000e 1.1.2-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading net-forcedeth 0.61-2vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading sata-ata-piix 2.12-4vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading scsi-qla2xxx 901.k1.1-14vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading scsi-adp94xx 1.0.8.12-6vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading net-sky2 1.20-2vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading ipmi-ipmi-msghandler 39.1-4vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading net-be2net 4.0.88.0-1vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading esx-base 5.0.0-0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading ipmi-ipmi-si-drv 39.1-4vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading scsi-megaraid-mbox 2.20.5.1-6vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading net-nx-nic 4.0.557-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading sata-sata-promise 2.12-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading scsi-ips 7.12.05-4vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading scsi-lpfc820 8.2.2.1-18vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading ata-pata-cmd64x 0.2.5-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading sata-sata-svw 2.3-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading ata-pata-via 0.3.3-2vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading esx-tboot 5.0.0-0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading misc-cnic-register 1.1-1vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading net-s2io 2.1.4.13427-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading net-e1000 8.0.3.1-2vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading net-enic 1.4.2.15a-1vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading net-bnx2x 1.61.15.v50.1-1vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading scsi-mpt2sas 06.00.00.00-5vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading block-cciss 3.6.14-10vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading ata-pata-serverworks 0.4.3-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading sata-sata-nv 3.5-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading scsi-mptsas 4.23.01.00-5vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading scsi-aacraid 1.1.5.1-9vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading tools-light 5.0.0-0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading ima-qla4xxx 2.01.07-1vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading ipmi-ipmi-devintf 39.1-4vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading net-tg3 3.110h.v50.4-4vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading scsi-bnx2i 1.9.1d.v50.1-3vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading net-r8169 6.011.00-2vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.
Downloading scsi-mptspi 4.23.01.00-5vmw.500.0.0.469512
Download finished, uploading to AutoDeploy…
Upload finished.

Name : FirstESX
PatternList : {ipv4=192.168.0.1.-192.168.0.254}
ItemList : {ESXi-5.0.0-469512-standard}

Il faur maintenant activer cette nouvelle règle
PowerCLI C:> Add-DeployRule « FirstESX »

Name : FirstESX
PatternList : {ipv4=192.168.0.1.-192.168.0.254}
ItemList : {ESXi-5.0.0-469512-standard}

Le serveur ESX doit démarrer directement depuis l’image et s’enregistrer automatiquement sur le serveur vCenter

Nous allons maintenant créer un nouveau cluster nommé Auto-Deploy et créer une règle afin d’ajouter automatiquement les serveurs dans celui-ci

New-DeployRule –Name « AddToCluster » –Item « Auto-Deploy » -Pattern « ipv4=192.168.0.1-192.168.0.254 »

Name : AddToCluster
PatternList : {ipv4=192.168.0.1-192.168.0.254}
ItemList : {Auto-Deploy}

Add-DeployRule « AddToCluster »

Name : FirstESX
PatternList : {ipv4=192.168.0.1-192.168.0.254}
ItemList : {ESXi-5.0.0-469512-standard}

Name : AddToCluster
PatternList : {ipv4=192.168.0.1.-192.168.0.254}
ItemList : {Auto-Deploy}

Vous pouvez afficher la liste des règles actives avec la commande Get-DeployRuleSet

Les servers ESX apparaissent maintenant dans le cluster nommé Auto-Deploy

Remarque : Si vous avez ajoutez  les adresses IP des serveurs ESX dans la zone inverse  DNS, ils apparaitrons avec leurs noms plutôt qu’avec et non leurs adresses IP

Nous allons maintenant utiliser HostProfiles pour configurer ces serveur ESX de manière automatique

 

 

 

 

 

 

 

 

 

 


Création de la règle HostProfile

New-DeployRule –Name « AssignHostProfile » –Item « Profil-ESX-Prod » –Pattern « ipv4=10.10.31.80-10.10.31.99 »

Name : AssignHostProfile
PatternList : {ipv4=192.168.0.1.-192.168.0.254}
ItemList : {Profil-ESX-Prod}

Add-DeployRule « AssignHostProfile »

Name : FirstESX
PatternList : {ipv4=192.168.0.1.-192.168.0.254}
ItemList : {ESXi-5.0.0-469512-standard}

Name : AssignHostProfile
PatternList : {ipv4=192.168.0.1.-192.168.0.254}
ItemList : {Profil-ESX-Prod}

Afin d’aller plus loin, nous allons faire de la réservation d’adresse MAC sur le serveur DHCP afin que seuls les serveurs ESX démarent en PXE

deny unknown-clients;

host esxauto1 {
hardware ethernet 00:50:56:8a:fa:44;
fixed-address 192.168.0.201;
}

host esxauto2 {
hardware ethernet 00:50:56:8a:fa:45;
fixed-address 192.168.0.202;
}

host esxauto3 {
hardware ethernet 00:50:56:8a:fa:46;
fixed-address 192.168.0.203;

}

Et pour pour ceux qui sont alletiguqes au powershell, vous pouvez utiliser le GUI Atodeploy de Fling

http://www.yellow-bricks.com/2012/02/09/fling-auto-deploy-gui/