IBM Cloud Docs
配置 Linux 加固版本库服务器

配置 Linux 加固版本库服务器

本步骤描述了将 Ansible® 加固备份存储库作为 Veeam® 受管服务器添加到 Veeam 备份基础架构的 Linux® playbook。 游戏本执行以下任务:

可以使用编辑器(如 Visual Studio Code)在笔记本电脑上本地编写播放列表,然后将其传输到自动化服务器 \swlib\ansible 目录,或者使用文本编辑器(如 vi 或 nano)在自动化服务器上本地编辑。

创建游戏手册

播放列表 create_lhbr.yml 以下面的代码开始:

- hosts: vbr
  vars_files:
    - vault
  vars:
    lhbr_user: veeamlhbr
    lhbr_password: "{{ vault_lhbr_password }}"
    lhbr_vbr_name: <lhbr_vbr_name>
    lhbr_fqdn: <lhbr_fqdn>
    immutability_period: <immutability_period>
    max_concurrent_jobs: <max_concurrent_jobs>

将前面代码片段中的 <lhbr_vbr_name><lhbr_fqdn><immutability_period> 替换为在前面步骤中获取的值。 前面的代码会执行以下操作:

  • 定义在清单文件中定义为 vbr 的主机上运行游戏本。
  • 定义一个包含其他变量的文件,名为 vault。 上一步创建的 vault 文件已加密,其中包含密码等敏感变量。
  • 定义用于指定 Linux 加固版本库 <lhbr_vbr_name> 和服务器 FQDN 的简称。

创建 Windows 防火墙规则

以下代码片段添加了 Windows® 防火墙规则,以允许 Veeam 备份服务器的入站流量。

  tasks:
    - name: Veeam firewall rule TCP 111 in
      community.windows.win_firewall_rule:
        name: Veeam port mapper service (TCP-in)
        group: Veeam
        localport: 111
        action: allow
        direction: in
        protocol: tcp
        state: present
        enabled: yes

    - name: Veeam firewall rule UDP 111 in
      community.windows.win_firewall_rule:
        name: Veeam port mapper service (UDP-in)
        group: Veeam
        localport: 111
        action: allow
        direction: in
        protocol: udp
        state: present
        enabled: yes

    - name: Veeam firewall rule TCP 1058 in
      community.windows.win_firewall_rule:
        name: Veeam Mount acceptor port of vPower NFS service (TCP-in)
        group: Veeam
        localport: 1058
        action: allow
        direction: in
        protocol: tcp
        state: present
        enabled: yes

    - name: Veeam firewall rule TCP 2049 in
      community.windows.win_firewall_rule:
        name: Veeam NFS acceptor port of vPower NFS service (TCP-in)
        group: Veeam
        localport: 2049
        action: allow
        direction: in
        protocol: tcp
        state: present
        enabled: yes

    - name: Veeam firewall rule TCP 2500-3300 in
      community.windows.win_firewall_rule:
        name: Veeam data transmission channels (TCP-in)
        group: Veeam
        localport: 2500-3300
        action: allow
        direction: in
        protocol: tcp
        state: present
        enabled: yes

在代码片段中,vPower NFS 服务使用 Veeam 端口映射器服务、挂载接受端口和 NFS 接受端口,该服务将备份文件呈现给 VMware ESXi™ 主机。 Veeam 数据传输通道用于包括 Veeam Hardened 备份存储库在内的 Veeam 组件之间。

添加Linux加固备份存储库

以下代码片段将 Linux 加固存储库添加为 Veeam 受管服务器,然后将受管服务器添加为备份存储库。

    - name: Connect to the local VBR server
      win_shell: Connect-VBRServer

    - name: Add the server as a Veeam Managed Server
      win_shell: Add-VBRLinux -Name '{{ lhbr_fqdn }}' -SSHUser '{{ lhbr_user}}' -SSHPassword '{{ lhbr_password }}' -Description "Linux Hardened Repository - {{ lhbr_vbr_name }}" -SSHElevateToRoot:$true -SSHTempCredentials:$true -Confirm:$false

    - name: Add the Veeam Managed Server as a Linux Hardened Backup Repository
      win_shell: Add-VBRBackupRepository -Folder /mnt/veeamrepo01 -Type LinuxLocal -ImmutabilityPeriod '{{ immutability_period }}' -EnableBackupImmutability:$true -EnableXFSFastClone:$true -AlignDataBlocks:$true -UsePerVMFile:$true -MaxConcurrentJobs '{{ max_concurrent_jobs }}' -Server '{{ lhbr_fqdn }}' -Description "Linux Hardened Repository" -Name '{{ lhbr_vbr_name }}'
  • -SSHTempCredentials:$true 用于不将 SSH 凭据输入 Veeam 的凭据存储区。
  • -EnableXFSFastClone:$true 定义备份存储库已启用快速克隆技术。
  • -AlignDataBlocks:$true 表示备份数据块在存储到存储库之前必须解压缩。
  • -UsePerVMFile:$true 表示备份存储库必须创建每个虚拟机 (VM) 的备份文件。

创建扩展备份存储库

下面的代码片段将 Linux 加固存储库作为扩展备份存储库的延伸。 此步骤是可选的。 代码摘自 使用不可变备份防范勒索软件:Veeam 指南。 存储库配置必须是独立的存储库(只有在容量层使用 "复制 "策略时,才符合扩展备份存储库的技术要求)。

    - name: Create a Scale-Out Backup Repository
      win_shell: Add-VBRScaleOutBackupRepository -PolicyType DataLocality -Extent '{{ lhbr_vbr_name }}' -Name "Linux Hardened Repository - {{ lhbr_vbr_name }}" -Description "Linux Hardened Repository" -UsePerVMBackupFiles:$true