1. 以root身份登录host,创建image目录和iso目录
$ mkdir -p /VmImage
$ mkdir -p /VmIso
2.使用virsh定义VM image及OS iso存放目录
$virsh pool-define-as <Name> <Format> - - - - "Path"
$virsh pool-define-as VM-Image dir - - - - "/VmImage"
$virsh pool-define-as VM-Iso dir - - - - "/VmIso/"
3. 查看pool状态
root@ubuntu-kvm-server:/# virsh pool-list --all
setlocale: No such file or directory
Name State Autostart
-----------------------------------------
default active yes
VM-Image inactive no
VM-Iso inactive no
4. start pool并设为autostart
$ virsh pool-start VM-Image
Pool VM-Image started
$ virsh pool-start VM-Iso
Pool VM-Iso started
$ virsh pool-autostart VM-Image
Pool VM-Image marked as autostarted
$ virsh pool-autostart VM-Iso
Pool VM-Iso marked as autostarted
5. 确认pool状态
root@ubuntu-kvm-server:/# virsh pool-list --all
setlocale: No such file or directory
Name State Autostart
-----------------------------------------
default active yes
VM-Image active yes
VM-Iso active yes
分享到:
相关推荐
4. **创建虚拟机**:使用`virsh`或`virt-install`命令创建虚拟机。例如: ``` virt-install --name=linux --ram=1024 --vcpus=1 -cdrom /path/to/iso/file -disk path=/path/to/disk/file,format=qcow2 ``` 这里...
KVM利用了现代处理器的硬件辅助虚拟化特性(例如Intel VT-x或AMD-V),提供了对全虚拟化的支持,这意味着可以在没有修改操作系统的情况下运行客户机操作系统。 与其他虚拟化解决方案相比,KVM具有以下特点: - **轻...
在本示例中,我们将探讨如何使用 `virsh-install` 工具结合 preseed 文件来创建一个预配置的 Debian 虚拟机。 `virsh` 是libvirt项目的一个命令行工具,用于管理和控制虚拟机。`virsh-install` 是 virsh 提供的一个...
可以使用 egrep 命令检查 CPU 是否支持虚拟化,使用 kvm-ok 命令检查 KVM 是否正常工作,使用 lsmod 命令检查 kvm 模块是否已经加载,使用 virsh 命令检查虚拟机管理程序是否正常工作。 系统初始化配置 在虚拟化...
qemu-img convert -f qcow2 -O raw /path/to/image.qcow2 /path/to/image.raw # Convert disk image format ``` 3. **`ssh`:** - Use `ssh` for secure remote connections and file transfers: ```bash ssh ...