Saturday, May 26th, 2007

Review Questions of Class - VMware Infrastructure 3: Install and Configure

在为期四天的VMware培训结束之后,最后除了提交一份调查问券之外,还有一份Review Question。根据老师的说法,这个可以看作是VCP考试的例题。回家在网上google了一下,发现这些例题和答案是公开在互联网上的,既然这样就不用担心是内部用的东西了。这里就把我做的解释也一起拿出来供有意报考VCP的同学参考(当然,可能“参考”一下网上流传的VCP真题更快捷一些……)。

1. Understand VMware Products

Which of the following most closely describes the purpose of ACE (the Assured Computing Environment)?

A. ACE helps desktop managers provision secure, standardized PC environments throughout the enterprise.

B. ACE enhances system security for ESX Server by providing firewall protection for both virtual machines and the Service Console.

C. ACE enhances virtual infrastructure manageability by acting as a proxy between Virtual Center and the ESX and VMware Server systems under management.

D. ACE enhances reliability of the virtual infrastructure by providing hardware redundancy for ESX Server.

2. Differentiate Among VMware Products

All VMware virtualization products are based on the same underlying virtualization technology, but there are some differences among these products. Which one of the following statements is true?

A. VMware Server and VMware Workstation both provide tools for remote management of virtual machines.

B. Because it runs on the bare metal, ESX Server supports a narrower range of physical hardware than either Workstation or VMware Server.

C. ESX Server supports more types of guest operating system than Workstation or Vmware Server.

D. Only ESX Server allows virtual machines to be configured with multiple virtual CPUs.

3. Understand Virtual Center Management

Pointing a VI Client directly to an ESX Server host rather than a VirtualCenter Server:

A. is not recommended, even if VirtualCenter was not purchased.

B. works identically, but any tasks issued are superceded by the VirtualCenter Server.

C. is similar except that objects are at the host and not datacenter level, and enterprise tasks such as cloning and migrating VMs are not available.

D. is similar except that objects are at the host and not datacenter level, but typical tasks such as template creation and cloning VMs are available.

4. Understand Networking

When defining a NIC team (bond) in ESX Server, it is possible to designate some of the physical NICs that make up the bond as "standby" NICs. Which statement most accurately describes the purpose of a standby NIC? A standby NIC:

A. is used only when network traffic exceeds the capacity of the rest of the team.

B. is used only in the case of the failure of other NICs in the team.

C. is not used as part of the team until activated by the administrator.

D. is used to implement traffic shaping for the rest of the team.

5. Operate and Manage ESX Server

Which of the following is true about cold migration of a VM from one host to another using VMware Infrastructure 3? requires

A. The VM must be powered off.

B. The VM must be either powered off or suspended.

C. The two hosts involved must use the same network labels.

D. Both hosts must have the same bit type (32-bit or 64-bit) CPU.

6. Understand Resources

If a VM that belongs to a resource pool does not have enough physical resources available to meet its reservation:

A. it will power off immediately.

B. VMs outside the resource pool will not be able to power on.

C. it will not be able to power on until sufficient physical resources in use are freed up.

D. if its reservations are expandable, it will attempt to draw upon the resources of its parent resource pool.

7. Administer Virtual Machines Under ESX Server

Hitting ESC when first powering on a VM in ESX Server 3.0

A. enters the boot order of the BIOS.

B. does nothing, as ESC is not a valid option.

C. directs the VM to directly boot from network.

D. enters the general BIOS options and is an alternative to hitting F12.

8. Configure Storage

Upgrading an ESX Server 2.x host’s VMFS-2 volume to VMFS-3, and then referencing the VMFS-3 volume from an ESX Server 3.0 host:

A. will allow any VMs on the original VMFS-2 to be powered on.

B. will allow the ESX Server 3.0 host to view the VMs in read-only mode.

C. will allow both the ESX Server 2.x and ESX Server 3.0 hosts to view the VMs in read-only mode.

D. requires both the ESX Server 2.x and ESX Server 3.0 hosts to be managed by VirtualCenter 2.0 in order to perform the upgrade of the VMFS-2 volume.

9. Configure Licensing

If the connection between the license server and VirtualCenter 2.0 Server is lost:

A. there is no impact because licenses are stored and configured per host when using a license server.

B. VMs will continue to run, but after a grace period ends, they cannot be powered back on until connectivity with the license server is restored.

C. ESX Server hosts can be configured and additional hosts added, but no VMs can be powered on until connectivity with the license server is restored.

D. all VMs will power off if connectivity is not restored within a 48 hour grace period. Hence, we recommend installing the license server on the same machine with the VirtualCenter Server.

10. Understand VMotion

64-bit CPUs are supported for VMotion in VirtualCenter 2.0

A. only when migrating 32-bit Guest OSes.

B. when migrating either 32-bit or 64-bit Guest OSes, so long as the Nx flag is hidden.

C. when migrating either 32-bit or 64-bit Guest OSes, regardless of CPU compatibility

D. when migrating either 32-bit or 64-bit Guest OSes, so long as the VMware CPU Compatibility Tool detects two compatible CPUs.

11. Troubleshoot an ESX Server

Suppose you attempt to use Web Access to reach an individual ESX host but receive a "host not found" error. Which of the following is LEAST likely to be the cause of the problem?

A. The Apache Tomcat server is not currently running on the host.

B. The server is not currently powered on.

C. The Service Console’s IP address has recently been changed.

D. Your VI Client has not been configured to allow you to use the Web Access facility.

 

Answers

1. A    2. B    3. C    4. B    5. B    6. D    7. A    8. A    9. B    10. D    11. D      

Explanation

  1. VMware ACE (Assured Computing Environment)正如答案A所说,是用来提供安全、基于策略进行管理的虚拟PC环境的平台。VMware ACE可以作为一个独立平台使用,也可以和VMware Workstation 6结合使用,但是不可以和Virtual Infrastructure一起使用。
  2. VMware Workstation没有提供远程管理工具;ESX Server比其他产品所支持的Guest OS更少,原因已经在正确答案B里面说明了。最后的D,除了ESX之外其它产品也支持多CPU,只是支持的CPU数量可能不同。
  3. A的话前半句是对的,因为连接到VC可以提供更多的功能;但是如果没有购买VC的话就只能连接ESX了。
    C和D的描述基本一致,唯一的差别就是Clone之类的操作是否可以进行。没有VC的话是不能克隆的。
  4. 多块物理网卡 (NIC)可以绑定在一起 (NIC Teaming),从而实现负载平衡 (Load Balancing) 或者Fail over。Standby NIC的作用就是当前NIC发生故障时自动启用,以实现Fail over的。
  5. Cold Migration顾名思义,就是在VM在停止状态时的移动。无论是Power Off还是Suspend,VM都会完全停止,不使用任何CPU和内存,因此可以Code Migration。如果VM正在使用着CPU和内存,就只能VMotion了。
  6. A是错的,即便无论如何也满足不了A的Reservation,VC也只是会发出警告,而不会Power Off掉VM(除非定义了某些自动操作,比如资源不足时自动关闭VM等)。B更是无关了,因为是在Resource Pool的外面。
    C也不对,因为即便物理资源不够,VM还是能够启动,这时VC会把Resource Pool中其它VM所使用的资源强行剥夺过来,分配给这个VM以满足其Reservation。如果其它VM处也没有那么多资源,这时就无法启动了。
  7. 无需说明了,在VM的BIOS画面敲ESC键可选择启动顺序。
  8. 这个问题有一点Tricky。VMFS-2升级到VMFS-3之后,就是VMFS-3了,和其它的VMFS-3分区没有任何区别。ESX 2.x无法访问(只读都不行)VMFS-3。此外,升级VMFS-2并不需要把ESX 2加入到VC中。
  9. 这个问题几乎天天被问,估计不用说明就都知道了。就算连接不到License Server了,还有14天的Grace Period。这14天结束之后,虽然正在运行的VM不会被强行关掉,但是却无法再启动任何VM了,除非再连接回License Server。
  10. 看到D就不用看其它答案了,VMware CPU Compatibility Tool就是为了检测两台主机的CPU是否满足VMotion的要求的。
  11. 访问ESX Server的Web Access不需要VI Client,因为Web Access是架设在ESX Server上的Tomcat Web Server,只需要浏览器就可以了。

Difference between em and percent font-size in Firefox

刚刚发现了百分比(%)在IE和在Firefox中的表现并不相同,现在居然发现即便是在Firefox内部,em和%的表现也并不一样。

首先先要讨论一下,作为font-size等CSS属性的单位,78%和0.78em到底是否相同?

遗憾的是,我并不是CSS专家,所以我没法回答按照标准这两个单位是否完全相同。但是,根据某些权威网站的说明

Both em and % are relative measures. The difference is what each is relative to. Em is always relative to font size. % is relative to the containing block, usually the body, a div, or a table, unless applied to font-size, in which case it applies to the parent font-size.

也就是说,在用于font-size的时候,两者的涵义应该是相同的。但是,当我用下面在Firefox (ver 2.0.0.3, 默认字体微软雅黑16px)上显示如下HTML片段时,却出现了令我不解的结果:

<body style="font-size:100%">
  <span style="font-size:0.97em">这个测试用来比较不同字体单位下的表示情况。[0.97em]</span><br/>
  <span style="font-size:97%">这个测试用来比较不同字体单位下的表示情况。[97%]</span><br/>
</body>

Firefox
Firefox下的结果

Internet Explorer
IE下的结果

看了这些结果,我真的不明白了:到底font-size单位中的百分比和em是否相同?

此外,有一点让我安心的就是,如果使用em作为单位的话,就没有上一篇文章中提到的,IE和Firefox中大小不一致的现象了。

Difference between IE and Firefox when using percent as font-size unit

font-size IE6/IE7 Firefox
100% 16px 16px
99%
98%
97% 15px
96% 15px
95%
94%
93%
92%
91%
90% 14px 14px
89%
88%
87%
86%
85%
84% 13px 13px
83%
82%
81%
80%
79%
78% 12px 12px
77%
76%
75%
74%
73%
72% 11px
71% 11px
70%
69%
68%
67%
66%

今天在测试IE7和firefox下blog的字体显示时,发现在某些特定的font-size下,IE和firefox所显示的字体大小并不相同。

这里要提前说明的是,我所遇到的问题是在如下环境下发生的:

  • 所测试的字体为宋体 (Simsun)以及目前最时髦的微软雅黑 (Yahei)。测试结果表明,这个问题无论是在宋体还是在微软雅黑都会发生
  • IE版本为IE6或IE7,firefox为2.0.0.3
  • CSS当然是使用em体系,也即百分比单位、或者em单位的font-size (这年头应该很少有人用px来定义文档字体了吧?)
  • Firefox的默认字体大小设置为16px,IE无法设定默认字体(中等大小时)大小(如果哪位知道如何更改默认字体大小,还请告诉我),据有关文档称也是16px。

为了找出问题的根本原因,我写了一段php代码用来输出font-size等于100% (也即1em) 到 50% (0.5em)之间的每隔1% (0.01em)的文字显示结果。该程序的运行结果如下图所示。

Font size test for em/% unit

上图是在Firefox下的测试结果。然后,根据IE和Firefox下的结果,得出了右面的这张表格。

通过这张表格即可看出,虽然在大多数的的情况下IE和Firefox的结果是相同的,但是当设置font-size=97%的时候,IE会显示16px的字体,而Firefox则显示15px的字体。同样font-size=72%时,IE显示12px字体,Firefox则显示11px字体。

实际用计算器计算一下就知道,当font-size为97%时,16px X 97% = 15.52px。也就是说,在IE中15.52px被解释为16px字体,而在Firefox当中15.52px被解释为15px字体 (不知道是不是Firefox的计算方法有问题?或者是W3C规定这样做的?还是我计算错误?)。

补充一条最新发现:刚才试着用CSSViewer这个插件检查了一下font-size=97%时的像素值,发现结果并不是我想象的15.52px,而是15.4667px——不知道Firefox中究竟是按照什么标准计算百分比单位的font-size的呢?

IE和Firefox究竟谁对谁错,实在是难以说清,不过有一点是肯定的——就是在设计CSS的时候,要特别注意这些IE和Firefox之间不同的地方。

Tips from Classroom : VMware Infrastructure 3 Install and Configure

花了四天时间,终于上完了全部的课——这个又贵又长($2995,四整天)的培训,也给我这个玩了近半年VMware VI3的人带来了一些新的收获。

本次培训课程的全称是VMware Infrastructure 3: Install and Configure,是一套覆盖了从初级到中级的、全面介绍VI3的功能和具体用法的课程。对于有一定VI3基础的人来说,可能这个课程的前半部分过于简单,因此我也考虑过是否要参加VMware最新的课程:VMware Infrastructure 3: Deploy, Secure & Analyzer。后者主要涵盖中级到高级内容,包括scripting(我最想学的部分),security(也是极其重要的部分,应该包括了firewall的设置等很重要的内容),以及更深入的DRS和HA,最后还有问题分析的工具和方法(和我现在的业务关系紧密)。——但是,遗憾的是该课程目前在我们这里还没有,于是我只好选择了前者。

上课的形式是50%讲座,50%实习 (Hands-on)的形式,使用的机器全都在美国。我们通过教室里PC机上安装的Citrix终端远程访问位于美国VMware总部的工作站,再从那里远程访问ESX Server和VirtualCenter Server(感觉就是特别绕,经常用着用着就不知道自己在哪里了)。参加这个课程除了可以得到一套全英文的教材,还赠送一套VI3的CD-ROM(但是License要到VMware公司去下载试用版),另赠送一VMware帆布包。

闲话不多说,下面就是一些课堂上注意到的一些Tips。

Tip 1 VMware ESX Server 可以安装在单CPU系统上

VMware的很多技术文档中都明确说明,ESX必须安装在双CPU或更多CPU的系统上。的确,这是官方的说法,但是事实上在单CPU服务器上安装ESX也并不会导致出错、无法安装。不过,在了解了VMkernel的CPU调度的原理之后,可以很明显地看出单CPU、特别是单Core、不支持Hyperthreading的CPU将会大幅度拖慢系统性能,尤其是在VM的CPU使用率较高的时候。可想而知在这样的环境下VMware DRS/VMware HA是难以运行,或者行为异常。

因此作为测试来说,实在没有Dual CPU的机器单CPU的也凑合着用吧,不过最好有Hyperthreading功能。至于production环境,务必使用双CPU或更多CPU的服务器。

Tip 2 VMotion的充分必要条件

要使用VMotion功能(以及依靠VMotion的其它功能例如DRS),有无数条件需要满足,例如首先要有一个用于VMotion的VMkernel,此外被移动的VM必须是存储在SAN之类的共有设备上等等。关于两台ESX的CPU,VMware说需要compatible CPU,也就是说进行VMotion的两台ESX Server的CPU要兼容。什么是“兼容”呢?当然,如果你去看Basic Administration Guide可以获得既详细却又冗长的答案,这里就把VMotion对CPU的要求做一总结:

CPU Characteristics 是否需要完全相同? 为什么?
CPU的个数,Core数,是否支持Hyperthreading,CPU的主频,缓存大小 No VMkernel已经通过虚拟技术使得VM不依赖于这些物理特性
 制造商 (Intel还是AMD),Family (P4,Xeon还是Opteron) Yes 不同制造商、不同Family的CPU的指令集有细微的差别 
是否有SSE3指令 Yes Guest OS上的程序有可能使用这些指令 
硬件协助 (Virtualization Hardware Assist) 32-bit VM: No VMkernel已经通过虚拟技术使得VM不依赖于这些物理特性
64-bit VM on Intel: Yes

目前在VMware中对Intel 64-bit的虚拟化是要依靠Intel的VT技术的

Execution Disable Yes (但是可以更改)

Guest OS检测到NX/XD bit时就可能会利用这一特性(如Windows XP的数据执行保护)

 当然,与其要记住这么多,不如直接下载VMware提供的CPU Compatibility Tools,这个工具是专门为VMotion设计的,用来检查两台ESX Server的CPU兼容性。

Tip 3 Service Console是一个特殊的VM

很多人有一种误解,就是ESX Server启动之后看到的这个很像Linux界面——Service Console,就是ESX的OS本身。因此,很多人认为ESX Server是基于Linux的,或者说是安装在一个经过修改的Linux的上面的。

这种说法其实也不能说是完全错误,但是说ESX是构建在Linux之上的却是错误的——因为正相反,这个“Linux”也是运行在ESX之上的一个特殊的VM。

Service Console只被分配给一个CPU,无论物理服务器拥有多少个。这个CPU固定是CPU0,也即系统中的第一个逻辑CPU。和其他VM不同的是,Service Console可以直接和ESX的核心VMkenel打交道,进行系统管理操作。

此外,还有一些关于SAN的Multipathing,以及资源管理的话题,以后找时间专门说吧。