【发布时间】:2017-01-04 11:39:02
【问题描述】:
我的任务是通过将 virt-install 编写为 shell 脚本来创建虚拟设备。如何在 python 脚本中实现相同的功能?我是 virt-install 和 python 的新手。谢谢!
virt-install \
--name centos7 \
--ram 1024 \
--disk path=./centos7.qcow2,size=8 \
--vcpus 1 \
--os-type linux \
--os-variant centos7 \
--network bridge=virbr0 \
--graphics none \
--console pty,target_type=serial \
--location 'http://mirror.i3d.net/pub/centos/7/os/x86_64/' \
--extra-args 'console=ttyS0,115200n8 serial'
(virtinstall.sh) 并且运行良好。
【问题讨论】:
标签: python shell virtual-machine libvirt