环境:ESXi6.5,安装安装完毕添加硬盘时报错“HostDatastoreSystem.QueryVmfsDatastoreCreateOptions”。
根据资料显示,报错原因为之前硬盘安装过Windows server操作系统。
解决方式:
开启ESXi SSH,连接后查看磁盘情况
The ESXi Shell can be disabled by an administrative user. See the
vSphere Security documentation for more information.
[root@localhost:~]
[root@localhost:~]
[root@localhost:~] fdisk -l
***
*** The fdisk command is deprecated: fdisk does not handle GPT partitions. Please use partedUtil
***
Found valid GPT with protective MBR; using GPT
Disk /dev/disks/naa.61866da06192eb002482682d07310257: 1170997248 sectors, 2432M
Logical sector size: 512
Disk identifier (GUID): 2e2fdd3e-f25c-4d0c-87a6-f866ebf484cb
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1170997214
Number Start (sector) End (sector) Size Code Name
1 64 8191 4064K 0700
2 7086080 15472639 4095M 0700
3 15472640 1170997214 550G 0700
5 8224 520191 249M 0700
6 520224 1032191 249M 0700
7 1032224 1257471 109M 0700
8 1257504 1843199 285M 0700
9 1843200 7086079 2560M 0700
Found valid GPT with protective MBR; using GPT
Disk /dev/disks/naa.61866da06192eb002482685b09ee2eac: 3905945600 sectors, 2560M
Logical sector size: 512
Disk identifier (GUID): b4197680-aa13-4d17-b1d5-6a78ace5f06d
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 3905945566
Number Start (sector) End (sector) Size Code Name
1 2048 3905945566 1862G 0700
Found valid GPT with protective MBR; using GPT
Disk /dev/disks/naa.61866da06192eb002482684e092c2d3b: 3123183616 sectors, 1280M
Logical sector size: 512
Disk identifier (GUID): cddb3b8b-bdf2-4f49-ac10-a332599cddcb
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 4684775390
Number Start (sector) End (sector) Size Code Name
1 34 262177 128M 0700 Microsoft reserved partition
2 264192 4684773375 2233G 0700 Basic data partition
[root@localhost:~] ls /vmfs/devices/disks
naa.61866da06192eb002482682d07310257 vml.020000000061866da06192eb002482682d07310257504552432048
naa.61866da06192eb002482682d07310257:1 vml.020000000061866da06192eb002482682d07310257504552432048:1
naa.61866da06192eb002482682d07310257:2 vml.020000000061866da06192eb002482682d07310257504552432048:2
naa.61866da06192eb002482682d07310257:3 vml.020000000061866da06192eb002482682d07310257504552432048:3
naa.61866da06192eb002482682d07310257:5 vml.020000000061866da06192eb002482682d07310257504552432048:5
naa.61866da06192eb002482682d07310257:6 vml.020000000061866da06192eb002482682d07310257504552432048:6
naa.61866da06192eb002482682d07310257:7 vml.020000000061866da06192eb002482682d07310257504552432048:7
naa.61866da06192eb002482682d07310257:8 vml.020000000061866da06192eb002482682d07310257504552432048:8
naa.61866da06192eb002482682d07310257:9 vml.020000000061866da06192eb002482682d07310257504552432048:9
naa.61866da06192eb002482684e092c2d3b vml.020000000061866da06192eb002482684e092c2d3b504552432048
naa.61866da06192eb002482684e092c2d3b:1 vml.020000000061866da06192eb002482684e092c2d3b504552432048:1
naa.61866da06192eb002482684e092c2d3b:2 vml.020000000061866da06192eb002482684e092c2d3b504552432048:2
naa.61866da06192eb002482685b09ee2eac vml.020000000061866da06192eb002482685b09ee2eac504552432048
naa.61866da06192eb002482685b09ee2eac:1 vml.020000000061866da06192eb002482685b09ee2eac504552432048:1
使用partedUtil创建新的卷标
[root@localhost:~] partedUtil -h
Usage:
Get Partitions : get
Set Partitions : set
Delete Partition : delete
Resize Partition : resize
Get Partitions : getptbl
Set Partitions : setptbl
[root@localhost:~] ls /vmfs/devices/disks
naa.61866da06192eb002482682d07310257 vml.020000000061866da06192eb002482682d07310257504552432048
naa.61866da06192eb002482682d07310257:1 vml.020000000061866da06192eb002482682d07310257504552432048:1
naa.61866da06192eb002482682d07310257:2 vml.020000000061866da06192eb002482682d07310257504552432048:2
naa.61866da06192eb002482682d07310257:3 vml.020000000061866da06192eb002482682d07310257504552432048:3
naa.61866da06192eb002482682d07310257:5 vml.020000000061866da06192eb002482682d07310257504552432048:5
naa.61866da06192eb002482682d07310257:6 vml.020000000061866da06192eb002482682d07310257504552432048:6
naa.61866da06192eb002482682d07310257:7 vml.020000000061866da06192eb002482682d07310257504552432048:7
naa.61866da06192eb002482682d07310257:8 vml.020000000061866da06192eb002482682d07310257504552432048:8
naa.61866da06192eb002482682d07310257:9 vml.020000000061866da06192eb002482682d07310257504552432048:9
naa.61866da06192eb002482684e092c2d3b vml.020000000061866da06192eb002482684e092c2d3b504552432048
naa.61866da06192eb002482684e092c2d3b:1 vml.020000000061866da06192eb002482684e092c2d3b504552432048:1
naa.61866da06192eb002482684e092c2d3b:2 vml.020000000061866da06192eb002482684e092c2d3b504552432048:2
naa.61866da06192eb002482685b09ee2eac vml.020000000061866da06192eb002482685b09ee2eac504552432048
naa.61866da06192eb002482685b09ee2eac:1 vml.020000000061866da06192eb002482685b09ee2eac504552432048:1
删除不能添加的存储,在主机上重新添加即可。
[root@localhost:~] partedUtil mklabel /dev/disks/naa.61866da06192eb002482684e092c2d3b msdos
[root@localhost:~] ls /vmfs/devices/disks
naa.61866da06192eb002482682d07310257 vml.020000000061866da06192eb002482682d07310257504552432048
naa.61866da06192eb002482682d07310257:1 vml.020000000061866da06192eb002482682d07310257504552432048:1
naa.61866da06192eb002482682d07310257:2 vml.020000000061866da06192eb002482682d07310257504552432048:2
naa.61866da06192eb002482682d07310257:3 vml.020000000061866da06192eb002482682d07310257504552432048:3
naa.61866da06192eb002482682d07310257:5 vml.020000000061866da06192eb002482682d07310257504552432048:5
naa.61866da06192eb002482682d07310257:6 vml.020000000061866da06192eb002482682d07310257504552432048:6
naa.61866da06192eb002482682d07310257:7 vml.020000000061866da06192eb002482682d07310257504552432048:7
naa.61866da06192eb002482682d07310257:8 vml.020000000061866da06192eb002482682d07310257504552432048:8
naa.61866da06192eb002482682d07310257:9 vml.020000000061866da06192eb002482682d07310257504552432048:9
naa.61866da06192eb002482684e092c2d3b vml.020000000061866da06192eb002482684e092c2d3b504552432048
naa.61866da06192eb002482685b09ee2eac vml.020000000061866da06192eb002482685b09ee2eac504552432048
naa.61866da06192eb002482685b09ee2eac:1 vml.020000000061866da06192eb002482685b09ee2eac504552432048:1
删除前后截图比较。