Version 2.0.1
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
[ValidateSet("VMware", "HyperV", "Proxmox")]
|
||||
[string]$Platform,
|
||||
|
||||
[Parameter(Mandatory)]
|
||||
[string]$Server,
|
||||
|
||||
[PSCredential]$Credential,
|
||||
|
||||
[switch]$DryRun
|
||||
)
|
||||
|
||||
Set-StrictMode -Version Latest
|
||||
$ErrorActionPreference = "Stop"
|
||||
$Root = $PSScriptRoot
|
||||
|
||||
$RequiredModules = @(
|
||||
"Modules\Veeam\BackupJobs.psm1",
|
||||
"Modules\Platforms\$Platform.psm1"
|
||||
)
|
||||
|
||||
foreach($Module in $RequiredModules) {
|
||||
Import-Module (Join-Path $Root $Module) -Force -ErrorAction Stop
|
||||
}
|
||||
|
||||
$Configuration = Get-Content (Join-Path $Root "Config\VeeamConfig.json") -Raw | ConvertFrom-Json
|
||||
|
||||
if($Platform -eq "Proxmox" -and $null -eq $Credential) {
|
||||
$Credential = Get-Credential -Message "Proxmox API-Token-ID und Token-Secret eingeben"
|
||||
}
|
||||
|
||||
switch($Platform) {
|
||||
"VMware" { $VirtualMachines = @(Get-VMwareInventory -Server $Server) }
|
||||
"HyperV" { $VirtualMachines = @(Get-HyperVInventory -Server $Server) }
|
||||
"Proxmox" { $VirtualMachines = @(Get-ProxmoxInventory -Server $Server -ApiCredential $Credential) }
|
||||
}
|
||||
|
||||
$Schedules = New-AlphabeticalBackupSchedules `
|
||||
-JobName $Configuration.BackupJob.Name `
|
||||
-VirtualMachines $VirtualMachines `
|
||||
-ScheduleGroups @($Configuration.BackupJob.ScheduleGroups)
|
||||
|
||||
[PSCustomObject]@{
|
||||
Platform = $Platform
|
||||
Server = $Server
|
||||
DryRun = $DryRun.IsPresent
|
||||
VirtualMachineCount = $VirtualMachines.Count
|
||||
VirtualMachines = $VirtualMachines
|
||||
Schedules = $Schedules
|
||||
JobsCreated = $false
|
||||
Message = "Inventar gelesen und Zeitplanentwurf erstellt. Es wurden keine Veeam-Jobs angelegt."
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
- Dry-Run Unterstützung
|
||||
|
||||
.VERSION
|
||||
1.0.2
|
||||
2.0.1
|
||||
#>
|
||||
|
||||
|
||||
@@ -635,9 +635,20 @@ function Start-VeeamEnterpriseInstall {
|
||||
|
||||
$Configuration = Get-InstallerConfiguration
|
||||
|
||||
$VeeamSourcePath = Resolve-VeeamSourcePath `
|
||||
-SourcePath $VeeamSourcePath `
|
||||
-ConfiguredPath ([string]$Configuration.Veeam.SourcePath)
|
||||
$VeeamAlreadyInstalled = (!$Script:IsDryRun -and (Test-VeeamInstalled))
|
||||
|
||||
if($VeeamAlreadyInstalled)
|
||||
{
|
||||
Write-Host "Veeam ist bereits installiert. Setup wird übersprungen." -ForegroundColor Green
|
||||
Write-EnterpriseLog -Level INFO -Message "Vorhandene Veeam-Installation erkannt; Setup wird übersprungen."
|
||||
$VeeamSourcePath = ""
|
||||
}
|
||||
else
|
||||
{
|
||||
$VeeamSourcePath = Resolve-VeeamSourcePath `
|
||||
-SourcePath $VeeamSourcePath `
|
||||
-ConfiguredPath ([string]$Configuration.Veeam.SourcePath)
|
||||
}
|
||||
|
||||
$Configuration.Repository.Path = Resolve-RepositoryPath `
|
||||
-Path ([string]$Configuration.Repository.Path) `
|
||||
@@ -722,20 +733,32 @@ function Start-VeeamEnterpriseInstall {
|
||||
-Message ("SQL-Datenbank vorbereitet: {0}; Konto: {1}; Rolle: {2}" -f $SQLPreparation.Database, $SQLPreparation.ServiceAccount, $SQLPreparation.DatabaseRole)
|
||||
}
|
||||
|
||||
$VeeamAnswerFile = Resolve-VeeamAnswerFile `
|
||||
-AnswerFile $VeeamAnswerFile `
|
||||
-SourcePath $VeeamSourcePath `
|
||||
-LocalConfigPath (Join-Path $Script:InstallerRoot "Config") `
|
||||
-DatabaseEngine $Configuration.SQL.Engine `
|
||||
-SQLServer $Configuration.SQL.Server `
|
||||
-SQLInstance $Configuration.SQL.Instance `
|
||||
-DatabaseName $Configuration.SQL.Database
|
||||
|
||||
$Installation =
|
||||
Install-VeeamProduct `
|
||||
-Configuration $Configuration `
|
||||
if($VeeamAlreadyInstalled)
|
||||
{
|
||||
$Installation = [PSCustomObject]@{
|
||||
Status = "AlreadyInstalled"
|
||||
SetupSkipped = $true
|
||||
InstallationPath = Get-VeeamInstallationPath
|
||||
Version = Get-VeeamVersion
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$VeeamAnswerFile = Resolve-VeeamAnswerFile `
|
||||
-AnswerFile $VeeamAnswerFile `
|
||||
-SourcePath $VeeamSourcePath `
|
||||
-AnswerFile $VeeamAnswerFile
|
||||
-LocalConfigPath (Join-Path $Script:InstallerRoot "Config") `
|
||||
-DatabaseEngine $Configuration.SQL.Engine `
|
||||
-SQLServer $Configuration.SQL.Server `
|
||||
-SQLInstance $Configuration.SQL.Instance `
|
||||
-DatabaseName $Configuration.SQL.Database
|
||||
|
||||
$Installation =
|
||||
Install-VeeamProduct `
|
||||
-Configuration $Configuration `
|
||||
-SourcePath $VeeamSourcePath `
|
||||
-AnswerFile $VeeamAnswerFile
|
||||
}
|
||||
|
||||
|
||||
if($null -eq (Get-Module -ListAvailable -Name "Veeam.Backup.PowerShell"))
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
---------------------------------------------------------------------------
|
||||
Module......: Bootstrap.psm1
|
||||
Projekt.....: Veeam Enterprise Installer
|
||||
Version.....: 2.0.0
|
||||
Version.....: 2.0.1
|
||||
Autor.......: ChatGPT & Benutzer
|
||||
PowerShell..: 5.1
|
||||
---------------------------------------------------------------------------
|
||||
@@ -29,7 +29,7 @@ Set-StrictMode -Version Latest
|
||||
#region Script Variablen
|
||||
|
||||
$Script:ProjectName = "Veeam Enterprise Installer"
|
||||
$Script:ProjectVersion = "2.0.0"
|
||||
$Script:ProjectVersion = "2.0.1"
|
||||
|
||||
$Script:RootPath = $null
|
||||
$Script:ModulePath = $null
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
PowerShell-basierter Installer zur automatisierten Installation und Grundkonfiguration von Veeam Backup & Replication auf Windows Server.
|
||||
|
||||
**Projektversion:** 2.0.1
|
||||
|
||||
> **Status:** Entwicklung und Test. Vor einem produktiven Einsatz vollständig in einer isolierten Testumgebung prüfen.
|
||||
|
||||
## Funktionen
|
||||
@@ -49,6 +51,10 @@ Installation mit automatisch erkanntem Installationsmedium starten:
|
||||
.\Install-VeeamEnterprise.ps1
|
||||
```
|
||||
|
||||
Ist Veeam bereits installiert, überspringt das Skript den Setup-Schritt und
|
||||
setzt die Konfiguration von Repository und Backup-Jobs fort. Dadurch kann der
|
||||
Lauf nach einem erforderlichen Neustart sicher wieder aufgenommen werden.
|
||||
|
||||
Installationsmedium und Antwortdatei können auch explizit angegeben werden:
|
||||
|
||||
```powershell
|
||||
|
||||
Reference in New Issue
Block a user