26
2011
04

VMware vSphere “HostDatastoreSystem.QueryVmfsDatastoreCreateOptions”故障解决

在做VMware vSphere测试iSCSI存储时,挂载iSCSI磁盘出现如下报错:

在 vCenter Server“WIN2K8-A”上调用对象 “datastoreSystem-19”的“HostDatastoreSystem.QueryVmfsDatastoreCreateOptions” 失败。

测试环境如下:

  • 两台esx Server
  • 一台windows 2008做vCenter
  • freenas做iscsi服务器

 报错界面如下:

VMware vSphere“HostDatastoreSystem.QueryVmfsDatastoreCreateOptions”故障解决

解决方法:

alt+F1或者通过ssh登录到VMware vSphere控制台

首先查看磁盘状态

[root@esx-a ~]# fdisk -l

Disk /dev/sda: 85.8 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         140     1124518+  83  Linux
/dev/sda2             141         154      112455   fc  VMware VMKCORE
/dev/sda3             155       10443    82646392+   5  Extended
/dev/sda5             155       10443    82646361   fb  VMware VMFS

Disk /dev/sdb: 7973 MB, 7973371904 bytes
255 heads, 63 sectors/track, 969 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          76      610438+  82  Linux swap / Solaris
/dev/sdb2              77         331     2048287+  83  Linux
/dev/sdb3             332         969     5124735    5  Extended
/dev/sdb5             332         969     5124703+  83  Linux

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sdc: 42.9 GB, 42949672960 bytes
256 heads, 63 sectors/track, 5201 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1      266306  2147483647+  ee  EFI GPT

Disk /dev/sdd: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1        3916    31455206   fb  VMware VMFS

可以看到出现故障的是/dec/sdc的这块硬盘,VMware vSphere目前不支持GPT分区表,建议使用parted命令进行修改。

这块iscsi硬盘由于在windows系统中挂载过,并且进行过格式化,使用的GPT分区,因此出现报错。

开始使用parted命令进行修复(关于parted命令可用参考[使用parted命令对linux硬盘进行操作] )

[root@esx-a ~]# parted /dev/sdc
GNU Parted 1.8.1
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            (查看分区情况)
Warning: /dev/sdc contains GPT signatures, indicating that it has a GPT table.  However, it does not have a valid fake msdos partition table, as it should.  Perhaps it was corrupted -- possibly by a program that doesn't understand GPT partition tables.  Or perhaps you deleted the GPT table, and are now using an msdos partition table.  Is this a GPT partition table?
Yes/No? n                                                                

Command (m for help): m        (列出可用命令)
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): d        (删除现有分区)

Command (m for help): n        (新建分区)
        Command action
   e   extended
   p   primary partition (1-4)
p        (新建主分区)
Partition number (1-4): 1
First sector (32-83886079, default 32):
Using default value 32
Last sector or +size or +sizeM or +sizeK (32-83886079, default 83886079):
Using default value 83886079
 

Command (m for help): p        (查看分区)

Disk /dev/sdc: 42.9 GB, 42949672960 bytes
64 heads, 32 sectors/track, 40960 cylinders, total 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1              32    83886079    41943024   83  Linux

Command (m for help): t        (更改分区格式)
Selected partition 1
Hex code (type L to list codes): fb        (fb是VMware VMFS分区的代码)
Changed system type of partition 1 to fb (VMware VMFS)

Command (m for help): p        (查看新建的分区)

Disk /dev/sdc: 42.9 GB, 42949672960 bytes
64 heads, 32 sectors/track, 40960 cylinders, total 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1              32    83886079    41943024   fb  VMware VMFS

Command (m for help): w        (保存修改)
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@esx-a ~]#

最后再查看一下磁盘状态:

[root@esx-a ~]# fdisk -l

Disk /dev/sda: 85.8 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         140     1124518+  83  Linux
/dev/sda2             141         154      112455   fc  VMware VMKCORE
/dev/sda3             155       10443    82646392+   5  Extended
/dev/sda5             155       10443    82646361   fb  VMware VMFS

Disk /dev/sdb: 7973 MB, 7973371904 bytes
255 heads, 63 sectors/track, 969 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          76      610438+  82  Linux swap / Solaris
/dev/sdb2              77         331     2048287+  83  Linux
/dev/sdb3             332         969     5124735    5  Extended
/dev/sdb5             332         969     5124703+  83  Linux

Disk /dev/sdc: 42.9 GB, 42949672960 bytes
64 heads, 32 sectors/track, 40960 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       40960    41943024   fb  VMware VMFS

Disk /dev/sdd: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1        3916    31455206   fb  VMware VMFS
[root@esx-a ~]#

磁盘/dev/sdc的报错信息没有了。

重新在VMware vSphere挂载iscsi硬盘顺利通过。

« 上一篇下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。