menu Chancel's blog
rss_feed
Chancel's blog
秋雨一何碧,山色倚晴空。

Proxmox导出Hyper-v虚拟机

作者:Chancel Yang, 时间:2022 Aug 22, 阅读:49

Proxmox的虚拟机要导出到Hyper-v中,本质上是磁盘迁移

Proxmox的虚拟机磁盘格式默认是Linux内核切割的卷,Hyper-v的磁盘格式是vhdx

下面是实践导出110虚拟机(Alpine)的磁盘到hyper-v中

查看虚拟机列表

root@machine:~# qm list
      VMID NAME                 STATUS     MEM(MB)    BOOTDISK(GB) PID       
       100 M-Windows10-LTSC     stopped    8192             128.00 0         
       101 M-Ubuntu1804         running    2048              64.00 29523     
       ......
       110 M-Alpine-Private     running    2048              32.00 2469

查找110机器的信息

root@machine:~# qm config 110
bootdisk: virtio0
cores: 2
ide2: local:iso/alpine-standard-3.16.0-x86_64.iso,media=cdrom
memory: 2048
name: M-Alpine-Private
net0: virtio=0A:D2:BE:CB:19:A8,bridge=vmbr0,firewall=1
numa: 0
ostype: l26
scsihw: virtio-scsi-pci
smbios1: uuid=894df655-4a14-4e4e-988c-014bf014e77c
sockets: 2
virtio0: local-lvm:vm-110-disk-0,backup=0,size=32G
vmgenid: a1599675-4bc0-4342-a3da-7e698d70b30f

磁盘信息是virtio0: local-lvm:vm-110-disk-0,backup=0,size=32G

查找这个磁盘的文件位置

root@machine:~# pvesm path "local-lvm:vm-110-disk-0"
/dev/pve/vm-110-disk-0

使用工具qemu-img将磁盘转换为vhdx格式输出

root@machine:~# qemu-img convert -O vhdx -f raw /dev/pve/vm-110-disk-0 alpine.3.16.1.vhdx

在Hyper-v创建虚拟机,磁盘选择我们导出的alpine.3.16.1.vhdx即可

[[replyMessage== null?"发表评论":"发表评论 @ " + replyMessage.m_author]]

account_circle
email
web_asset
textsms

评论列表([[messageResponse.total]])

还没有可以显示的留言...
[[messageItem.m_author]] [[messageItem.m_author]]
[[messageItem.create_time]]
[[getEnviron(messageItem.m_environ)]]
[[subMessage.m_author]] [[subMessage.m_author]] @ [[subMessage.parent_message.m_author]] [[subMessage.parent_message.m_author]]
[[subMessage.create_time]]
[[getEnviron(messageItem.m_environ)]]