Tuần 11: Labs 11-13 Practicum

SureBackup, VeeamZIP & Instant VM Recovery — Automated Testing

3 LABS

⏱️ 5 giờ

🧪 3 Labs

🤖 Automated Testing

✅ Verify Backups

🎓 Kết Quả Học Tập

  • ✅ Cấu hình và chạy SureBackup Job để xác minh backup tự động
  • ✅ Tạo VeeamZIP cho ad-hoc backup theo yêu cầu
  • ✅ Thực hiện Instant VM Recovery — RTO dưới 10 phút
  • ✅ Hiểu Staged Restore và ứng dụng thực tiễn
  • ✅ Troubleshoot lỗi phổ biến trong SureBackup
  • ✅ So sánh các recovery option và chọn đúng theo tình huống

LAB 11: SureBackup — Automated Restore Verification

Lý Thuyết: SureBackup là gì?

SureBackup là tính năng độc đáo của Veeam tự động khởi động VM từ file backup trong một isolated network (mạng cô lập), sau đó chạy các test script để xác minh VM hoạt động đúng. Kết quả được ghi log và gửi báo cáo qua email — không cần admin can thiệp thủ công.

Tại sao cần SureBackup?

  • • Backup tạo ra nhưng chưa chắc restore được
  • • Bit rot, storage corruption có thể làm hỏng .VBK file
  • • Test thủ công tốn 2-4 giờ mỗi VM — không khả thi
  • • SureBackup = "backup verification 100% tự động"
  • • Tuân thủ compliance: chứng minh backup khả dụng
SureBackup Flow:

┌─────────────┐    ┌──────────────────┐
│ Backup File │───▶│  Virtual Lab     │
│  (.VBK)     │    │  (Isolated Net)  │
└─────────────┘    └────────┬─────────┘
                            │ Boot VM
                   ┌────────▼─────────┐
                   │  Test Scripts    │
                   │  • Heartbeat     │
                   │  • Ping test     │
                   │  • App script    │
                   └────────┬─────────┘
                            │
                   ┌────────▼─────────┐
                   │  Pass/Fail Report│
                   │  → Email Admin   │
                   └──────────────────┘

Step 1: Tạo Virtual Lab

Virtual Lab là môi trường ảo hóa cô lập nơi Veeam boot VM từ backup để test.

  1. 1. Vào Infrastructure → Virtual Labs → Add Virtual Lab
  2. 2. Đặt tên: Lab11-VirtualLab
  3. 3. Chọn ESXi host: esxi-01.vna.local
  4. 4. Production network: vlan-10-prod
  5. 5. Isolated network: veeam-isolated-vlan (không kết nối internet)
  6. 6. Masquerade IP range: 172.16.100.0/24 (tránh xung đột IP)
  7. 7. Click Finish → Virtual Lab tạo xong
Lưu ý: Masquerade IP giúp VM trong isolated lab có IP khác với production, tránh trường hợp 2 VM cùng IP gây xung đột mạng.

Step 2: Tạo Application Group

Application Group xác định thứ tự boot VM — đảm bảo DB-01 phải chạy trước Web-01.

  1. 1. Infrastructure → Application Groups → Add Application Group
  2. 2. Tên: AppGroup-WebStack
  3. 3. Add VM: DB-01 — Boot order: 1, Max startup time: 300s
  4. 4. Add VM: Web-01 — Boot order: 2, Max startup time: 240s
  5. 5. Delay between VMs: 120 giây (đợi DB khởi động xong)

Step 3: Tạo SureBackup Job

  1. 1. Home → SureBackup Jobs → Add Job
  2. 2. Tên: Lab11-SureBackup
  3. 3. Virtual Lab: chọn Lab11-VirtualLab
  4. 4. Application Group: AppGroup-WebStack
  5. 5. Tests bật: Heartbeat Check ✓ | Ping Check ✓ | Application Script ✓
  6. 6. Schedule: Chủ Nhật 2:00 AM (giờ thấp điểm)
  7. 7. Email notification: [email protected]

Step 4: Run SureBackup Job & Monitor

  1. 1. Right-click job Lab11-SureBackupStart
  2. 2. Mở History → SureBackup Sessions để xem progress
  3. 3. Quan sát từng phase: Starting VMs → Running tests → Cleanup
  4. 4. Thời gian dự kiến: 30-60 phút tùy số VM và tốc độ test

Expected Output:

SureBackup Job: Lab11-SureBackup
Started: Sunday 02:00 AM

VM: DB-01
  Restore point: 2024-01-21 00:00
  Boot time: 4 min 22 sec
  Heartbeat:        ✓ PASS
  Ping (172.16.100.11): ✓ PASS
  App test (SQL query): ✓ PASS

VM: Web-01
  Restore point: 2024-01-21 00:00
  Boot time: 3 min 48 sec
  Heartbeat:        ✓ PASS
  Ping (172.16.100.12): ✓ PASS
  App test (HTTP 200): ✓ PASS

Result: 2/2 VMs verified successfully
Duration: 45 minutes
Status: SUCCESS — Email sent to [email protected]

Step 5: Xem Report & Cấu Hình Email Alert

  1. 1. History → SureBackup → chọn session → View Report
  2. 2. Report hiển thị: Pass/Fail per VM, boot time, test details, screenshot
  3. 3. Kiểm tra email nhận được với summary PDF đính kèm
  4. 4. Lưu report vào thư mục \\NAS\backup-reports\surebackup\

Step 6: Troubleshoot Khi VM Không Boot

Common Issues:

  • License expired → VM bị BSOD/không boot được
  • VMware Tools missing → Heartbeat timeout
  • IP conflict → Quên set masquerade range
  • Insufficient resources → ESXi host quá tải
  • Snapshot inconsistency → Check backup job log

Fix Actions:

  • ✅ Kiểm tra Windows Activation (KMS reachable?)
  • ✅ Cài VMware Tools vào production VM, chạy lại backup
  • ✅ Verify masquerade range ≠ production subnet
  • ✅ Giảm số VM test đồng thời (giới hạn trong lab settings)
  • ✅ Chạy lại backup job → create fresh restore point

LAB 12: VeeamZIP — Ad-hoc Backup

Lý Thuyết: VeeamZIP là gì?

VeeamZIP tạo one-time full backup của VM mà không cần định nghĩa backup job trước. File .VBK được tạo ngay lập tức, không ảnh hưởng backup chain hiện có và không tính vào retention policy.

Use Cases thực tế:

  • 📌 Trước khi upgrade OS (Windows Update)
  • 📌 Trước khi migration VM sang host mới
  • 📌 Audit request: "snapshot VM này tại thời điểm X"
  • 📌 Developer cần backup VM lab trước khi thử nghiệm
  • 📌 Copy VM ra USB/offsite nhanh

VeeamZIP vs Backup Job

Tiêu chíVeeamZIPBackup Job
Lập lịchThủ côngTự động
Incremental❌ Không✅ Có
RetentionThủ công xóaTự động
Nhanh chóng✅ Ngay lập tứcCần setup
Encryption✅ Có✅ Có

Steps: Tạo VeeamZIP

  1. 1. Trong Veeam Console, vào Inventory → chọn VM cần backup (ví dụ: App-Server-01)
  2. 2. Right-click VM → VeeamZIP...
  3. 3. Destination: chọn \\NAS-01\veeamzip-archive\
  4. 4. Compression level: Optimal (cân bằng tốc độ và tỷ lệ nén)
  5. 5. Enable encryption: tick Encrypt VeeamZIP file → đặt password mạnh
  6. 6. Click OK → job chạy ngay lập tức
VeeamZIP: App-Server-01
Started: 2024-01-22 14:30:05
Processing: App-Server-01
  Disk: System (C:) — 80GB — Compressed: 32GB
  Disk: Data (D:)  — 200GB — Compressed: 89GB
Encryption: AES-256 ✓

Output file:
  \\NAS-01\veeamzip-archive\App-Server-01_D2024-01-22_T143005.vbk
  File size: 121 GB (compressed + encrypted)
  Duration: 22 min 14 sec
  Status: SUCCESS
Tip: Ghi lại password vào password manager (KeePass, Bitwarden) ngay lập tức. File VeeamZIP không có cơ chế recovery password — mất password = mất data.

LAB 13: Instant VM Recovery

Lý Thuyết: Instant VM Recovery

Instant VM Recovery cho phép VM chạy trực tiếp từ backup file mà không cần restore toàn bộ dữ liệu trước. Veeam mount file .VBK qua NFS lên ESXi host — VM khởi động trong vòng 5-10 phút thay vì 2-4 giờ.

Instant Recovery Flow:

┌─────────────────┐
│  Backup File    │
│  (.VBK on NAS)  │
└────────┬────────┘
         │ NFS Mount
         ▼
┌─────────────────┐
│  Veeam Mount    │
│  Service        │
│  (vPower NFS)   │
└────────┬────────┘
         │ Present as datastore
         ▼
┌─────────────────┐
│  ESXi Host      │
│  sees VM disk   │
└────────┬────────┘
         │ Power On
         ▼
┌─────────────────┐
│  VM Running     │
│  ← 5-10 min! →  │
└─────────────────┘
  (reads from backup,
   writes to cache disk)

RTO Comparison

MethodRTOPhù hợp
Traditional Restore2-4 giờDev/Test VMs
Instant Recovery5-10 phútProduction crisis
VM Replica Failover< 1 phútCritical systems
Staged Restore30-60 phútTest + publish
Quan trọng: Sau Instant Recovery, VM đọc data từ backup file. Performance thấp hơn production. Cần migrate sang production storage NGAY sau khi kiểm tra xong.

Steps: Thực Hiện Instant VM Recovery

  1. 1. Home → Backups → Disk → chọn VM cần recover
  2. 2. Right-click → Instant Recovery to VMware vSphere...
  3. 3. Restore point: chọn Latest (điểm restore gần nhất)
  4. 4. Target host: esxi-02.vna.local (host có dung lượng)
  5. 5. Datastore: datastore-prod-02
  6. 6. VM Name: giữ nguyên hoặc đổi thành DB-01-RECOVERED
  7. 7. Tick Power on target VM automatically
  8. 8. Click Finish
Instant Recovery Job: DB-01
Started: 2024-01-22 09:15:00

Mounting backup to vPower NFS server...  ✓ Done (30 sec)
Registering VM on esxi-02.vna.local...  ✓ Done (15 sec)
Powering on VM...                        ✓ Done (45 sec)

VM Status: Powered ON
Time to power-on: 8 minutes 12 seconds

Read from backup: YES (vPower NFS mount)
  Backup path: \\NAS-01\backups\DB-01D2024-01-21T000000.vbk
Production data: NOT YET migrated
Performance mode: Degraded (I/O via NFS)

Action required: Migrate to production storage
  or Stop Instant Recovery session when done.

Step 5-7: Verify, Migrate & Cleanup

Step 5: Verify VM

  • • Ping IP: ping 10.0.10.50
  • • RDP/SSH vào VM
  • • Check services: Get-Service
  • • Verify DB connectivity
  • • Check event log errors

Step 6: Quick Migration

  • • Right-click session → Migrate to Production
  • • Chọn target datastore
  • • Veeam copy data ngầm
  • • VM không bị downtime
  • • Tự động ngắt NFS sau khi xong

Step 7: Stop Session

  • • Nếu VM không cần nữa:
  • Instant Recovery → Stop
  • • VM bị xóa khỏi vSphere
  • • NFS mount được giải phóng
  • • Backup file nguyên vẹn

🎁 Bonus: Staged Restore

Staged Restore = restore VM vào môi trường isolated, chạy scripts (patch, audit, test) trước, rồi publish lên production. Khác với Instant Recovery — Staged Restore có thêm bước can thiệp trước khi đưa vào production.

Use Cases:

  • 📌 Test Windows patch trước khi áp production
  • 📌 Kiểm tra compliance script trên VM cũ
  • 📌 Extract specific files/data từ VM backup
  • 📌 Forensics: phân tích VM bị nhiễm malware
Staged Restore Flow:

Backup File
    │
    ▼
Restore to Isolated Lab
    │ (không thể kết nối internet)
    ▼
Run Scripts / Test / Patch
    │ admin verified OK
    ▼
Publish to Production
    (hoặc discard nếu fail)

Bài Tập Thực Hành

BT1: SureBackup Scheduling Design

Công ty có 50 VMs cần verify qua SureBackup. Backup window: 22:00-06:00. Mỗi VM test 15 phút, lab có 4 VM slots đồng thời.

Yêu cầu:

  • • Thiết kế lịch SureBackup để không chồng backup window
  • • Phân nhóm 50 VMs (critical/standard/dev)
  • • Tính số giờ cần thiết để test 50 VMs
  • • Đề xuất: test toàn bộ trong 1 tuần hay chia nhỏ?

BT2: Tính Thời Gian SureBackup

20 VMs cần test, mỗi VM test 15 phút, Virtual Lab có 4 slots đồng thời.

Câu hỏi:

  • • Tổng thời gian hoàn thành 20 VMs là bao nhiêu?
  • • Nếu nâng lên 8 slots, tiết kiệm được bao nhiêu giờ?
  • • 20 VMs × 15 phút / 4 slots = ? phút
  • • Overhead boot/shutdown ước tính thêm 20%
Gợi ý: (20 VMs / 4 slots) × 15 min = 75 min + 20% = ~90 phút

BT3: Recovery RTO Comparison

Trình bày 4 recovery options của Veeam và khi nào dùng mỗi loại.

Hoàn thành bảng sau:

OptionRTODùng khi
Traditional Restore??
Instant Recovery??
VM Replica Failover??
Staged Restore??

BT4: VeeamZIP Policy Decision

Phân tích các tình huống dưới đây và quyết định: dùng VeeamZIP hay backup job thông thường?

  • a) Upgrade SQL Server từ 2019 lên 2022 vào tối nay
  • b) Backup hàng ngày cho 50 production VMs
  • c) Auditor yêu cầu snapshot VM tại thời điểm cuối quý
  • d) Developer cần backup VM test lab trước khi thử nghiệm code mới
  • e) Backup offsite hàng tuần cho compliance HIPAA

Giải thích lý do cho mỗi lựa chọn.

Checklist Hoàn Thành Tuần 11