PowerRvB is a set of PowerShell commands that provision new environments on vSphere. Its included commands are:
- Invoke-PodClone
- New-DevPod
- New-PodPortGroups
- New-PodRouter
- Invoke-RvByeBye
PowerRvB requires two PowerShell modules to be installed before you can start working. These are
- VMware.PowerCLI
- PowerRvB
PS> Install-Module VMware.PowerCLI, PowerRvBIf you want to make Pod Users, the ActiveDirectory module will also be needed. You will also need to run the commands on a computer with domain management tools (scar.sdc.cpp or simba.sdc.cpp).
PS> Install-Module ActiveDirectoryUse your vSphere credentials to connect to elsa.sdc.cpp in PowerShell. If you are using PowerRvB on a VM joined to the sdc.cpp domain, you will not need to specify credentials.
PS> Set-PowerCLIConfiguration -InvalidCertificateAction Ignore
PS> Connect-VIServer elsa.sdc.cpp -User <Username> -Password <Password>
# Note: Passwords with symbols may not work without being enclosed with ''
PS> Connect-VIServer elsa.sdc.cpp -User tswift -Password 'Thanus$Password'Use New-DevPod to create a vApp for environment development.
PS> New-DevPod -Name <vAppName> -Target <ResourcePoolName> -CreateRouter <$true|$false> -WanPortGroup <PortGroupName>
PS> New-DevPod -Name EvansDevPod3 -Target 02-07_Evan -CreateRouter $true -WanPortGroup 0010_DefaultNetworkNew-DevPod has a box selection menu.
0 - Windows 10 Blank
1 - Windows Server 2022 Blank
2 - Ubuntu 20.04 Blank
Enter the boxes to be created in this Developer Pod (Ex: 0, 2, 1). Press enter to continue: 0, 0, 1Create a new Resource Pool. Clone the VMs from the development pod into a new Resource Pool. Do not clone the pod router into the new resource pool.
Using the template from Step 4 and Invoke-PodClone, you can create a specified number of Pods and supporting infrastructure. It will also tag all created resources for easy teardown using Invoke-RvByeBye
PS> Invoke-PodClone -SourceResourcePool <ResourcePool> -Target <ResourcePool> -Pods <number> -Tag <Tag> -FirstPodNumber <number> -AssignPortGroups <$true|$false> -CreateUsers <$true|$false> -Role <vSphereRole> -CreateRouters <$true|$false> -WanPortGroup <PortGroup>
PS> Invoke-PodClone -SourceResourcePool DevPod -Target 02-07_Evan -Pods 20 -Tag 'RvB Tag' -AssignPortGroups $True -FirstPodNumber 1230 -AssignPortGroups $true -CreateUsers $true -Role 01_RvBDirector -CreateRouters $trueInvoke-RvByeBye is used to remove all resources that were created by Invoke-PodClone. This deletes:
- vApps
- Port Groups
- Pod Users
PS> Invoke-RvByeBye -Tag <Tag>
PS> Invoke-RvByeBye -Tag RvBInvoke-PodClone
-SourceResourcePool <String>
-Target <String>
-Pods <int>
-Tag <String>
-AssignPortGroups <boolean>
-FirstPodNumber <int>
[-CreateUsers <boolean>]
[-Role <String>]
[-CreateRouters <Boolean>]
[-WanPortGroup <String>]The Invoke-PodClone cmdlet clones the given vSphere Resource Pool a specified number of times. It also creates the required networking resources and users for each pod.
If users are created, a CSV of usernames and passwords to be used on vSphere will be generated on the command runner’s desktop.
PS> Invoke-PodClone -SourceResourcePool DevPod -Target 02-07_Evan -Pods 20 -Tag 'RvB Tag' -AssignPortGroups $True -FirstPodNumber 1230 -AssignPortGroups $true -CreateUsers $true -Role 01_RvBDirector -CreateRouters $trueThis command clones the template, DevPod, 20 times under the resource pool 02-07_Evan. It creates 20 port groups starting at port group 1230. A domain user account is created for each pod and assigned the role 01_RvBDirector on vSphere to their respective pod. It then creates a pod router for each pod. All created resources are tagged with RvB Tag.
PS> Invoke-PodClone -SourceResourcePool WindowsWorkshop -Target 03-01_PodLabs -Pods 5 -Tag 'Windows Workshop' -AssignPortGroups $True -FirstPodNumber 1230 -AssignPortGroups $falseThis command clones the Resource Pool, WindowsWorkshop, 5 times under the resource pool 03-01_PodLabs. It creates 5 port groups starting at port group 1230. Pod Users and Routers will not be created. All created resources are tagged with Windows Workshop.
-SourceResourcePool
Specifies the vApp template to be cloned.
| Type: | String |
|---|---|
| Default value: | None |
| Accept pipeline input: | False |
| Mandatory: | True |
-Target
Specifies the resource pool the pods will be cloned to.
| Type: | String |
|---|---|
| Default value: | None |
| Accept pipeline input: | False |
| Mandatory: | True |
-Pods
Specifies the number of pods to be cloned.
| Type: | int |
|---|---|
| Default value: | None |
| Accept pipeline input: | False |
| Mandatory: | True |
-Tag
Specifies the tag applied to the vApps, Port Groups, and Users.
| Type: | String |
|---|---|
| Default value: | None |
| Accept pipeline input: | False |
| Mandatory: | True |
-FirstPodNumber
Specifies the first port group Invoke-PodClone will check for port groups.
| Type: | int |
|---|---|
| Default value: | None |
| Accept pipeline input: | False |
| Mandatory: | True |
-AssignPortGroups
Specifies if port groups will be assigned to the pods.
| Type: | Boolean |
|---|---|
| Default value: | None |
| Accept pipeline input: | False |
| Mandatory: | True |
-CreateUsers
Specify if users will also be created for their respective pods.
| Type: | Boolean |
|---|---|
| Default value: | $false |
| Accept pipeline input: | False |
| Mandatory: | False |
-Role
Specify the vSphere role new users will be given.
| Type: | String |
|---|---|
| Default value: | None |
| Accept pipeline input: | False |
| Mandatory: | Required if CreateUsers = True |
-CreateRouters
Specify if pod routers will be created.
| Type: | Boolean |
|---|---|
| Default value: | $false |
| Accept pipeline input: | False |
| Mandatory: | False |
-WanPortGroup
Specify the WAN port group applied to the pod router.
| Type: | String |
|---|---|
| Default value: | 0010_DefaultNetwork |
| Accept pipeline input: | False |
| Mandatory: | False |
New-DevPod
-Name <String>
-Target <String>
[-CreateRouter <Boolean>]
[-WanPortGroup <String>]The New-DevPod cmdlet creates a development vApp with the desired virtual machines and functional networking. A prompt occurs after running the command that allows the user to choose what operating systems they want in the environment.
PS> New-DevPod -Name EvansPod -Target 02-07_EvanThis command creates a development vApp named EvansPod under the resource pool 02-07_Evan. It will not have a router created.
PS> New-DevPod -Name EvansPod -Target 02-07_Evan -CreateRouter $true -WanPortGroup 0010_DefaultNetworkThis command creates a development vApp named EvansPod under the resource pool 02-07_Evan. It will have a router created, with the WAN port group of 0010_DefaultNetwork.
-Name
Specifies the name of the vApp to be created.
| Type: | String |
|---|---|
| Default value: | None |
| Accept pipeline input: | False |
| Mandatory: | True |
-Target
Specifies the resource pool the vApp will be created in.
| Type: | String |
|---|---|
| Default value: | None |
| Accept pipeline input: | False |
| Mandatory: | True |
-CreateRouter
Specifies if pod router will be created.
| Type: | Boolean |
|---|---|
| Default value: | $false |
| Accept pipeline input: | False |
| Mandatory: | False |
-WanPortGroup
Specifies the WAN port used on the router.
| Type: | String |
|---|---|
| Default value: | None |
| Accept pipeline input: | False |
| Mandatory: | Required if CreateRouter = True |
Invoke-RvByeBye
-Tag <String>The Invoke-RvByeBye cmdlet removes all vApps, Port Groups, and Users with the tag specified.
PS> Invoke-RvByeBye -Tag 'Spring RvB 2022'This command removes all resources tagged with Spring RvB 2022. Typically, this would be all resources created by calling the Invoke-PodClone command with the Tag parameter set to Spring RvB 2022.
-Tag
Specifies the tag to be torn down.
| Type: | String |
|---|---|
| Default value: | None |
| Accept pipeline input: | False |
| Mandatory: | True |