Como agregar Standard Switches y/o PortGroups con PowerCLI

Metodo para agregar Standard Switches y/o Port Groups a todos los hosts en tu cluster usando PowerCLI cuando no existe Switch Distribuido (VDS).

Cuando un Switch Distribuido (VDS) no está presente en el ambiente, bien sea por no tener licencia Enterprise Plus o por cualquier otro motivo y en vez se usan Standard Switches (VSS) en cada uno de los hosts; la configuración y nombre de tus VSS y sus Port-Groups deben ser identicas, de lo contrato sabemos que errores podrían ocurrir al intentar hacer vMotion por ejemplo.


Si es necesario agregar o editar uno o mas Virtual Standard Switches y/o Port-Groups a tus hosts, PowerCLI hará esta tarea mucho más fácil, rápida y consistente. 

En vez de agregar cada uno de los VSS y/o Port-Groups de manera manual y repetitiva atravez del GUI o incluso usando ESXCLI en cada host con sesiones SSH; puedes hacer estas configuraciones con un par de líneas en PowerCLI.



Iniciamos creando una variable de los hosts que necesitas modificar:

Bien sea incluyendo todos hosts que usan parte del nombre, con un * como wildcard:

  
Agregando uno de tus clusters completos, si es que existe mas de uno:


O listando los hosts individualmente, si por algun motivo esto fuera necesario:

  

Si el VSS no existe y debes agregarlo, puedes usar el siguiente syntax para crearlo en todos los hosts contenidos en tu variable $Labhost:





El anterior ejemplo usa -MTU y -NumPorts para modificar estos de su defecto, pero esos parametros no son obligatorios y se pueden omitir.

Despues de crear el VSS o si ya existe y solo necesitas crear nuevos Port Groups, debes identificar el nombre del VSS donde seran agregados. En este ejemplo el resultado sera que en todos los hosts incluidos en la variable $myhosts, se creara un Port-Group llamado Replication-vlan en el switch vSwitch3 tageado con VLAN 405





Nota: Los diferentes comandos, variables y las imagines no necesariamente son relacionadas unas con otras, como puedes ver en el penultimo ejemplo para agregar un VSS el nombre de la variable y el VSS no concuerdan con los otros casos en este post. Estan ahi como demostracion y referencia.










My road to vExpert

vExpert: wow that guy works for VMware and must know it all. 

When I first started seeing and hearing the term vExpert in the different community virtualization events, podcasts, webinars and on people's Bio's on LinkedIn and Twitter, I thought it was a selective distinction for a very few, top product specialists within VMware; I believed it to be some sort of certification for its employees.
Later on, I noticed how others outside VMware also called themselves vExperts; but these individuals were known bloggers and virtualization community heavyweights; then I thought, maybe they get the privilege since they are so well versed in the technology and have proven it with their presentations, blog posts and even books. 

I didn't bother to look at the requirements for that "certification" or what it really meant, instead I just kept focused on VCP and VCAP just assuming vExpert was out of reach.

It wasn't until I started engaging more in the Boston VMUG and with the vBrownBag and LATAM crew that I realized the vExpert recognition was for the Community, for enthusiasts and evangelists of the technology. Even then, my assumption was that it would take an enormous amount of dedication, commitment and actual high technical expertise to become one.

My interest in attaining this award grew as I became aware of a key benefit: being able to use VMware products in a Home Lab; What? Have the ability to practice in your home gear without reinstalling every 60 days? Great, I needed to start putting the effort and pursue this recognition from VMware; I enjoy virtualization and this will only allow me continue learning and growing in that space. That benefit by itself is huge, the other perks are also very valuable, I'm not underestimating their value.

Found my mentors: Ariel Sanchez y Los Muchachos de vBrownBagLATAM 😊