带你读《云原生机密计算最佳实践白皮书》——AMD SEV机密虚拟机(3)

简介: 带你读《云原生机密计算最佳实践白皮书》——AMD SEV机密虚拟机(3)

《云原生机密计算最佳实践白皮书》——06运行时底座——AMD SEV机密虚拟机(2) https://developer.aliyun.com/article/1230949?groupCode=aliyun_linux



第五步 启动VM

virsh 安装的方式

virt-install \
 --name sev-guest \
 --memory 4096 \
 --memtune hard_limit=4563402 \
 --boot uefifi \
 --disk /var/lib/libvirt/images/sev-guest.img,device=disk,bus=scsi \
 --disk /var/lib/libvirt/images/init-passwd.iso,device=cdrom \
 --os-type linux \
 --os-variant centos8 \
--import \
 --controller type=scsi,model=virtio-scsi,driver.iommu=on \
 --controller type=virtio-serial,driver.iommu=on \
 --network network=default,model=virtio,driver.iommu=on \
 --memballoon driver.iommu=on \
 --graphics none \
 --launchSecurity sev

virsh 用xml文件 启动

• 创建sev.xml 文件,内容如下

<domain type = 'kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
 <name>csv_launch</name>
 <memory unit='GiB'>4</memory>
 <vcpu>4</vcpu>
 <os>
 <type arch = 'x86_64' machine = 'pc'>hvm</type>
 <boot dev = 'hd'/>
 </os>
 <features>
 <acpi/>
 <apic/>
 <pae/>
 </features>
 <clock offffset = 'utc'/>
 <on_poweroffff>destroy</on_poweroffff>
 <on_reboot>restart</on_reboot>
 <on_crash>destroy</on_crash>
 <devices>
 <emulator>/usr/libexec/qemu-kvm</emulator>
 <disk type = 'fifile' device = 'disk'>
 <driver name = 'qemu' type = 'qcow2' cache = 'none'/>
 <source fifile = '/tmp/test.qcow2'/>
 <target dev = 'hda' bus = 'ide'/>
 </disk>
 <memballoon model='none'/>
 <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='en-us'>
 <listen type='address' address='0.0.0.0'/>
 </graphics>
 </devices>
 <launchSecurity type='sev'>
 <policy>0x0001</policy>
 <cbitpos>51</cbitpos>
 <reducedPhysBits>1</reducedPhysBits>
 </launchSecurity>
 <qemu:commandline>
 <qemu:arg value="-drive"/>
 <qemu:arg value="if=pflflash,format=raw,unit=0,fifile=/usr/share/edk2/ovmf/OVMF_
CODE.cc.fd,readonly=on"/>
 </qemu:commandline>
</domain>

• 导入sev-guest虚拟机

virsh defifine sev.xml

• 开启虚拟机

virsh start sev-guest


第六步 检查SEV 在虚拟机中是否开启

1、virsh console sev-guest

2、dmesg | grep SEV

[ 0.374549] AMD Memory Encryption Features active: SEV
相关文章
|
1月前
|
Cloud Native 开发者
电子好书发您分享《云原生开发者洞察白皮书》
电子好书发您分享《云原生开发者洞察白皮书》
63 2
|
10月前
|
Ubuntu 安全 Linux
不用安装虚拟机,直接在Windows上面运行Linux Bash Shell,嗯!真香!!!
不用安装虚拟机,直接在Windows上面运行Linux Bash Shell,嗯!真香!!!
189 0
|
1月前
|
Ubuntu 安全 虚拟化
vmware虚拟机运行ubuntu等卡慢的解决办法
vmware虚拟机运行ubuntu等卡慢的解决办法
530 0
|
11月前
|
Kubernetes Cloud Native Devops
为什么在Kubernetes上运行虚拟机?
为什么在Kubernetes上运行虚拟机?
77 0
|
1月前
|
存储 缓存 Java
JVM【带着问题去学习 02】数据结构栈+本地方法栈+虚拟机栈+JVM栈运行原理
JVM【带着问题去学习 02】数据结构栈+本地方法栈+虚拟机栈+JVM栈运行原理
40 0
|
1月前
|
安全 Cloud Native 算法
云原生安全-云计算发展白皮书(2020年)解读
云原生安全-云计算发展白皮书(2020年)解读
152 0
|
8月前
|
存储 Java
【面试题精讲】JVM-运行时数据区-虚拟机栈
【面试题精讲】JVM-运行时数据区-虚拟机栈
|
10月前
|
Cloud Native Linux 数据中心
龙蜥白皮书精选:云原生混部资源隔离技术
不论是源码透明度,还是技术深度,以及场景的广度,龙蜥在资源隔离技术都是用户第一选择。
|
11月前
|
存储 Java
JVM面试专题-JVM运行时数据区的虚拟机栈
JVM面试专题-JVM运行时数据区的虚拟机栈你知道吗?它的基本结构是什么呢?你知道栈帧的结构吗?那你说说动态链接吧?
57 1
|
10月前
|
存储 缓存 安全
【jvm系列-03】精通运行时数据区私有区域---虚拟机栈、程序计数器、本地方法栈
【jvm系列-03】精通运行时数据区私有区域---虚拟机栈、程序计数器、本地方法栈
57 0