oneclickvirt / pve

PVE相关的各种一键脚本(Various one-click scripts related to PVE)(一键安装PVE)(One-click installation of PVE)(一键开设KVM或LXC虚拟化的NAT服务器-自带内外网端口转发)(含ARM和X86_64)
https://t.me/Dedicated_Server_Moniter
MIT License
460 stars 75 forks source link

指定存储池好像有问题,用local 是正常的。 #24

Open madlaxcb opened 4 hours ago

madlaxcb commented 4 hours ago

指定存储池好像有问题,用local 是正常的。 ls: cannot access '/var/lib/vz/images/102/*.raw': No such file or directory

zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
zpool  7.25T   780K  7.25T        -         -     0%     0%  1.00x    ONLINE  -
./buildvm.sh 102 test1 oneclick123 1 512 10 40001 40002 40003 50000 50025 debian11 zpool N
Locale set to C.utf8
CDN available, using CDN
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  465M  100  465M    0     0  28.6M      0  0:00:16  0:00:16 --:--:-- 30.7M
Use auto-fixed image: debian11
importing disk '/root/qcow/debian11.qcow2' to VM 102 ...
transferred 0.0 B of 2.0 GiB (0.00%)
transferred 20.4 MiB of 2.0 GiB (1.02%)
transferred 40.6 MiB of 2.0 GiB (2.03%)
transferred 60.6 MiB of 2.0 GiB (3.03%)
transferred 80.8 MiB of 2.0 GiB (4.04%)
transferred 101.0 MiB of 2.0 GiB (5.05%)
transferred 121.0 MiB of 2.0 GiB (6.05%)
transferred 141.2 MiB of 2.0 GiB (7.06%)
transferred 161.2 MiB of 2.0 GiB (8.06%)
transferred 181.4 MiB of 2.0 GiB (9.07%)
transferred 201.6 MiB of 2.0 GiB (10.08%)
transferred 221.6 MiB of 2.0 GiB (11.08%)
transferred 241.8 MiB of 2.0 GiB (12.09%)
transferred 261.8 MiB of 2.0 GiB (13.09%)
transferred 282.0 MiB of 2.0 GiB (14.10%)
transferred 302.2 MiB of 2.0 GiB (15.11%)
transferred 322.2 MiB of 2.0 GiB (16.11%)
transferred 342.4 MiB of 2.0 GiB (17.12%)
transferred 362.6 MiB of 2.0 GiB (18.13%)
transferred 382.6 MiB of 2.0 GiB (19.13%)
transferred 402.8 MiB of 2.0 GiB (20.14%)
transferred 422.8 MiB of 2.0 GiB (21.14%)
transferred 443.0 MiB of 2.0 GiB (22.15%)
transferred 463.2 MiB of 2.0 GiB (23.16%)
transferred 483.2 MiB of 2.0 GiB (24.16%)
transferred 503.4 MiB of 2.0 GiB (25.17%)
transferred 523.6 MiB of 2.0 GiB (26.18%)
transferred 543.6 MiB of 2.0 GiB (27.18%)
transferred 563.8 MiB of 2.0 GiB (28.19%)
transferred 583.8 MiB of 2.0 GiB (29.19%)
transferred 605.6 MiB of 2.0 GiB (30.28%)
transferred 625.8 MiB of 2.0 GiB (31.29%)
transferred 645.8 MiB of 2.0 GiB (32.29%)
transferred 666.0 MiB of 2.0 GiB (33.30%)
transferred 686.2 MiB of 2.0 GiB (34.31%)
transferred 710.6 MiB of 2.0 GiB (35.53%)
transferred 733.4 MiB of 2.0 GiB (36.67%)
transferred 757.0 MiB of 2.0 GiB (37.85%)
transferred 777.0 MiB of 2.0 GiB (38.85%)
transferred 801.6 MiB of 2.0 GiB (40.08%)
transferred 823.2 MiB of 2.0 GiB (41.16%)
transferred 847.6 MiB of 2.0 GiB (42.38%)
transferred 869.0 MiB of 2.0 GiB (43.45%)
transferred 889.2 MiB of 2.0 GiB (44.46%)
transferred 912.6 MiB of 2.0 GiB (45.63%)
transferred 936.2 MiB of 2.0 GiB (46.81%)
transferred 959.6 MiB of 2.0 GiB (47.98%)
transferred 982.2 MiB of 2.0 GiB (49.11%)
transferred 1006.6 MiB of 2.0 GiB (50.33%)
transferred 1.0 GiB of 2.0 GiB (51.51%)
transferred 1.0 GiB of 2.0 GiB (52.53%)
transferred 1.0 GiB of 2.0 GiB (53.69%)
transferred 1.1 GiB of 2.0 GiB (54.84%)
transferred 1.1 GiB of 2.0 GiB (55.99%)
transferred 1.1 GiB of 2.0 GiB (56.99%)
transferred 1.1 GiB of 2.0 GiB (58.00%)
transferred 1.2 GiB of 2.0 GiB (59.00%)
transferred 1.2 GiB of 2.0 GiB (60.01%)
transferred 1.2 GiB of 2.0 GiB (61.02%)
transferred 1.2 GiB of 2.0 GiB (62.02%)
transferred 1.2 GiB of 2.0 GiB (63.06%)
transferred 1.3 GiB of 2.0 GiB (64.06%)
transferred 1.3 GiB of 2.0 GiB (65.07%)
transferred 1.3 GiB of 2.0 GiB (66.08%)
transferred 1.3 GiB of 2.0 GiB (67.08%)
transferred 1.3 GiB of 2.0 GiB (68.09%)
transferred 1.3 GiB of 2.0 GiB (69.12%)
transferred 1.4 GiB of 2.0 GiB (70.31%)
transferred 1.4 GiB of 2.0 GiB (71.49%)
transferred 1.4 GiB of 2.0 GiB (72.61%)
transferred 1.4 GiB of 2.0 GiB (73.78%)
transferred 1.5 GiB of 2.0 GiB (75.01%)
transferred 1.5 GiB of 2.0 GiB (76.02%)
transferred 1.5 GiB of 2.0 GiB (77.03%)
transferred 1.5 GiB of 2.0 GiB (78.03%)
transferred 1.5 GiB of 2.0 GiB (79.04%)
transferred 1.6 GiB of 2.0 GiB (80.05%)
transferred 1.6 GiB of 2.0 GiB (81.05%)
transferred 1.6 GiB of 2.0 GiB (82.06%)
transferred 1.6 GiB of 2.0 GiB (83.06%)
transferred 1.6 GiB of 2.0 GiB (84.07%)
transferred 1.7 GiB of 2.0 GiB (85.08%)
transferred 1.7 GiB of 2.0 GiB (86.08%)
transferred 1.7 GiB of 2.0 GiB (87.09%)
transferred 1.7 GiB of 2.0 GiB (88.09%)
transferred 1.7 GiB of 2.0 GiB (89.10%)
transferred 1.8 GiB of 2.0 GiB (90.11%)
transferred 1.8 GiB of 2.0 GiB (91.11%)
transferred 1.8 GiB of 2.0 GiB (92.12%)
transferred 1.8 GiB of 2.0 GiB (93.13%)
transferred 1.8 GiB of 2.0 GiB (94.13%)
transferred 1.9 GiB of 2.0 GiB (95.14%)
transferred 1.9 GiB of 2.0 GiB (96.15%)
transferred 1.9 GiB of 2.0 GiB (97.33%)
transferred 1.9 GiB of 2.0 GiB (98.33%)
transferred 1.9 GiB of 2.0 GiB (99.37%)
transferred 2.0 GiB of 2.0 GiB (100.00%)
transferred 2.0 GiB of 2.0 GiB (100.00%)
Successfully imported disk as 'unused0:zpool:vm-102-disk-0'
ls: cannot access '/var/lib/vz/images/102/*.raw': No such file or directory
basename: missing operand
Try 'basename --help' for more information.
unable to parse zfs volume name '102/vm-102-disk-0.raw'
update VM 102: -bootdisk scsi0
update VM 102: -boot order=scsi0
invalid bootorder: device 'scsi0' does not exist'
update VM 102: -memory 512
update VM 102: -ide2 zpool:cloudinit
ide2: successfully created disk 'zpool:vm-102-cloudinit,media=cdrom'
Use of uninitialized value in split at /usr/share/perl5/PVE/QemuServer/Cloudinit.pm line 105.
generating cloud-init ISO
update VM 102: -ipconfig0 ip=172.16.1.2/24,gw=172.16.1.1
update VM 102: -nameserver 8.8.8.8
update VM 102: -searchdomain local
update VM 102: -cipassword <hidden> -ciuser test1
disk 'scsi0' does not exist
generating cloud-init ISO
102 test1 oneclick123 1 512 10 40001 40002 40003 50000 50025 debian11 zpool
./buildvm.sh 102 test1 oneclick123 1 512 10 40001 40002 40003 50000 50025 debian11 local N
Locale set to C.utf8
importing disk '/root/qcow/debian11.qcow2' to VM 102 ...
Formatting '/var/lib/vz/images/102/vm-102-disk-0.raw', fmt=raw size=2097152000 preallocation=off
transferred 0.0 B of 2.0 GiB (0.00%)
transferred 20.4 MiB of 2.0 GiB (1.02%)
transferred 40.6 MiB of 2.0 GiB (2.03%)
transferred 60.6 MiB of 2.0 GiB (3.03%)
transferred 80.8 MiB of 2.0 GiB (4.04%)
transferred 101.0 MiB of 2.0 GiB (5.05%)
transferred 121.0 MiB of 2.0 GiB (6.05%)
transferred 141.2 MiB of 2.0 GiB (7.06%)
transferred 161.2 MiB of 2.0 GiB (8.06%)
transferred 181.4 MiB of 2.0 GiB (9.07%)
transferred 201.6 MiB of 2.0 GiB (10.08%)
transferred 221.6 MiB of 2.0 GiB (11.08%)
transferred 241.8 MiB of 2.0 GiB (12.09%)
transferred 261.8 MiB of 2.0 GiB (13.09%)
transferred 282.0 MiB of 2.0 GiB (14.10%)
transferred 302.2 MiB of 2.0 GiB (15.11%)
transferred 322.2 MiB of 2.0 GiB (16.11%)
transferred 342.4 MiB of 2.0 GiB (17.12%)
transferred 362.6 MiB of 2.0 GiB (18.13%)
transferred 382.6 MiB of 2.0 GiB (19.13%)
transferred 402.8 MiB of 2.0 GiB (20.14%)
transferred 422.8 MiB of 2.0 GiB (21.14%)
transferred 443.0 MiB of 2.0 GiB (22.15%)
transferred 463.2 MiB of 2.0 GiB (23.16%)
transferred 483.2 MiB of 2.0 GiB (24.16%)
transferred 503.4 MiB of 2.0 GiB (25.17%)
transferred 523.6 MiB of 2.0 GiB (26.18%)
transferred 543.6 MiB of 2.0 GiB (27.18%)
transferred 563.8 MiB of 2.0 GiB (28.19%)
transferred 583.8 MiB of 2.0 GiB (29.19%)
transferred 605.6 MiB of 2.0 GiB (30.28%)
transferred 625.8 MiB of 2.0 GiB (31.29%)
transferred 645.8 MiB of 2.0 GiB (32.29%)
transferred 666.0 MiB of 2.0 GiB (33.30%)
transferred 686.2 MiB of 2.0 GiB (34.31%)
transferred 710.6 MiB of 2.0 GiB (35.53%)
transferred 733.4 MiB of 2.0 GiB (36.67%)
transferred 757.0 MiB of 2.0 GiB (37.85%)
transferred 777.0 MiB of 2.0 GiB (38.85%)
transferred 801.6 MiB of 2.0 GiB (40.08%)
transferred 823.2 MiB of 2.0 GiB (41.16%)
transferred 847.6 MiB of 2.0 GiB (42.38%)
transferred 869.0 MiB of 2.0 GiB (43.45%)
transferred 889.2 MiB of 2.0 GiB (44.46%)
transferred 912.6 MiB of 2.0 GiB (45.63%)
transferred 936.2 MiB of 2.0 GiB (46.81%)
transferred 959.6 MiB of 2.0 GiB (47.98%)
transferred 982.2 MiB of 2.0 GiB (49.11%)
transferred 1006.6 MiB of 2.0 GiB (50.33%)
transferred 1.0 GiB of 2.0 GiB (51.51%)
transferred 1.0 GiB of 2.0 GiB (52.53%)
transferred 1.0 GiB of 2.0 GiB (53.69%)
transferred 1.1 GiB of 2.0 GiB (54.84%)
transferred 1.1 GiB of 2.0 GiB (55.99%)
transferred 1.1 GiB of 2.0 GiB (56.99%)
transferred 1.1 GiB of 2.0 GiB (58.00%)
transferred 1.2 GiB of 2.0 GiB (59.00%)
transferred 1.2 GiB of 2.0 GiB (60.01%)
transferred 1.2 GiB of 2.0 GiB (61.02%)
transferred 1.2 GiB of 2.0 GiB (62.02%)
transferred 1.2 GiB of 2.0 GiB (63.06%)
transferred 1.3 GiB of 2.0 GiB (64.06%)
transferred 1.3 GiB of 2.0 GiB (65.07%)
transferred 1.3 GiB of 2.0 GiB (66.08%)
transferred 1.3 GiB of 2.0 GiB (67.08%)
transferred 1.3 GiB of 2.0 GiB (68.09%)
transferred 1.3 GiB of 2.0 GiB (69.12%)
transferred 1.4 GiB of 2.0 GiB (70.31%)
transferred 1.4 GiB of 2.0 GiB (71.49%)
transferred 1.4 GiB of 2.0 GiB (72.61%)
transferred 1.4 GiB of 2.0 GiB (73.78%)
transferred 1.5 GiB of 2.0 GiB (75.01%)
transferred 1.5 GiB of 2.0 GiB (76.02%)
transferred 1.5 GiB of 2.0 GiB (77.03%)
transferred 1.5 GiB of 2.0 GiB (78.03%)
transferred 1.5 GiB of 2.0 GiB (79.04%)
transferred 1.6 GiB of 2.0 GiB (80.05%)
transferred 1.6 GiB of 2.0 GiB (81.05%)
transferred 1.6 GiB of 2.0 GiB (82.06%)
transferred 1.6 GiB of 2.0 GiB (83.06%)
transferred 1.6 GiB of 2.0 GiB (84.07%)
transferred 1.7 GiB of 2.0 GiB (85.08%)
transferred 1.7 GiB of 2.0 GiB (86.08%)
transferred 1.7 GiB of 2.0 GiB (87.09%)
transferred 1.7 GiB of 2.0 GiB (88.09%)
transferred 1.7 GiB of 2.0 GiB (89.10%)
transferred 1.8 GiB of 2.0 GiB (90.11%)
transferred 1.8 GiB of 2.0 GiB (91.11%)
transferred 1.8 GiB of 2.0 GiB (92.12%)
transferred 1.8 GiB of 2.0 GiB (93.13%)
transferred 1.8 GiB of 2.0 GiB (94.13%)
transferred 1.9 GiB of 2.0 GiB (95.14%)
transferred 1.9 GiB of 2.0 GiB (96.15%)
transferred 1.9 GiB of 2.0 GiB (97.33%)
transferred 1.9 GiB of 2.0 GiB (98.33%)
transferred 1.9 GiB of 2.0 GiB (99.37%)
transferred 2.0 GiB of 2.0 GiB (100.00%)
transferred 2.0 GiB of 2.0 GiB (100.00%)
Successfully imported disk as 'unused0:local:102/vm-102-disk-0.raw'
update VM 102: -scsi0 local:102/vm-102-disk-0.raw -scsihw virtio-scsi-pci
update VM 102: -bootdisk scsi0
update VM 102: -boot order=scsi0
update VM 102: -memory 512
update VM 102: -ide2 local:cloudinit
Formatting '/var/lib/vz/images/102/vm-102-cloudinit.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off preallocation=metadata compression_type=zlib size=4194304 lazy_refcounts=off refcount_bits=16
ide2: successfully created disk 'local:102/vm-102-cloudinit.qcow2,media=cdrom'
Use of uninitialized value in split at /usr/share/perl5/PVE/QemuServer/Cloudinit.pm line 105.
generating cloud-init ISO
update VM 102: -ipconfig0 ip=172.16.1.2/24,gw=172.16.1.1
update VM 102: -nameserver 8.8.8.8
update VM 102: -searchdomain local
update VM 102: -cipassword <hidden> -ciuser test1
Image resized.
generating cloud-init ISO
102 test1 oneclick123 1 512 10 40001 40002 40003 50000 50025 debian11 local
spiritLHLS commented 3 hours ago

web面板上有加载了吗?

spiritLHLS commented 3 hours ago

1731755799973(1) 这块

spiritLHLS commented 3 hours ago

要使用

pvesm status

查看可用的存储池

madlaxcb commented 2 hours ago

要使用

pvesm status

查看可用的存储池

pvesm status Name Type Status Total Used Available % local dir active 97590272 12831512 84758760 13.15% zpool zfspool active 7650410496 7561332756 89077740 98.84%

现在手动开几然后开了个盘,占用满了 ,之前脚本开的时候zpool是空的

spiritLHLS commented 2 hours ago

唔,大概知道什么问题了

pvesm path ${storage}:${vm_num}

改成你现在实际开好的虚拟机,看看结果

madlaxcb commented 1 hour ago

唔,大概知道什么问题了

pvesm path ${storage}:${vm_num}

改成你现在实际开好的虚拟机,看看结果

图片 我现在是local开的一台机,挂载了zpool的盘。

spiritLHLS commented 50 minutes ago

Fixed.

你更新shell脚本后看看有没有什么问题

madlaxcb commented 43 minutes ago

Fixed.

你更新shell脚本后看看有没有什么问题

图片

./buildvm.sh 103 test1 oneclick123 1 512 10 40011 40012 40013 50010 50035 debian11 zpool N Locale set to C.utf8 importing disk '/root/qcow/debian11.qcow2' to VM 103 ... transferred 0.0 B of 2.0 GiB (0.00%) transferred 20.4 MiB of 2.0 GiB (1.02%) transferred 40.6 MiB of 2.0 GiB (2.03%) transferred 60.6 MiB of 2.0 GiB (3.03%) transferred 80.8 MiB of 2.0 GiB (4.04%) transferred 101.0 MiB of 2.0 GiB (5.05%) transferred 121.0 MiB of 2.0 GiB (6.05%) transferred 141.2 MiB of 2.0 GiB (7.06%) transferred 161.2 MiB of 2.0 GiB (8.06%) transferred 181.4 MiB of 2.0 GiB (9.07%) transferred 201.6 MiB of 2.0 GiB (10.08%) transferred 221.6 MiB of 2.0 GiB (11.08%) transferred 241.8 MiB of 2.0 GiB (12.09%) transferred 261.8 MiB of 2.0 GiB (13.09%) transferred 282.0 MiB of 2.0 GiB (14.10%) transferred 302.2 MiB of 2.0 GiB (15.11%) transferred 322.2 MiB of 2.0 GiB (16.11%) transferred 342.4 MiB of 2.0 GiB (17.12%) transferred 362.6 MiB of 2.0 GiB (18.13%) transferred 382.6 MiB of 2.0 GiB (19.13%) transferred 402.8 MiB of 2.0 GiB (20.14%) transferred 422.8 MiB of 2.0 GiB (21.14%) transferred 443.0 MiB of 2.0 GiB (22.15%) transferred 463.2 MiB of 2.0 GiB (23.16%) transferred 483.2 MiB of 2.0 GiB (24.16%) transferred 503.4 MiB of 2.0 GiB (25.17%) transferred 523.6 MiB of 2.0 GiB (26.18%) transferred 543.6 MiB of 2.0 GiB (27.18%) transferred 563.8 MiB of 2.0 GiB (28.19%) transferred 583.8 MiB of 2.0 GiB (29.19%) transferred 605.6 MiB of 2.0 GiB (30.28%) transferred 625.8 MiB of 2.0 GiB (31.29%) transferred 645.8 MiB of 2.0 GiB (32.29%) transferred 666.0 MiB of 2.0 GiB (33.30%) transferred 686.2 MiB of 2.0 GiB (34.31%) transferred 710.6 MiB of 2.0 GiB (35.53%) transferred 733.4 MiB of 2.0 GiB (36.67%) transferred 757.0 MiB of 2.0 GiB (37.85%) transferred 777.0 MiB of 2.0 GiB (38.85%) transferred 801.6 MiB of 2.0 GiB (40.08%) transferred 823.2 MiB of 2.0 GiB (41.16%) transferred 847.6 MiB of 2.0 GiB (42.38%) transferred 869.0 MiB of 2.0 GiB (43.45%) transferred 889.2 MiB of 2.0 GiB (44.46%) transferred 912.6 MiB of 2.0 GiB (45.63%) transferred 936.2 MiB of 2.0 GiB (46.81%) transferred 959.6 MiB of 2.0 GiB (47.98%) transferred 982.2 MiB of 2.0 GiB (49.11%) transferred 1006.6 MiB of 2.0 GiB (50.33%) transferred 1.0 GiB of 2.0 GiB (51.51%) transferred 1.0 GiB of 2.0 GiB (52.53%) transferred 1.0 GiB of 2.0 GiB (53.69%) transferred 1.1 GiB of 2.0 GiB (54.84%) transferred 1.1 GiB of 2.0 GiB (55.99%) transferred 1.1 GiB of 2.0 GiB (56.99%) transferred 1.1 GiB of 2.0 GiB (58.00%) transferred 1.2 GiB of 2.0 GiB (59.00%) transferred 1.2 GiB of 2.0 GiB (60.01%) transferred 1.2 GiB of 2.0 GiB (61.02%) transferred 1.2 GiB of 2.0 GiB (62.02%) transferred 1.2 GiB of 2.0 GiB (63.06%) transferred 1.3 GiB of 2.0 GiB (64.06%) transferred 1.3 GiB of 2.0 GiB (65.07%) transferred 1.3 GiB of 2.0 GiB (66.08%) transferred 1.3 GiB of 2.0 GiB (67.08%) transferred 1.3 GiB of 2.0 GiB (68.09%) transferred 1.3 GiB of 2.0 GiB (69.12%) transferred 1.4 GiB of 2.0 GiB (70.31%) transferred 1.4 GiB of 2.0 GiB (71.49%) transferred 1.4 GiB of 2.0 GiB (72.61%) transferred 1.4 GiB of 2.0 GiB (73.78%) transferred 1.5 GiB of 2.0 GiB (75.01%) transferred 1.5 GiB of 2.0 GiB (76.02%) transferred 1.5 GiB of 2.0 GiB (77.03%) transferred 1.5 GiB of 2.0 GiB (78.03%) transferred 1.5 GiB of 2.0 GiB (79.04%) transferred 1.6 GiB of 2.0 GiB (80.05%) transferred 1.6 GiB of 2.0 GiB (81.05%) transferred 1.6 GiB of 2.0 GiB (82.06%) transferred 1.6 GiB of 2.0 GiB (83.06%) transferred 1.6 GiB of 2.0 GiB (84.07%) transferred 1.7 GiB of 2.0 GiB (85.08%) transferred 1.7 GiB of 2.0 GiB (86.08%) transferred 1.7 GiB of 2.0 GiB (87.09%) transferred 1.7 GiB of 2.0 GiB (88.09%) transferred 1.7 GiB of 2.0 GiB (89.10%) transferred 1.8 GiB of 2.0 GiB (90.11%) transferred 1.8 GiB of 2.0 GiB (91.11%) transferred 1.8 GiB of 2.0 GiB (92.12%) transferred 1.8 GiB of 2.0 GiB (93.13%) transferred 1.8 GiB of 2.0 GiB (94.13%) transferred 1.9 GiB of 2.0 GiB (95.14%) transferred 1.9 GiB of 2.0 GiB (96.15%) transferred 1.9 GiB of 2.0 GiB (97.33%) transferred 1.9 GiB of 2.0 GiB (98.33%) transferred 1.9 GiB of 2.0 GiB (99.37%) transferred 2.0 GiB of 2.0 GiB (100.00%) transferred 2.0 GiB of 2.0 GiB (100.00%) Successfully imported disk as 'unused0:zpool:vm-103-disk-0' Error: No .raw file found for VM ID '103' in storage 'zpool'

spiritLHLS commented 41 minutes ago

pvesm list zpool 看看,识别不到vmid

spiritLHLS commented 40 minutes ago

pvesm list zpool 看看,识别不到vmid

不看我也不知道有啥不同,按理说导入应该格式就变前面名字那块才对

madlaxcb commented 40 minutes ago

pvesm list zpool

pvesm list zpool Volid Format Type Size VMID zpool:vm-102-disk-0 raw images 7623566950400 102 zpool:vm-103-disk-0 raw images 2097152000 103

spiritLHLS commented 36 minutes ago

pvesm list zpool

pvesm list zpool Volid Format Type Size VMID zpool:vm-102-disk-0 raw images 7623566950400 102 zpool:vm-103-disk-0 raw images 2097152000 103

pvesm list zpool | awk -v vmid=102 '$5 == vmid && $1 ~ /\.raw$/ {print $1}'
pvesm list zpool | awk -v vmid=103 '$5 == vmid && $1 ~ /\.raw$/ {print $1}'

有无输出

还有就是这里的102和103都是你手动开的还是脚本开的?

madlaxcb commented 34 minutes ago

102是脚本开的local的机器,然后手动添加了zpool的一块硬盘,引导盘在local。

madlaxcb commented 33 minutes ago

pvesm list zpool | awk -v vmid=102 '$5 == vmid && $1 ~ /\.raw$/ {print $1}' 执行无输出

spiritLHLS commented 31 minutes ago

pvesm list zpool | awk -v vmid=102 '$5 == vmid && $1 ~ /\.raw$/ {print $1}' 执行无输出

zpool的没有raw尾缀,我得改改函数,等等

spiritLHLS commented 26 minutes ago
pvesm list zpool | awk -v vmid=102 '$5 == vmid {print $1}'

这样应该能获取到的了,先优先匹配raw再匹配无raw的现在

已更新

madlaxcb commented 24 minutes ago
pvesm list zpool | awk -v vmid=102 '$5 == vmid {print $1}'

这样应该能获取到的了,先优先匹配raw再匹配无raw的现在

已更新

pvesm list zpool | awk -v vmid=102 '$5 == vmid {print $1}'
zpool:vm-102-disk-0
transferred 1.9 GiB of 2.0 GiB (99.37%)
transferred 2.0 GiB of 2.0 GiB (100.00%)
transferred 2.0 GiB of 2.0 GiB (100.00%)
Successfully imported disk as 'unused1:zpool:vm-103-disk-1'
No .raw file found for VM ID '103' in storage 'zpool'. Searching for other formats...
Found file: vm-103-disk-1
unable to parse zfs volume name '103/vm-103-disk-0.raw'
update VM 103: -bootdisk scsi0
update VM 103: -boot order=scsi0
invalid bootorder: device 'scsi0' does not exist'
update VM 103: -memory 512
update VM 103: -ide2 zpool:cloudinit
ide2: successfully created disk 'zpool:vm-103-cloudinit,media=cdrom'
Use of uninitialized value in split at /usr/share/perl5/PVE/QemuServer/Cloudinit.pm line 105.
generating cloud-init ISO
update VM 103: -ipconfig0 ip=172.16.1.3/24,gw=172.16.1.1
update VM 103: -nameserver 8.8.8.8
update VM 103: -searchdomain local
update VM 103: -cipassword <hidden> -ciuser test1
disk 'scsi0' does not exist
generating cloud-init ISO
103 test1 oneclick123 1 512 10 40011 40012 40013 50010 50035 debian11 zpool
spiritLHLS commented 13 minutes ago

我的锅,改了头忘记改尾巴了

spiritLHLS commented 5 minutes ago

https://github.com/oneclickvirt/pve/commit/edf15b987261992b2c19aff124272b2e09acde0f

改成了多次尝试不同格式,总该有匹配的