配置生产环境
只有当您想将隔离恢复环境连接到生产环境时,才需要本文档中的步骤。
Active Directory 域名服务 (AD/DNS) 配置
这些步骤是在生产环境中的 AD/DNS 服务器上实施的,而不是在隔离恢复环境中的 AD/DNS 服务器上实施的。
隔离恢复环境中的 Veeam® 服务需要连接到生产环境中的 vCenter 设备。 因此,Veeam 服务需要在生产环境的活动目录域中配置一个服务帐户。
- 使用 RDP 客户端访问 AD/DNS 服务器。
- 以管理员权限打开 PowerShell 控制台。
- 使用以下命令创建 Veeam 服务帐户:
$name = "sa-veeam-cyber-admin"
$sn = "sa-veeam-cyber-admin"
$descr = "Service Account for Veeam cyber-recovery"
$dname = "Cyber-recovery Admin"
$path = "CN=ic4v-vCenter,CN=Users,DC=partner,DC=ibmcloud,DC=local"
$pw = "<sa_veeam_cyber_admin_password>"
$grp = "ic4v-vCenter"
New-ADUser -Name $name -DisplayName $dname -Description $descr -SamAccountName $sn -AccountPassword (convertto-securestring $pw -AsPlainText -Force) -Enabled $true -PasswordNeverExpires $true -ChangePasswordAtLogon $false
Add-ADGroupMember -Identity $grp -Members $sn
创建 vCenter 角色
创建 vCenter 角色并分配所需的权限,以便 Veeam 服务帐户可以创建生产虚拟机 (VM) 的备份。
这些步骤是在生产环境中的 vCenter 设备上实施的,而不是在隔离恢复环境中的 vCenter 设备服务器上实施的。
该角色需要一系列权限。 您可以在下面的 PowerCLI 脚本中查看变量列表 $privileges
中的权限列表。 有关更多信息,请参阅 备份。
脚本完成以下任务:
- 定义所需的权限。
- 加载 PowerCLI SnapIn 并设置配置以忽略无效证书。
- 定义 vCenter IP/FQDN、管理员用户和密码。
- 定义 Veeam 用户的名称,如
veeambur
。 - 连接到 vCenter。
- 创建具有所需权限的角色。
- 根据所需的清单对象为用户创建权限。
创建角色和分配权限的步骤
- 使用远程桌面客户端连接跳转服务器。
- 以管理员权限打开 PowerShell 控制台。
- 为脚本定义以下变量
<vcsa_fqdn>
是生产环境中 vCenter 设备的 FQDN 或 IP 地址。<vcsa_user>
是 vCenter 设备中具有添加角色所需权限的帐户的用户名。<vcsa_user_password>
是<vcsa_user>
的密码。<sub_domain>
是根域的子域,也就是说,对于example.test.local
,<sub_domain>
就是example
,<root_domain>
就是test.local
。
- 使用以下命令创建角色并分配权限:
Add-PSSnapin VMware.VimAutomation.Core -ea "SilentlyContinue"
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null
$vcsa = "<vcsa_fqdn>"
$vcsauser = "<vcsa_user>"
$vcsapassword = '<vcsa_user_password>'
$securevcsapassword = ConvertTo-SecureString -String $vcsapassword -AsPlainText -Force
$sn = "sa-veeam-cyber-admin"
$id = "<sub_domain>"
$role = "veeambur"
$principal = "$id\$sn"
$creds = New-Object System.Management.Automation.PSCredential -ArgumentList $vcsauser,$securevcsapassword
$privileges = @(
'System.Anonymous',
'System.View',
'System.Read',
'Global.ManageCustomFields',
'Global.SetCustomField',
'Global.LogEvent',
'Global.Licenses',
'Global.Settings',
'Global.DisableMethods',
'Global.EnableMethods',
'Folder.Create',
'Folder.Delete',
'Datastore.Browse',
'Datastore.DeleteFile',
'Datastore.FileManagement',
'Datastore.AllocateSpace',
'Datastore.Config',
'Network.Config',
'Network.Assign',
'DVPortgroup.Create',
'DVPortgroup.Modify',
'DVPortgroup.Delete',
'Host.Config.Maintenance',
'Host.Config.Storage',
'Host.Config.Network',
'Host.Config.AdvancedConfig',
'Host.Config.Patch',
'VirtualMachine.Inventory.Create',
'VirtualMachine.Inventory.Register',
'VirtualMachine.Inventory.Delete',
'VirtualMachine.Inventory.Unregister',
'VirtualMachine.Interact.PowerOn',
'VirtualMachine.Interact.PowerOff',
'VirtualMachine.Interact.Suspend',
'VirtualMachine.Interact.ConsoleInteract',
'VirtualMachine.Interact.DeviceConnection',
'VirtualMachine.Interact.SetCDMedia',
'VirtualMachine.Interact.SetFloppyMedia',
'VirtualMachine.Interact.GuestControl',
'VirtualMachine.GuestOperations.Query',
'VirtualMachine.GuestOperations.Modify',
'VirtualMachine.GuestOperations.Execute',
'VirtualMachine.Config.Rename',
'VirtualMachine.Config.AddExistingDisk',
'VirtualMachine.Config.AddNewDisk',
'VirtualMachine.Config.Annotation',
'VirtualMachine.Config.RemoveDisk',
'VirtualMachine.Config.RawDevice',
'VirtualMachine.Config.AddRemoveDevice',
'VirtualMachine.Config.EditDevice',
'VirtualMachine.Config.Settings',
'VirtualMachine.Config.Resource',
'VirtualMachine.Config.AdvancedConfig',
'VirtualMachine.Config.DiskLease',
'VirtualMachine.Config.DiskExtend',
'VirtualMachine.Config.ChangeTracking',
'VirtualMachine.State.CreateSnapshot',
'VirtualMachine.State.RevertToSnapshot',
'VirtualMachine.State.RemoveSnapshot',
'VirtualMachine.State.RenameSnapshot',
'VirtualMachine.Provisioning.MarkAsTemplate',
'VirtualMachine.Provisioning.MarkAsVM',
'VirtualMachine.Provisioning.DiskRandomAccess',
'VirtualMachine.Provisioning.DiskRandomRead',
'VirtualMachine.Provisioning.GetVmFiles',
'VirtualMachine.Provisioning.PutVmFiles',
'Resource.AssignVMToPool',
'Resource.CreatePool',
'Resource.DeletePool',
'Resource.HotMigrate',
'Resource.ColdMigrate',
'Extension.Register',
'Extension.Unregister',
'VApp.AssignVM',
'VApp.AssignResourcePool',
'VApp.Unregister',
'StoragePod.Config',
'Cryptographer.Access',
'Cryptographer.EncryptNew',
'Cryptographer.Encrypt',
'Cryptographer.Migrate',
'Cryptographer.AddDisk',
'InventoryService.Tagging.AttachTag',
'StorageProfile.Update',
'StorageProfile.View')
Connect-VIServer -Server $vcsa -Credential $creds | Out-Null
New-VIRole -Name $role -Privilege (Get-VIPrivilege -Id $privileges) | Out-Null
Get-VIRole -Name $role | Select-Object Description, PrivilegeList, Server, Name | Format-List
New-VIPermission -Principal $principal -Role $role -Entity (Get-Datacenter) -Propagate:$true -Confirm:$false
Disconnect-VIServer -Confirm:$false
创建网络恢复隔离环境解决方案架构的步骤已经完成。
有关网络管理员使用 PowerShell 脚本从网络备份即时还原生产虚拟机的使用案例,请参阅 即时还原。
此外,对于网络管理员使用 Veeam 数据集成 API 访问网络备份的使用案例,请参阅 创建 Veeam Linux 受管服务器。