1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
5 This file is autogenerated from drvesx.html.in
6 Do not edit this file. Changes will be lost.
9 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
10 <link rel="stylesheet" type="text/css" href="main.css" />
11 <link rel="SHORTCUT ICON" href="32favicon.png" />
12 <title>libvirt: VMware ESX hypervisor driver</title>
13 <meta name="description" content="libvirt, virtualization, virtualization API" />
17 <div id="headerLogo"></div>
18 <div id="headerSearch">
19 <form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
20 <input id="query" name="query" type="text" size="12" value="" />
21 <input id="submit" name="submit" type="submit" value="Search" />
29 <a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
33 <a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
37 <a title="Applications known to use libvirt" class="inactive" href="apps.html">Applications</a>
41 <a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
45 <a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
48 <a title="How to compile libvirt" class="inactive" href="compiling.html">Compiling</a>
52 <a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
56 <a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
60 <a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
64 <a title="Hypervisor specific driver information" class="active" href="drivers.html">Drivers</a>
67 <a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
71 <a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
75 <a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
79 <a title="Pseudo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
83 <a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
87 <a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
91 <a title="Driver for the User Mode Linux technology" class="inactive" href="drvuml.html">UML</a>
95 <a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
99 <a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
103 <span class="active">VMware ESX</span>
107 <a title="Driver for VMware Workstation / Player" class="inactive" href="drvvmware.html">VMware Workstation / Player</a>
111 <a title="Driver for Microsoft Hyper-V" class="inactive" href="drvhyperv.html">Microsoft Hyper-V</a>
115 <a title="Driver for IBM PowerVM" class="inactive" href="drvphyp.html">IBM PowerVM</a>
119 <a title="Driver for Parallels Cloud Server" class="inactive" href="drvparallels.html">Parallels</a>
123 <a title="Driver for bhyve" class="inactive" href="drvbhyve.html">Bhyve</a>
129 <a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
133 <a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
137 <a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
141 <a title="A guide and reference for developing with libvirt" class="inactive" href="devguide.html">Development Guide</a>
145 <a title="Command reference for virsh" class="inactive" href="virshcmdref.html">Virsh Commands</a>
149 <a title="Project governance and code of conduct" class="inactive" href="governance.html">Governance</a>
155 <a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
159 <a title="Frequently asked questions" class="inactive" href="http://wiki.libvirt.org/page/FAQ">FAQ</a>
163 <a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
167 <a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
171 <a title="Available test suites for libvirt" class="inactive" href="testsuites.html">Test suites</a>
175 <a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
179 <a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
184 <h1>VMware ESX hypervisor driver</h1>
186 <a href="#project">Project Links</a>
188 <a href="#prereq">Deployment pre-requisites</a>
190 <a href="#uri">Connections to the VMware ESX driver</a>
192 <a href="#uriformat">URI Format</a>
194 <a href="#extraparams">Extra parameters</a>
197 <a href="#auth">Authentication</a>
199 <a href="#certificates">Certificates for HTTPS</a>
201 <a href="#connproblems">Connection problems</a>
204 <a href="#questions">Questions blocking tasks</a>
206 <a href="#xmlspecial">Specialties in the domain XML config</a>
208 <a href="#restrictions">Restrictions</a>
210 <a href="#datastore">Datastore references</a>
212 <a href="#macaddresses">MAC addresses</a>
214 <a href="#hardware">Available hardware</a>
217 <a href="#importexport">Import and export of domain XML configs</a>
219 <a href="#xmlimport">Converting from VMware VMX config to domain XML config</a>
221 <a href="#xmlexport">Converting from domain XML config to VMware VMX config</a>
224 <a href="#xmlconfig">Example domain XML configs</a>
226 <a href="#migration">Migration</a>
228 <a href="#scheduler">Scheduler configuration</a>
230 <a href="#tools">VMware tools</a>
232 <a href="#links">Links</a>
235 The libvirt VMware ESX driver can manage VMware ESX/ESXi 3.5/4.x/5.x and
236 VMware GSX 2.0, also called VMware Server 2.0, and possibly later
237 versions. <span class="since">Since 0.8.3</span> the driver can also
238 connect to a VMware vCenter 2.5/4.x/5.x (VPX).
241 <a name="project" shape="rect" id="project">Project Links</a>
242 <a class="headerlink" href="#project" title="Permalink to this headline">¶</a>
245 The <a href="http://www.vmware.com/" shape="rect">VMware ESX and GSX</a>
249 <a name="prereq" shape="rect" id="prereq">Deployment pre-requisites</a>
250 <a class="headerlink" href="#prereq" title="Permalink to this headline">¶</a>
253 None. Any out-of-the-box installation of VPX/ESX(i)/GSX should work. No
254 preparations are required on the server side, no libvirtd must be
255 installed on the ESX server. The driver uses version 2.5 of the remote,
257 <a href="http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/" shape="rect">
258 VMware Virtual Infrastructure API</a> (VI API) to communicate with the
259 ESX server, like the VMware Virtual Infrastructure Client (VI client)
260 does. Since version 4.0 this API is called
261 <a href="http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/" shape="rect">
262 VMware vSphere API</a>.
265 <a name="uri" shape="rect" id="uri">Connections to the VMware ESX driver</a>
266 <a class="headerlink" href="#uri" title="Permalink to this headline">¶</a>
269 Some example remote connection URIs for the driver are:
271 <pre xml:space="preserve">
272 vpx://example-vcenter.com/dc1/srv1 (VPX over HTTPS, select ESX server 'srv1' in datacenter 'dc1')
273 esx://example-esx.com (ESX over HTTPS)
274 gsx://example-gsx.com (GSX over HTTPS)
275 esx://example-esx.com/?transport=http (ESX over HTTP)
276 esx://example-esx.com/?no_verify=1 (ESX over HTTPS, but doesn't verify the server's SSL certificate)
279 <strong>Note</strong>: In contrast to other drivers, the ESX driver is
280 a client-side-only driver. It connects to the ESX server using HTTP(S).
281 Therefore, the <a href="remote.html" shape="rect">remote transport mechanism</a>
282 provided by the remote driver and libvirtd will not work, and you
283 cannot use URIs like <code>esx+ssh://example.com</code>.
286 <a name="uriformat" shape="rect" id="uriformat">URI Format</a>
287 <a class="headerlink" href="#uriformat" title="Permalink to this headline">¶</a>
290 URIs have this general form (<code>[...]</code> marks an optional part).
292 <pre xml:space="preserve">
293 type://[username@]hostname[:port]/[[folder/...]datacenter/[folder/...][cluster/]server][?extraparameters]
296 The <code>type://</code> is either <code>esx://</code> or
297 <code>gsx://</code> or <code>vpx://</code> <span class="since">since 0.8.3</span>.
298 The driver selects the default port depending on the <code>type://</code>.
299 For <code>esx://</code> and <code>vpx://</code> the default HTTPS port
300 is 443, for <code>gsx://</code> it is 8333.
301 If the port parameter is given, it overrides the default port.
304 A <code>vpx://</code> connection is currently restricted to a single
305 ESX server. This might be relaxed in the future. The path part of the
306 URI is used to specify the datacenter and the ESX server in it. If the
307 ESX server is part of a cluster then the cluster has to be specified too.
310 An example: ESX server <code>example-esx.com</code> is managed by
311 vCenter <code>example-vcenter.com</code> and part of cluster
312 <code>cluster1</code>. This cluster is part of datacenter <code>dc1</code>.
314 <pre xml:space="preserve">
315 vpx://example-vcenter.com/dc1/cluster1/example-esx.com
318 Datacenters and clusters can be organized in folders, those have to be
319 specified as well. The driver can handle folders
320 <span class="since">since 0.9.7</span>.
322 <pre xml:space="preserve">
323 vpx://example-vcenter.com/folder1/dc1/folder2/example-esx.com
326 <a name="extraparams" shape="rect" id="extraparams">Extra parameters</a>
327 <a class="headerlink" href="#extraparams" title="Permalink to this headline">¶</a>
330 Extra parameters can be added to a URI as part of the query string
331 (the part following <code>?</code>). A single parameter is formed by a
332 <code>name=value</code> pair. Multiple parameters are separated by
335 <pre xml:space="preserve">
336 ?<span style="color: #E50000">no_verify=1</span>&<span style="color: #00B200">auto_answer=1</span>&<span style="color: #0000E5">proxy=socks://example-proxy.com:23456</span>
339 The driver understands the extra parameters shown below.
341 <table class="top_table"><tr><th rowspan="1" colspan="1">Name</th><th rowspan="1" colspan="1">Values</th><th rowspan="1" colspan="1">Meaning</th></tr><tr><td rowspan="1" colspan="1">
342 <code>transport</code>
343 </td><td rowspan="1" colspan="1">
344 <code>http</code> or <code>https</code>
345 </td><td rowspan="1" colspan="1">
346 Overrides the default HTTPS transport. For <code>esx://</code>
347 and <code>vpx://</code> the default HTTP port is 80, for
348 <code>gsx://</code> it is 8222.
349 </td></tr><tr><td rowspan="1" colspan="1">
351 </td><td rowspan="1" colspan="1">
352 Hostname of a VMware vCenter or <code>*</code>
353 </td><td rowspan="1" colspan="1">
354 In order to perform a migration the driver needs to know the
355 VMware vCenter for the ESX server. If set to <code>*</code>,
356 the driver connects to the vCenter known to the ESX server.
357 This parameter in useful when connecting to an ESX server only.
358 </td></tr><tr><td rowspan="1" colspan="1">
359 <code>no_verify</code>
360 </td><td rowspan="1" colspan="1">
361 <code>0</code> or <code>1</code>
362 </td><td rowspan="1" colspan="1">
363 If set to 1, this disables libcurl client checks of the server's
364 SSL certificate. The default value it 0. See the
365 <a href="#certificates" shape="rect">Certificates for HTTPS</a> section for
367 </td></tr><tr><td rowspan="1" colspan="1">
368 <code>auto_answer</code>
369 </td><td rowspan="1" colspan="1">
370 <code>0</code> or <code>1</code>
371 </td><td rowspan="1" colspan="1">
372 If set to 1, the driver answers all
373 <a href="#questions" shape="rect">questions</a> with the default answer.
374 If set to 0, questions are reported as errors. The default
375 value it 0. <span class="since">Since 0.7.5</span>.
376 </td></tr><tr><td rowspan="1" colspan="1">
378 </td><td rowspan="1" colspan="1">
379 <code>[type://]hostname[:port]</code>
380 </td><td rowspan="1" colspan="1">
381 Allows to specify a proxy for HTTP and HTTPS communication.
382 <span class="since">Since 0.8.2</span>.
383 The optional <code>type</code> part may be one of:
384 <code>http</code>, <code>socks</code>, <code>socks4</code>,
385 <code>socks4a</code> or <code>socks5</code>. The default is
386 <code>http</code> and <code>socks</code> is synonymous for
387 <code>socks5</code>. The optional <code>port</code> allows to
388 override the default port 1080.
391 <a name="auth" shape="rect" id="auth">Authentication</a>
392 <a class="headerlink" href="#auth" title="Permalink to this headline">¶</a>
395 In order to perform any useful operation the driver needs to log into
396 the ESX server. Therefore, only <code>virConnectOpenAuth</code> can be
397 used to connect to an ESX server, <code>virConnectOpen</code> and
398 <code>virConnectOpenReadOnly</code> don't work.
399 To log into an ESX server or vCenter the driver will request
400 credentials using the callback passed to the
401 <code>virConnectOpenAuth</code> function. The driver passes the
402 hostname as challenge parameter to the callback. This enables the
403 callback to distinguish between requests for ESX server and vCenter.
406 <strong>Note</strong>: During the ongoing driver development, testing
407 is done using an unrestricted <code>root</code> account. Problems may
408 occur if you use a restricted account. Detailed testing with restricted
409 accounts has not been done yet.
412 <a name="certificates" shape="rect" id="certificates">Certificates for HTTPS</a>
413 <a class="headerlink" href="#certificates" title="Permalink to this headline">¶</a>
416 By default the ESX driver uses HTTPS to communicate with an ESX server.
417 Proper HTTPS communication requires correctly configured SSL
418 certificates. This certificates are different from the ones libvirt
419 uses for <a href="remote.html" shape="rect">secure communication over TLS</a> to a
420 libvirtd one a remote server.
423 By default the driver tries to verify the server's SSL certificate
424 using the CA certificate pool installed on your client computer. With
425 an out-of-the-box installed ESX server this won't work, because a newly
426 installed ESX server uses auto-generated self-signed certificates.
427 Those are singed by a CA certificate that is typically not known to your
428 client computer and libvirt will report an error like this one:
430 <pre xml:space="preserve">
431 error: internal error curl_easy_perform() returned an error: Peer certificate cannot be authenticated with known CA certificates (60)
434 Where are two ways to solve this problem:
437 Use the <code>no_verify=1</code> <a href="#extraparams" shape="rect">extra parameter</a>
438 to disable server certificate verification.
440 Generate new SSL certificates signed by a CA known to your client
441 computer and replace the original ones on your ESX server. See the
442 section <i>Replace a Default Certificate with a CA-Signed Certificate</i>
443 in the <a href="http://www.vmware.com/pdf/vsphere4/r40/vsp_40_esx_server_config.pdf" shape="rect">ESX Configuration Guide</a>
446 <a name="connproblems" shape="rect" id="connproblems">Connection problems</a>
447 <a class="headerlink" href="#connproblems" title="Permalink to this headline">¶</a>
450 There are also other causes for connection problems than the
451 <a href="#certificates" shape="rect">HTTPS certificate</a> related ones.
454 As stated before the ESX driver doesn't need the
455 <a href="remote.html" shape="rect">remote transport mechanism</a>
456 provided by the remote driver and libvirtd, nor does the ESX driver
457 support it. Therefore, using an URI including a transport in the
458 scheme won't work. Only <a href="#uriformat" shape="rect">URIs as described</a>
459 are supported by the ESX driver. Here's a collection of possible
461 <pre xml:space="preserve">
462 $ virsh -c esx+tcp://example.com/
463 error: unable to connect to libvirtd at 'example.com': Connection refused
465 <pre xml:space="preserve">
466 $ virsh -c esx+tls://example.com/
467 error: Cannot access CA certificate '/etc/pki/CA/cacert.pem': No such file or directory
469 <pre xml:space="preserve">
470 $ virsh -c esx+ssh://example.com/
471 error: cannot recv data: ssh: connect to host example.com port 22: Connection refused
473 <pre xml:space="preserve">
474 $ virsh -c esx+ssh://example.com/
475 error: cannot recv data: Resource temporarily unavailable
478 <span class="since">Since 0.7.0</span> libvirt contains the ESX
479 driver. Earlier versions of libvirt will report a misleading error
480 about missing certificates when you try to connect to an ESX server.
481 <pre xml:space="preserve">
482 $ virsh -c esx://example.com/
483 error: Cannot access CA certificate '/etc/pki/CA/cacert.pem': No such file or directory
486 Don't let this error message confuse you. Setting up certificates
487 as described on the <a href="remote.html#Remote_certificates" shape="rect">remote transport mechanism</a> page
488 does not help, as this is not a certificate related problem.
491 To fix this problem you need to update your libvirt to 0.7.0 or newer.
492 You may also see this error when you use a libvirt version that
493 contains the ESX driver but you or your distro disabled the ESX
494 driver during compilation. <span class="since">Since 0.8.3</span>
495 the error message has been improved in this case:
497 <pre xml:space="preserve">
498 $ virsh -c esx://example.com/
499 error: invalid argument in libvirt was built without the 'esx' driver
503 <a name="questions" shape="rect" id="questions">Questions blocking tasks</a>
504 <a class="headerlink" href="#questions" title="Permalink to this headline">¶</a>
507 Some methods of the VI API start tasks, for example
508 <code>PowerOnVM_Task()</code>. Such tasks may be blocked by questions
509 if the ESX server detects an issue with the domain that requires user
510 interaction. The ESX driver cannot prompt the user to answer a
511 question, libvirt doesn't have an API for something like this.
514 The VI API provides the <code>AnswerVM()</code> method to
515 programmatically answer a questions. So the driver has two options
516 how to handle such a situation: either answer the questions with the
517 default answer or report the question as an error and cancel the
518 blocked task if possible. The
519 <a href="#uriformat" shape="rect"><code>auto_answer</code></a> query parameter
520 controls the answering behavior.
523 <a name="xmlspecial" shape="rect" id="xmlspecial">Specialties in the domain XML config</a>
524 <a class="headerlink" href="#xmlspecial" title="Permalink to this headline">¶</a>
527 There are several specialties in the domain XML config for ESX domains.
530 <a name="restrictions" shape="rect" id="restrictions">Restrictions</a>
531 <a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a>
534 There are some restrictions for some values of the domain XML config.
535 The driver will complain if this restrictions are violated.
538 Memory size has to be a multiple of 4096
540 Number of virtual CPU has to be 1 or a multiple of 2
542 Valid MAC address prefixes are <code>00:0c:29</code> and
543 <code>00:50:56</code>. <span class="since">Since 0.7.6</span>
544 arbitrary <a href="#macaddresses" shape="rect">MAC addresses</a> are supported.
547 <a name="datastore" shape="rect" id="datastore">Datastore references</a>
548 <a class="headerlink" href="#datastore" title="Permalink to this headline">¶</a>
551 Storage is managed in datastores. VMware uses a special path format to
552 reference files in a datastore. Basically, the datastore name is put
553 into squared braces in front of the path.
555 <pre xml:space="preserve">
556 [datastore] directory/filename
559 To define a new domain the driver converts the domain XML into a
560 VMware VMX file and uploads it to a datastore known to the ESX server.
561 Because multiple datastores may be known to an ESX server the driver
562 needs to decide to which datastore the VMX file should be uploaded.
563 The driver deduces this information from the path of the source of the
564 first file-based harddisk listed in the domain XML.
567 <a name="macaddresses" shape="rect" id="macaddresses">MAC addresses</a>
568 <a class="headerlink" href="#macaddresses" title="Permalink to this headline">¶</a>
571 VMware has registered two MAC address prefixes for domains:
572 <code>00:0c:29</code> and <code>00:50:56</code>. These prefixes are
573 split into ranges for different purposes.
575 <table class="top_table"><tr><th rowspan="1" colspan="1">Range</th><th rowspan="1" colspan="1">Purpose</th></tr><tr><td rowspan="1" colspan="1">
576 <code>00:0c:29:00:00:00</code> - <code>00:0c:29:ff:ff:ff</code>
577 </td><td rowspan="1" colspan="1">
578 An ESX server autogenerates MAC addresses from this range if
579 the VMX file doesn't contain a MAC address when trying to start
581 </td></tr><tr><td rowspan="1" colspan="1">
582 <code>00:50:56:00:00:00</code> - <code>00:50:56:3f:ff:ff</code>
583 </td><td rowspan="1" colspan="1">
584 MAC addresses from this range can by manually assigned by the
585 user in the VI client.
586 </td></tr><tr><td rowspan="1" colspan="1">
587 <code>00:50:56:80:00:00</code> - <code>00:50:56:bf:ff:ff</code>
588 </td><td rowspan="1" colspan="1">
589 A VI client autogenerates MAC addresses from this range for
590 newly defined domains.
593 The VMX files generated by the ESX driver always contain a MAC address,
594 because libvirt generates a random one if an interface element in the
595 domain XML file lacks a MAC address.
596 <span class="since">Since 0.7.6</span> the ESX driver sets the prefix
597 for generated MAC addresses to <code>00:0c:29</code>. Before 0.7.6
598 the <code>00:50:56</code> prefix was used. Sometimes this resulted in
599 the generation of out-of-range MAC address that were rejected by the
603 Also <span class="since">since 0.7.6</span> every MAC address outside
604 this ranges can be used. For such MAC addresses the ESX server-side
605 check is disabled in the VMX file to stop the ESX server from rejecting
606 out-of-predefined-range MAC addresses.
608 <pre xml:space="preserve">
609 ethernet0.checkMACAddress = "false"
612 <a name="hardware" shape="rect" id="hardware">Available hardware</a>
613 <a class="headerlink" href="#hardware" title="Permalink to this headline">¶</a>
616 VMware ESX supports different models of SCSI controllers and network
619 <h4>SCSI controller models</h4>
620 <dl><dt><code>auto</code></dt><dd>
621 This isn't a actual controller model. If specified the ESX driver
622 tries to detect the SCSI controller model referenced in the
623 <code>.vmdk</code> file and use it. Autodetection fails when a
624 SCSI controller has multiple disks attached and the SCSI controller
625 models referenced in the <code>.vmdk</code> files are inconsistent.
626 <span class="since">Since 0.8.3</span>
627 </dd><dt><code>buslogic</code></dt><dd>
628 BusLogic SCSI controller for older guests.
629 </dd><dt><code>lsilogic</code></dt><dd>
630 LSI Logic SCSI controller for recent guests.
631 </dd><dt><code>lsisas1068</code></dt><dd>
632 LSI Logic SAS 1068 controller. <span class="since">Since 0.8.0</span>
633 </dd><dt><code>vmpvscsi</code></dt><dd>
634 Special VMware Paravirtual SCSI controller, requires VMware tools inside
635 the guest. See <a href="http://kb.vmware.com/kb/1010398" shape="rect">VMware KB1010398</a>
636 for details. <span class="since">Since 0.8.3</span>
639 Here a domain XML snippet:
641 <pre xml:space="preserve">
643 <disk type='file' device='disk'>
644 <source file='[local-storage] Fedora11/Fedora11.vmdk'/>
645 <target dev='sda' bus='scsi'/>
646 <address type='drive' controller='0' bus='0' unit='0'/>
648 <controller type='scsi' index='0' model='<strong>lsilogic</strong>'/>
652 The controller element is supported <span class="since">since 0.8.2</span>.
653 Prior to this <code><driver name='lsilogic'/></code> was abused to
654 specify the SCSI controller model. This attribute usage is deprecated now.
656 <pre xml:space="preserve">
658 <disk type='file' device='disk'>
659 <driver name='<strong>lsilogic</strong>'/>
660 <source file='[local-storage] Fedora11/Fedora11.vmdk'/>
661 <target dev='sda' bus='scsi'/>
665 <h4>Network card models</h4>
666 <dl><dt><code>vlance</code></dt><dd>
667 AMD PCnet32 network card for older guests.
668 </dd><dt><code>vmxnet</code>, <code>vmxnet2</code>, <code>vmxnet3</code></dt><dd>
669 Special VMware VMXnet network card, requires VMware tools inside
670 the guest. See <a href="http://kb.vmware.com/kb/1001805" shape="rect">VMware KB1001805</a>
672 </dd><dt><code>e1000</code></dt><dd>
673 Intel E1000 network card for recent guests.
676 Here a domain XML snippet:
678 <pre xml:space="preserve">
680 <interface type='bridge'>
681 <mac address='00:50:56:25:48:c7'/>
682 <source bridge='VM Network'/>
683 <model type='<strong>e1000</strong>'/>
688 <a name="importexport" shape="rect" id="importexport">Import and export of domain XML configs</a>
689 <a class="headerlink" href="#importexport" title="Permalink to this headline">¶</a>
692 The ESX driver currently supports a native config format known as
693 <code>vmware-vmx</code> to handle VMware VMX configs.
696 <a name="xmlimport" shape="rect" id="xmlimport">Converting from VMware VMX config to domain XML config</a>
697 <a class="headerlink" href="#xmlimport" title="Permalink to this headline">¶</a>
700 The <code>virsh domxml-from-native</code> provides a way to convert an
701 existing VMware VMX config into a domain XML config that can then be
704 <pre xml:space="preserve">
705 $ cat > demo.vmx << EOF
708 virtualHW.version = "4"
709 floppy0.present = "false"
710 nvram = "Fedora11.nvram"
711 deploymentPlatform = "windows"
712 virtualHW.productCompatibility = "hosted"
713 tools.upgrade.policy = "useGlobal"
714 powerType.powerOff = "default"
715 powerType.powerOn = "default"
716 powerType.suspend = "default"
717 powerType.reset = "default"
718 displayName = "Fedora11"
719 extendedConfigFile = "Fedora11.vmxf"
720 scsi0.present = "true"
721 scsi0.sharedBus = "none"
722 scsi0.virtualDev = "lsilogic"
724 scsi0:0.present = "true"
725 scsi0:0.fileName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/Fedora11/Fedora11.vmdk"
726 scsi0:0.deviceType = "scsi-hardDisk"
727 ide0:0.present = "true"
728 ide0:0.clientDevice = "true"
729 ide0:0.deviceType = "cdrom-raw"
730 ide0:0.startConnected = "false"
731 ethernet0.present = "true"
732 ethernet0.networkName = "VM Network"
733 ethernet0.addressType = "vpx"
734 ethernet0.generatedAddress = "00:50:56:91:48:c7"
735 chipset.onlineStandby = "false"
736 guestOSAltName = "Red Hat Enterprise Linux 5 (32-Bit)"
738 uuid.bios = "50 11 5e 16 9b dc 49 d7-f1 71 53 c4 d7 f9 17 10"
739 snapshot.action = "keep"
741 sched.cpu.units = "mhz"
742 sched.cpu.shares = "normal"
743 sched.mem.minsize = "0"
744 sched.mem.shares = "normal"
745 toolScripts.afterPowerOn = "true"
746 toolScripts.afterResume = "true"
747 toolScripts.beforeSuspend = "true"
748 toolScripts.beforePowerOff = "true"
750 tools.syncTime = "false"
751 uuid.location = "56 4d b5 06 a2 bd fb eb-ae 86 f7 d8 49 27 d0 c4"
752 sched.cpu.max = "unlimited"
753 sched.swap.derivedName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/Fedora11/Fedora11-7de040d8.vswp"
754 tools.remindInstall = "TRUE"
757 $ virsh -c esx://example.com domxml-from-native vmware-vmx demo.vmx
758 Enter username for example.com [root]:
759 Enter root password for example.com:
760 <domain type='vmware'>
761 <name>Fedora11</name>
762 <uuid>50115e16-9bdc-49d7-f171-53c4d7f91710</uuid>
763 <memory>1048576</memory>
764 <currentMemory>1048576</currentMemory>
765 <vcpu>1</vcpu>
767 <type arch='i686'>hvm</type>
769 <clock offset='utc'/>
770 <on_poweroff>destroy</on_poweroff>
771 <on_reboot>restart</on_reboot>
772 <on_crash>destroy</on_crash>
774 <disk type='file' device='disk'>
775 <source file='[local-storage] Fedora11/Fedora11.vmdk'/>
776 <target dev='sda' bus='scsi'/>
777 <address type='drive' controller='0' bus='0' unit='0'/>
779 <controller type='scsi' index='0' model='lsilogic'/>
780 <interface type='bridge'>
781 <mac address='00:50:56:91:48:c7'/>
782 <source bridge='VM Network'/>
788 <a name="xmlexport" shape="rect" id="xmlexport">Converting from domain XML config to VMware VMX config</a>
789 <a class="headerlink" href="#xmlexport" title="Permalink to this headline">¶</a>
792 The <code>virsh domxml-to-native</code> provides a way to convert a
793 domain XML config into a VMware VMX config.
795 <pre xml:space="preserve">
796 $ cat > demo.xml << EOF
797 <domain type='vmware'>
798 <name>Fedora11</name>
799 <uuid>50115e16-9bdc-49d7-f171-53c4d7f91710</uuid>
800 <memory>1048576</memory>
801 <currentMemory>1048576</currentMemory>
802 <vcpu>1</vcpu>
804 <type arch='x86_64'>hvm</type>
807 <disk type='file' device='disk'>
808 <source file='[local-storage] Fedora11/Fedora11.vmdk'/>
809 <target dev='sda' bus='scsi'/>
810 <address type='drive' controller='0' bus='0' unit='0'/>
812 <controller type='scsi' index='0' model='lsilogic'/>
813 <interface type='bridge'>
814 <mac address='00:50:56:25:48:c7'/>
815 <source bridge='VM Network'/>
821 $ virsh -c esx://example.com domxml-to-native vmware-vmx demo.xml
822 Enter username for example.com [root]:
823 Enter root password for example.com:
825 virtualHW.version = "4"
827 uuid.bios = "50 11 5e 16 9b dc 49 d7-f1 71 53 c4 d7 f9 17 10"
828 displayName = "Fedora11"
831 scsi0.present = "true"
832 scsi0.virtualDev = "lsilogic"
833 scsi0:0.present = "true"
834 scsi0:0.deviceType = "scsi-hardDisk"
835 scsi0:0.fileName = "/vmfs/volumes/local-storage/Fedora11/Fedora11.vmdk"
836 ethernet0.present = "true"
837 ethernet0.networkName = "VM Network"
838 ethernet0.connectionType = "bridged"
839 ethernet0.addressType = "static"
840 ethernet0.address = "00:50:56:25:48:C7"
843 <a name="xmlconfig" shape="rect" id="xmlconfig">Example domain XML configs</a>
844 <a class="headerlink" href="#xmlconfig" title="Permalink to this headline">¶</a>
846 <h3>Fedora11 on x86_64</h3>
847 <pre xml:space="preserve">
848 <domain type='vmware'>
849 <name>Fedora11</name>
850 <uuid>50115e16-9bdc-49d7-f171-53c4d7f91710</uuid>
851 <memory>1048576</memory>
852 <currentMemory>1048576</currentMemory>
853 <vcpu>1</vcpu>
855 <type arch='x86_64'>hvm</type>
858 <disk type='file' device='disk'>
859 <source file='[local-storage] Fedora11/Fedora11.vmdk'/>
860 <target dev='sda' bus='scsi'/>
861 <address type='drive' controller='0' bus='0' unit='0'/>
863 <controller type='scsi' index='0'/>
864 <interface type='bridge'>
865 <mac address='00:50:56:25:48:c7'/>
866 <source bridge='VM Network'/>
872 <a name="migration" shape="rect" id="migration">Migration</a>
873 <a class="headerlink" href="#migration" title="Permalink to this headline">¶</a>
876 A migration cannot be initiated on an ESX server directly, a VMware
877 vCenter is necessary for this. The <code>vcenter</code> query
878 parameter must be set either to the hostname or IP address of the
879 vCenter managing the ESX server or to <code>*</code>. Setting it
880 to <code>*</code> causes the driver to connect to the vCenter known to
881 the ESX server. If the ESX server is not managed by a vCenter an error
884 <pre xml:space="preserve">
885 esx://example.com/?vcenter=example-vcenter.com
888 Here's an example how to migrate the domain <code>Fedora11</code> from
889 ESX server <code>example-src.com</code> to ESX server
890 <code>example-dst.com</code> implicitly involving vCenter
891 <code>example-vcenter.com</code> using <code>virsh</code>.
893 <pre xml:space="preserve">
894 $ virsh -c esx://example-src.com/?vcenter=* migrate Fedora11 esx://example-dst.com/?vcenter=*
895 Enter username for example-src.com [root]:
896 Enter root password for example-src.com:
897 Enter username for example-vcenter.com [administrator]:
898 Enter administrator password for example-vcenter.com:
899 Enter username for example-dst.com [root]:
900 Enter root password for example-dst.com:
901 Enter username for example-vcenter.com [administrator]:
902 Enter administrator password for example-vcenter.com:
905 <span class="since">Since 0.8.3</span> you can directly connect to a vCenter.
906 This simplifies migration a bit. Here's the same migration as above but
907 using <code>vpx://</code> connections and assuming both ESX server are in
908 datacenter <code>dc1</code> and aren't part of a cluster.
910 <pre xml:space="preserve">
911 $ virsh -c vpx://example-vcenter.com/dc1/example-src.com migrate Fedora11 vpx://example-vcenter.com/dc1/example-dst.com
912 Enter username for example-vcenter.com [administrator]:
913 Enter administrator password for example-vcenter.com:
914 Enter username for example-vcenter.com [administrator]:
915 Enter administrator password for example-vcenter.com:
918 <a name="scheduler" shape="rect" id="scheduler">Scheduler configuration</a>
919 <a class="headerlink" href="#scheduler" title="Permalink to this headline">¶</a>
922 The driver exposes the ESX CPU scheduler. The parameters listed below
923 are available to control the scheduler.
925 <dl><dt><code>reservation</code></dt><dd>
926 The amount of CPU resource in MHz that is guaranteed to be
927 available to the domain. Valid values are 0 and greater.
928 </dd><dt><code>limit</code></dt><dd>
929 The CPU utilization of the domain will be
930 limited to this value in MHz, even if more CPU resources are
931 available. If the limit is set to -1, the CPU utilization of the
932 domain is unlimited. If the limit is not set to -1, it must be
933 greater than or equal to the reservation.
934 </dd><dt><code>shares</code></dt><dd>
935 Shares are used to determine relative CPU
936 allocation between domains. In general, a domain with more shares
937 gets proportionally more of the CPU resource. Valid values are 0
938 and greater. The special values -1, -2 and -3 represent the
939 predefined shares level <code>low</code>, <code>normal</code> and
943 <a name="tools" shape="rect" id="tools">VMware tools</a>
944 <a class="headerlink" href="#tools" title="Permalink to this headline">¶</a>
947 Some actions require installed VMware tools. If the VMware tools are
948 not installed in the guest and one of the actions below is to be
949 performed the ESX server raises an error and the driver reports it.
952 <code>virDomainReboot</code>
954 <code>virDomainShutdown</code>
957 <a name="links" shape="rect" id="links">Links</a>
958 <a class="headerlink" href="#links" title="Permalink to this headline">¶</a>
961 <a href="http://www.vmware.com/support/developer/vc-sdk/" shape="rect">
962 VMware vSphere Web Services SDK Documentation
965 <a href="http://www.vmware.com/pdf/esx3_memory.pdf" shape="rect">
966 The Role of Memory in VMware ESX Server 3
969 <a href="http://www.sanbarrow.com/vmx.html" shape="rect">
970 VMware VMX config parameters
973 <a href="http://www.vmware.com/pdf/vsp_4_pvscsi_perf.pdf" shape="rect">
974 VMware ESX 4.0 PVSCSI Storage Performance
981 Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>