Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Commit 5cf8e83

Browse files
committed
Updated Quick Start with New-BuildConfiguration chapter
1 parent 605e2a2 commit 5cf8e83

13 files changed

+93
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Using the `Invoke-Build` framework, this project allows for an administrator to
1717

1818
* [PowerShell](https://aka.ms/getps6)
1919
* [Rubrik PowerShell Module](https://www.powershellgallery.com/packages/Rubrik/)
20+
* [Rubrik PowerShell Backup Validation Module](https://github.com/rubrikinc/rubrik-module-for-powershell-backup-validation)
2021
* [VMware PowerCLI](https://www.powershellgallery.com/packages/VMware.PowerCLI/)
2122
* [InvokeBuild](https://www.powershellgallery.com/packages/InvokeBuild/)
2223

docs/quick-start.md

Lines changed: 88 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ As virtual machines running in a VMware environment are backed up and cataloged
88

99
* [PowerShell](https://aka.ms/getps6)
1010
* [Rubrik PowerShell Module](https://www.powershellgallery.com/packages/Rubrik/)
11+
* [Rubrik PowerShell Backup Validation Module](https://github.com/rubrikinc/rubrik-module-for-powershell-backup-validation)
1112
* [VMware PowerCLI](https://www.powershellgallery.com/packages/VMware.PowerCLI/)
1213
* [InvokeBuild](https://www.powershellgallery.com/packages/InvokeBuild/)
1314

@@ -16,6 +17,7 @@ Once you have PowerShell installed on your system you can install the required m
1617

1718
```
1819
Install-Module -Name Rubrik -Scope CurrentUser
20+
Install-Module -Name RubrikBackupValidation -Scope CurrentUser
1921
Install-Module -Name VMware.PowerCLI -Scope CurrentUser
2022
Install-Module -Name InvokeBuild -Scope CurrentUser
2123
```
@@ -26,12 +28,20 @@ This will install the modules in the current user scope and will not require loc
2628

2729
```
2830
Install-Module -Name Rubrik -Scope AllUsers
31+
Install-Module -Name RubrikBackupValidation -Scope AllUsers
2932
Install-Module -Name VMware.PowerCLI -Scope AllUsers
3033
Install-Module -Name InvokeBuild -Scope AllUsers
3134
```
3235

3336
## Verify installation
34-
We can use the `Get-Module` cmdlet to verify if a module is successfully installed:
37+
The Rubrik PowerShell Backup Validation module, provides us with a function that can verify if we have all required modules properly installed, the `Test-PowerShellDependency` function:
38+
39+
```
40+
Test-PowerShellDependency
41+
```
42+
![alt text](/img/image10.png)
43+
44+
Alternatively, we can use the `Get-Module` cmdlet to verify if all modules are successfully installed:
3545

3646
```
3747
'Rubrik', 'VMware.PowerCLI', 'InvokeBuild' | ForEach-Object {
@@ -59,6 +69,9 @@ This use case leverages several PowerShell modules, outlined in this section.
5969
#### Rubrik SDK for PowerShell
6070
Rubrik’s API first architecture enables organizations to embrace and integrate Rubrik functionality into their existing automation processes. While Rubrik APIs can be consumed natively, companies are at various stages in their automation journey with different levels of automation knowledge on staff. The Rubrik SDK for PowerShell is a project that provides a Microsoft PowerShell module for managing and monitoring Rubrik's Cloud Data Management fabric by way of published RESTful APIs.
6171

72+
#### Rubrik PowerShell Backup Validation
73+
This module has been created to help validate and verify the different components of a Backup Validation. It provides functions to generate the different Json files, allowing for this to be automated. Furthermore, it comes bundled with the `New-BuildConfiguration` function, that assists with the creation and validation of your backup validation scenario, by providing an interactive experience in which leads the administrator through the process of creating your first backup validation scenario.
74+
6275
#### VMware PowerCLI
6376
VMware PowerCLI is a PowerShell module built by VMware. It provides a command-line and scripting tool with hundreds of cmdlets to manage and automate tasks using PowerShell. It is available in the PowerShell Gallery, which makes it easy to install and update.
6477

@@ -281,9 +294,82 @@ We can now verify that this command successfully created the files containing th
281294
```
282295
Get-ChildItem ..\credentials\
283296
```
284-
285297
![alt text](/img/image7.png)
286298

299+
## Validate Backup with RubrikValidateBackup module
300+
301+
This chapter will discuss how the the Rubrik Validate Backup Module can be used to help automate the creation of a new Backup Validation workflow.
302+
303+
### Prepare environment
304+
305+
To get started we will download the Build Validation package and extract it to a folder named "Backup Validations". The package is available in the [Use-Case-PowerShell-Backup-Validation](https://github.com/rubrikinc/Use-Case-PowerShell-Backup-Validation) repository. The zipped file is available for download [here](https://github.com/rubrikinc/Use-Case-PowerShell-Backup-Validation/archive/master.zip).
306+
307+
### Interactive Configuration Generation
308+
309+
Because the sheer amount of options that need to be configured it can be overwhelming to generate the first configuration. To assist with this process the `New-BuildConfiguration` function has been created. This will provide an interactive experience in which the configuration will not only be generated, but also provides the possibility to validate and run the first backup validation job.
310+
311+
```
312+
New-BuildConfiguration
313+
```
314+
![alt text](/img/image11.png)
315+
316+
By typing either yes or no we get the option to view the most recent version of Quick Start guide for Backup Validation.
317+
![alt text](/img/image12.png)
318+
319+
The default browser will be used to open the website.
320+
321+
![alt text](/img/image13.png)
322+
323+
In the following step we are requested to enter in the credentials for the Rubrik cluster, vCenter and the Guest OS. Since we are running this on Windows the credentials will be stored in encrypted xml files. If we run this same command on macOS the credentials will be stored in keychain.
324+
325+
![alt text](/img/image14.png)
326+
327+
In the next step we will generate the `TestEnv.json` file, which contains the environment information, the IP address (or FQDN) of both the Rubrik Cluster and vCenter together with the corresponding credentials for authentication.
328+
329+
Afterwards we get prompted if we want to create an additional environment file, this is an optional step that can be used in case you would like to define multiple different environments to run your backup validation tests against.
330+
331+
![alt text](/img/image15.png)
332+
333+
Now we can define the configuration information for our VM, we are asked for several parameters to fill in. This information will be used to Live Mount the selected VM and configure and check the tasks that we select. Because Tasks is an array, it will continue prompting for more entries, it will take an empty entry as the end of the list.
334+
335+
![alt text](/img/image16.png)
336+
337+
Now that we have created the Environment and Config json files and securely stored our credentials, we are prompted to have our configuration validated.
338+
339+
![alt text](/img/image17.png)
340+
341+
The next prompt is to validate we have the required modules installed and available for backup validation to run. If you already validated this in an earlier step this can be skipped by answering no.
342+
343+
![alt text](/img/image18.png)
344+
345+
In the last step we are asked to specify which files we would like to use to start the backup validation. If everything has correctly been filled in, you will be able to follow the process of the Backup Validation from the console.
346+
347+
### New-ConfigJson
348+
349+
This function can be used to programmatically generate the config json files. The following parameters are used by this function:
350+
351+
![alt text](/img/image19.png)
352+
353+
An example of how this can be used it the following:
354+
355+
```
356+
Get-RubrikVM | Get-Random | ForEach-Object {
357+
$Splat = [ordered]@{
358+
ConfigFilePath = "$($_.Name).json"
359+
Name = $_.Name
360+
MountName = 'LiveMnt-{0}' -f $_.Name
361+
GuestCred = 'GuestCred.xml'
362+
TestIp = '172.24.1.1'
363+
TestNetwork = 'ISOLATED_VLAN'
364+
TestGateway = '172.24.1.100'
365+
Tasks = 'Ping'
366+
}
367+
New-ConfigJson @Splat
368+
}
369+
```
370+
371+
This will select a random virtual machine and create a `config.json` which can then be used for backup validation.
372+
287373
### Run `Invoke-Build`
288374
Once the Environment, Config, and Identity requirements are met, use the Invoke-Build function to execute a build. Here is a sample command using a PowerShell technique called splatting to store the parameters and arguments and execute `Invoke-Build`.
289375

helper/CodeSamples.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Test-PowerShellDependency
2+
3+
New-BuildConfiguration
4+

img/image10.png

23.3 KB
Loading

img/image11.png

32 KB
Loading

img/image12.png

206 KB
Loading

img/image13.png

45.5 KB
Loading

img/image14.png

35.6 KB
Loading

img/image15.png

39.3 KB
Loading

img/image16.png

37.5 KB
Loading

img/image17.png

23 KB
Loading

img/image18.png

39.9 KB
Loading

img/image19.png

106 KB
Loading

0 commit comments

Comments
 (0)