标签: VM

VMware esx介绍

最近试用了一下VMware的一套虚拟化产品,用的是VMware esx的主机。先来解释一下这些安装文件的作用。

VMware vSphere v5镜像
用于建立esx主机。安装完成后,可以用VMware vCenter Server v5中的clinet来连接管理虚拟机。

VMware vCenter Server v5镜像
用于建立vCenter Server,可以同时管理多台esx主机,并且实现一些特殊功能,如不同esx主机迁移数据等。包含server的安装程序,clinet的安装程序(用于连接server和esx主机)和相关插件等。
必须安装在windows服务器上,最好为2008。

VMware-converter-all-5.0.0-470252.exe
用于转换物理机、镜像、各种虚拟文件等到虚拟机的工具。

VMwareDataRecovery-2.0.0.1861-433157-x86_64.iso
用来备份esx上的虚拟机的工具。

VMware vCenter Site Recovery Manager
用于站点复制迁移恢复。

试用的感觉还是挺不错的,除了有些插件安装会有点问题,其他基本都是相当好的。如果授权不是特别贵的话,还是建议采用虚拟化的方式,能够最大化利用资源,节省电力,方便管理。当然了,做好备份也是最重要的一关。

VMware 厚置备延迟置零 厚置备置零

厚置备延迟置零:以默认的厚格式创建虚拟磁盘。创建过程中为虚拟磁盘分配所需空间。创建时不会擦除物理设备上保留的任何数据,但是以后从虚拟机首次执行写操作时会按需要将其置零。

厚置备置零:创建支持群集功能(如 Fault Tolerance)的厚磁盘。在创建时为虚拟磁盘分配所需的空间。与平面格式相反,在创建过程中会将物理设备上保留的数据置零。创建这种格式的磁盘所需的时间可能会比创建其他类型的磁盘长。

精简置备:使用精简置备格式。最初,精简置备的磁盘只使用该磁盘最初所需要的数据存储空间。如果以后精简磁盘需要更多空间,则它可以增长到为其分配的最大容量

名词出现场景

VMware中,使用vSphere Client创建新的虚拟机时(无上面英文提到情况不会出现下列选项),在配置指定置备策略时有三个选项:
厚置备延迟置零(zeroed thick)
厚置备置零(eager zeroed thick)
精简置备(thin)

四个名词解释(一):

zeroedthick (default) .

Space required for the virtual disk is allocated during creation. Any data remaining on the physical device is not erased during creation, but will be zeroed out at a later time during virtual machine read and write operations.

eagerzeroedthick

Space required for the virtual disk is allocated at creation time. Unlike with the zeroedthick format, the data remaining on the physical device is zeroed out during creation. Disks in this format might take much longer to create than other types of disks.

thick

Space required for the virtual disk is allocated during creation. This type of formatting doesn.t zero out any old data that might be present on this allocated space.

thin

Thin-provisioned virtual disk. Unlike with the thick format, space required for the virtual disk is not allocated during creation, but is supplied, zeroed out, on demand at a later time.

You only need thin when exporting VMDKs from ESX, since many OS / tools have problems accessing files larger 2GB

四个名词解释(二):

zeroedthink

the disk is allocated at creation and all space wiped (not necessarily at creation time)

eagerzeroedthick

the disk is allocated and all space zeroed at creation time

thick

same as zeroedthick without wiping the data

thin

same as thick but split into 2gb chunks

四个名词解释(三):

zeroedthick

when the VM reads sectors itself hasn’t already written to it gets wiped (random) data

eagerzeroedthick

when the VM reads sectors itself hasn’t already written to it gets zeroed (all bytes set to zero) data, in this case the overwriting with zeroes takes place when the vmdk is created

thick

when the VM reads sectors itself hasn’t already written to it gets the data that was stored on the physical disk before (possible security risk – depending on the environment and regulatories)

thin

the same as thick (thin is normally only used for exporting vmdks)

四个名词解释(四):

`zeroedthick`

This is the default option when creating new virtual disks.

A zeroed thick disk has all space allocated at creation time, and this space is wiped clean of any previous contents on the physical media.

`eagerzeroedthick`

An eager zeroed thick disk has all space allocated and zeroed out at creation time. Such disks may take longer time during creation compared to other disk formats.

`thick`

A thick disk has all space allocated at creation time. This space may contain stale data as it exists on the physical media.

`thin`

Space required for thin-provisioned virtual disk is allocated and zeroed on demand as opposed to upon creation.

zeroedthick与eagerzeroedthick比较

In some cases while working in your VMware environment it’s very important to know what type of virtual disk you’re working with. A few of these functions are Fault Tolerance and Microsoft Clustered Services.

You can easily determine the type of disk using vmkfstools -t0, for example:

The following is an example of a zeroedthick disk

# vmkfstools -t0 /vmfs/volumes/datastore1/EagerBeaver/EagerBeaver.vmdk | more
Mapping for file /vmfs/volumes/4aef08e3-671b60d5-927b-00188be583a5/EagerBeaver/EagerBeaver.vmdk (8589934592 bytes in size):
[ 0: 196083712] –> [VMFSZ- LVID:4aef08e2-0e1d23e2-2505-00188be583a5/4aef08e2-046dd3fa-28b3-00188be583a5/1:( 275392790016 –> 275588873728)]
[ 196083712: 12582912] –> [VMFSZ- LVID:4aef08e2-0e1d23e2-2505-00188be583a5/4aef08e2-046dd3fa-28b3-00188be583a5/1:( 275379158528 –> 275391741440)]
[ 208666624: 8381267968] –> [VMFSZ- LVID:4aef08e2-0e1d23e2-2505-00188be583a5/4aef08e2-046dd3fa-28b3-00188be583a5/1:( 275588873728 –> 283970141696)]
Note: Notice in the zerothicked VM’s you have a Z following VMFS. This indicates that the block has been zeroed, but not written.

Now is an example of an eagerzeroedthick disk

# vmkfstools -t0 /vmfs/volumes/datastore1/EagerBeaver/EagerBeaver_1.vmdk | more
Mapping for file /vmfs/volumes/4aef08e3-671b60d5-927b-00188be583a5/EagerBeaver/EagerBeaver_1.vmdk (8589934592 bytes in size):
[ 0: 7516192768] –> [VMFS — LVID:4aef08e2-0e1d23e2-2505-00188be583a5/4aef08e2-046dd3fa-28b3-00188be583a5/1:( 283970141696 –> 291486334464)]
[ 7516192768: 460324864] –> [VMFS — LVID:4aef08e2-0e1d23e2-2505-00188be583a5/4aef08e2-046dd3fa-28b3-00188be583a5/1:( 5015371264 –> 5475696128)]
[ 7976517632: 613416960] –> [VMFS — LVID:4aef08e2-0e1d23e2-2505-00188be583a5/4aef08e2-046dd3fa-28b3-00188be583a5/1:( 291486334464 –> 292099751424)]
You’ll notice that following the VMFS you have –, which indicates that it has the bit been completely zeroed.

Zeroedthick is a quick format and eagerzeroedthick is a full format !

Linux下命令行安装VMware-tools

1)先在VMware里安装好Linux,并保持Linux处于运行状态

2)VMware的菜单里有个Install VMware Tools…的选项,点击它

3)进到VMWare中的Linux里(用root登录),在命令行下挂载光驱:
mount /dev/cdrom /mnt

4)然后cd /mnt

5)/mnt下面有个VMware-tools-xxxxxx.rpm,类似于这种的文件(具体文件名和你VMware版本有关)。执行:
rpm -ivh VMware-tools-xxxxxxxxxxx.rpm
安装这个rpm包,然后就ok了

VM内U盘启动

网上依旧是很多重复的,给我们提供的思路是挺不错的,但是往往就差了一些细节。

1、制作启动U盘,插入电脑。
2、用VM建立一虚拟系统,如XP。右键点击虚拟机,编辑硬件,添加硬盘,选择你的U盘盘符,一般为“physicalDrive1”。
3、启动虚拟机,进入BIOS(一般是按F2键)。找到你的盘符选择,按F10保存(这里我有两块硬盘),一般是选择SCSI0:1什么的。
4、重新启动系统,已经可以从U盘启动了。

原理是把U盘当成硬盘启动。

最重要的一点:如果在第二步还不显示“physicalDrive1”,就要关闭VM整个程序后,插上优盘,再次打开VM就有了,我就搞了半天才发现。