You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 1, 2023. It is now read-only.
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
+

43
+
44
+
Alternatively, we can use the `Get-Module` cmdlet to verify if all modules are successfully installed:
@@ -59,6 +69,9 @@ This use case leverages several PowerShell modules, outlined in this section.
59
69
#### Rubrik SDK for PowerShell
60
70
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.
61
71
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
+
62
75
#### VMware PowerCLI
63
76
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.
64
77
@@ -281,9 +294,82 @@ We can now verify that this command successfully created the files containing th
281
294
```
282
295
Get-ChildItem ..\credentials\
283
296
```
284
-
285
297

286
298
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
+

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
+

318
+
319
+
The default browser will be used to open the website.
320
+
321
+

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
+

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
+

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
+

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
+

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
+

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
+

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
+
287
373
### Run `Invoke-Build`
288
374
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`.
0 commit comments