Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions VMware.CloudFoundation.InstanceRecovery.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,13 @@ Function Confirm-VCFInstanceRecoveryPreReqs {

#Check Dependencies
$jumpboxName = hostname
$is7Zip4PowerShellInstalled = Get-InstalledModule -name "7Zip4PowerShell" -RequiredVersion "2.4.0" -ErrorAction SilentlyContinue
If (!$is7Zip4PowerShellInstalled) {
LogMessage -type WARNING -message "[$jumpboxName] 7Zip4PowerShell Module Missing. Please install"

#Check for windows tar.exe
$isTarInstalled = Test-Path "C:\Windows\System32\tar.exe"
If (!$isTarInstalled) {
LogMessage -type WARNING -message "[$jumpboxName] tar.exe Missing. Please install"
} else {
LogMessage -type INFO -message "[$jumpboxName] 7Zip4PowerShell Module found"
LogMessage -type INFO -message "[$jumpboxName] tar.exe found"
}

$isPoshSSHInstalled = Get-InstalledModule -name "Posh-SSH" -RequiredVersion "3.0.8" -ErrorAction SilentlyContinue
Expand Down Expand Up @@ -373,10 +375,11 @@ Function New-ExtractDataFromSDDCBackup {
$command = "openssl enc -d -aes-256-cbc -md sha256 -in $backupFileFullPath -pass pass:`"$encryptionPassword`" -out `"$parentFolder\decrypted-sddc-manager-backup.tar.gz`""
Invoke-Expression "& $command" *>$null

#Extract Backup
#Extract Required Files From Backup Leveraging Windows tar.exe
LogMessage -type INFO -message "[$jumpboxName] Extracting Backup"
Expand-7Zip -ArchiveFileName "$parentFolder\decrypted-sddc-manager-backup.tar.gz" -TargetPath $parentFolder
Expand-7Zip -ArchiveFileName "$parentFolder\decrypted-sddc-manager-backup.tar" -TargetPath $parentFolder
Set-Location "$parentFolder"
tar -xzf "$parentFolder\decrypted-sddc-manager-backup.tar.gz" "$extractedBackupFolder/metadata.json" "$extractedBackupFolder/appliancemanager_dns_configuration.json" "$extractedBackupFolder/appliancemanager_ntp_configuration.json" "$extractedBackupFolder/security_password_vault.json" "$extractedBackupFolder/database/sddc-postgres.bkp"


#Get Content of Password Vault
LogMessage -type INFO -message "[$jumpboxName] Reading Password Vault"
Expand Down
1 change: 0 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ Dependency | Version | Publisher
-----------------------------------------------------|-----------|---------------------------|---------------------------------------------------------------------------
[VMware.PowerCLI][psgallery-module-powercli] | 13.3.0 | Broadcom | :fontawesome-solid-book:   [Documentation][developer-module-powercli]
[Posh-SSH][psgallery-module-poshssh] | 3.0.8 | Carlos Perez | :fontawesome-brands-github:   [GitHUb][github-module-poshssh]
[7Zip4Powershell][psgallery-module-7zip4powershell] | 2.4.0 | Thomas Freudenberg | :fontawesome-brands-github:   [GitHub][github-module-7zip4powershell]
[OpenSSL for Windows][download-win64openssl] | 3.2.1 | Shining Light Productions | :octicons-package-dependencies-24:   [Download][download-win64openssl]

[microsoft-powershell]: https://docs.microsoft.com/en-us/powershell
Expand Down