Files
ProjectAGiPrompt/20-物理服务器虚拟机/2-2026年3月25日-实操.sh
2026-04-29 09:46:36 +08:00

28 lines
709 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 检查当前主机名
hostnamectl
# 如无 DNS 服务器,用 hosts 文件模拟(测试环境可行)
echo "192.168.11.14 wdd.ovirt.local.lan ovirt" >> /etc/hosts
hostnamectl set-hostname wdd.ovirt.local.lan
# 1. 验证 CPU 虚拟化支持(必须有输出)
grep -E 'svm|vmx' /proc/cpuinfo | head -3
# 2. 验证磁盘类型
lsblk -d -o NAME,ROTA,TYPE,SIZE,MODEL
# ROTA=0 表示 SSD/NVMeROTA=1 表示 HDD
# 3. 检查内核模块
lsmod | grep kvm
# 应看到 kvm_intel 和 kvm
# 4. 如未加载,手动加载
modprobe kvm_intel
# 5. 确认 hostname 与 hosts 文件一致
hostname -f # 应返回完整 FQDN如 ovirt.local.lan
ping -c 2 $(hostname -f) # 必须能 ping 通自己