Chinaunix首页 | 论坛 | 博客
  • 博客访问: 595576
  • 博文数量: 158
  • 博客积分: 2696
  • 博客等级: 少校
  • 技术积分: 1668
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-10 00:49
个人简介

life?is?short?,?play?more!

文章分类

全部博文(158)

文章存档

2021年(1)

2013年(10)

2012年(4)

2011年(11)

2010年(27)

2009年(28)

2008年(52)

2007年(25)

我的朋友

分类:

2008-07-14 23:22:00

只列举了一些简单的用法,具体的参数请查看 man. 这里的运行的命令,都亲自实验并成功运行.
 
1. 对一个裸设备创建vmfs3 文件系统,需要先做如下操作
 

To align VMFS volumes, the alignment will be done at ESX server level using fdisk and at the VM level. This is because both the ESX Server and the clients will put MBRs on the LUNs. The ESX must align the VMFS volume, and the client systems must align their virtual disks.

To align the ESX server:

用fdisk工具先分区,并且修改分区开始的块和分区标示.否则不能格式化文件系统.

 

1. On service console, execute fdisk /dev/sd where sd is the device on which you would like to create the VMFS.

 

2. Type "n" to create a new partition.

 

3. Type "p" to create a primary partition.

 

4. Type "1" to create partition #1.

 

5. Select the defaults to use the complete disk.

 

6. Type "x" to get into expert mode.

 

7. Type "b" to specify the starting block for partitions.

 

8. Type "1" to select partition #1.

 

9. Type "128" to make partition #1 to align on 64KB boundary.

 

10. Type "r" to return to the main menu.

 

11. Type "t" to change partition type.

 

12. Type "1" to select partition #1.

 

13. Type "fb" to set the type to fb (VMFS volume).

 

14. Type "w" to write label and the partition information to disk.

 

By declaring the partition type as fb, the ESX server will recognize the partition as an unformatted VMFS volume. You should be able to put a VMFS file system on it using the MUI or vmkfstools. Next, the virtual disks for each VM must be aligned. For Linux VMs follow the procedure listed above. For Windows VMs, use the procedure for Windows, above.

 

2.

创建卷标为 sp1 ,块大小为2MB 的一个存储器

vmkfstools -C vmfs3 -S sp1 -b 2m /vmfs/devices/disks/vmhba0\:1\:1\:1

 

Creating vmfs3 file system on "vmhba0:1:1:1" with blockSize 2097152 and volume label "sp1".

Successfully created new volume: 486977c0-4c1ca488-de18-001cc4a84d52

 

3.

存储器容量扩展(将多个分区合并为一个vmfs存储器)

 

vmkfstools -Z  /vmfs/devices/disks/vmhba2\:1\:0\:1 /vmfs/devices/disks/vmhba0\:1\:1\:1

 

 

VMware ESX Server Question:

All data on vmhba2:1:0:1 will be lost. Continue and format?

0) Yes

1) No

 

Please choose a number [0-1]: 0

 

4.

vmkfstools -r /vmfs/devices/disks/vmhba0\:1\:1\:0 rdm.vmdk

 

vmkfstools -z /vmfs/devices/disks/vmhba0\:1\:1\:0 rdm.vmdk

创建2种不同设置的rdm映射( 一个虚拟模式和一个是物理模式)

 

 

 

关于虚拟和两个模式的差别

资料描述的差别:

Map a raw disk to a file on a VMFS file system. Once the mapping is established, it can be used to access the raw disk like a normal VMFS virtual disk. The file length of the mapping is
the same as the size of the raw disk that it points to

 

Map a passthrough raw disk to a file on a VMFS file system. This allows a virtual machine to bypass the VMKernel SCSI command filtering layer done for VMFS virtual disks. Once the mapping is stablished, it can be used to access the passthrough raw disk
like a normal VMFS virtual disk.

 

 

5.

 

创建虚拟磁盘

vmkfstools -c 20G 1.vmdk

 

6.

vmkfstools -q rdm.vmdk

Disk rdm.vmdk is a Non-passthrough Raw Device Mapping

Maps to: vmhba0:1:1:0

 

查询 rdm的状态

 

7.

克隆vmdk

vmkfstools -i src.vmdk dest.vmdk

Destination disk format: VMFS thick

Cloning disk 'ne.vmdk'...

Clone: 100% done.

 

 

8.

扩展虚拟磁盘

vmkfstools -X 3g ne.vmdk

 

9.

虚拟磁盘改名

vmkfstools -E ne.vmdk ne3.vmdk

 

10.

删除虚拟磁盘

 

vmkfstools -U 1.vmdk

 

 

 

 

阅读(4779) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~