Open madlaxcb opened 4 hours ago
web面板上有加载了吗?
这块
要使用
pvesm status
查看可用的存储池
要使用
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是空的
唔,大概知道什么问题了
pvesm path ${storage}:${vm_num}
改成你现在实际开好的虚拟机,看看结果
唔,大概知道什么问题了
pvesm path ${storage}:${vm_num}
改成你现在实际开好的虚拟机,看看结果
我现在是local开的一台机,挂载了zpool的盘。
Fixed.
你更新shell脚本后看看有没有什么问题
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'
pvesm list zpool 看看,识别不到vmid
pvesm list zpool 看看,识别不到vmid
不看我也不知道有啥不同,按理说导入应该格式就变前面名字那块才对
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
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都是你手动开的还是脚本开的?
102是脚本开的local的机器,然后手动添加了zpool的一块硬盘,引导盘在local。
pvesm list zpool | awk -v vmid=102 '$5 == vmid && $1 ~ /\.raw$/ {print $1}'
执行无输出
pvesm list zpool | awk -v vmid=102 '$5 == vmid && $1 ~ /\.raw$/ {print $1}'
执行无输出
zpool的没有raw尾缀,我得改改函数,等等
pvesm list zpool | awk -v vmid=102 '$5 == vmid {print $1}'
这样应该能获取到的了,先优先匹配raw再匹配无raw的现在
已更新
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
我的锅,改了头忘记改尾巴了
指定存储池好像有问题,用local 是正常的。 ls: cannot access '/var/lib/vz/images/102/*.raw': No such file or directory