Configuring Virtual MachinesLast Updated December 16, 2024
You configure a virtual machine in the
process of creation.
You can later view and edit virtual machine
settings by adding or changing the type of the storage controllers, configure the virtual
disks, boot options, CPU and memory information, or networks. Virtual machine settings can
be configured when cloning, registering and relocating an existing virtual machine.
Name and Location
You specify the display name and the location
of the virtual machine by using the
VMCreateSpec
and VMPlacementSpec
data structures.When you create your virtual machine, use the
name
property of the
VMCreateSpec
data
structure to set the display name of the virtual machine. You must create also a
VMPlacementSpec
instance that
describes the location of the virtual machine in regards to the resources of a given
vCenter Server
instance. Use the placement
property of the VMCreateSpec
data structure to set
the placement information for the virtual machine. You can set one or all of the following
vSphere resources: datastore, cluster, folder, host, and resource pool. Hardware Version
The hardware version of a virtual machine
reflects the virtual hardware features supported by a virtual machine. These features depend
on the physical hardware available on the
ESXi
host
on which the virtual machine is running.Virtual hardware features include the BIOS and
Extensible Firmware Interface (EFI), the maximum number of CPUs, the maximum memory
configuration, and other hardware characteristics.
When you create a virtual machine, the default
hardware version of the virtual machine is the most recent version available on the host
where the virtual machine is created. For information about the latest VMware products and
virtual hardware versions, see Virtual
machine hardware versions (1003746).
To set a hardware version different than the
default, use the
hardware_version
enumerated type of the
VMCreateSpec
data structure. For information about the hardware
features available for the virtual hardware versions, see Hardware features available with virtual
machine compatibility settings (2051652). You can set a lower virtual hardware version of
a virtual machine than the highest supported by the
ESXi
host on which the virtual machine is running. Setting a lower hardware
version can provide flexibility and is useful in the following cases. - To help you standardize testing and deployment in your environment.
- In case you do not need the hardware features of the latest hardware version of the host.
- To maintain compatibility with hosts with a lower hardware version.
Boot Options
You can configure the boot options of a virtual
machine by using the
VmHardwareBootCreateSpec
data structure.By specifying the properties of the
VmHardwareBootCreateSpec
data structure, you can select one of the
following settings when booting the virtual machine.- Delay - Indicates a delay in milliseconds before starting the firmware boot process when the virtual machine is powered on.
- Retry - Indicates whether the virtual machine automatically retries to boot after a failure.
- Retry delay - Indicates a delay in milliseconds before retrying the boot process after a failure.
- Enter setup mode - If set totrue, indicates that the firmware boot process automatically enters BIOS setup mode the next time the virtual machine boots. The virtual machine resets this flag tofalseonce it enters setup mode.
- EFI legacy boot - If set totrue, indicates that the EFI legacy boot mode is used.
Guest Operating System
The guest operating system that you specify
affects the supported devices and available number of virtual CPUs.
When you create a virtual machine, you specify the
guest operating system by using the
VmGuestOS
enumerated type of the VMCreateSpec
data
structure. The VmGuestOS
enumerated type defines the valid guest OS types that you can choose from for configuring a
virtual machine. After the create operation finishes
successfully, you can install the guest operating system on the mew virtual machine in the
same way as you install it on a physical machine. For further information on installing a
guest operating system, refer to the
Guest Operating System Installation Guide
at http://partnerweb.vmware.com/GOSIG/home.html and the vSphere Virtual Machine
Administration
guide. Starting with vSphere 7.0, you can use the
vSphere
Automation
APIs to install the VMware Tool
on the quest operating system and perform some guest OS customizations. See Installing VMware Tools.CPU and Memory
The
VMCreateSpec
data
structure allows you to specify the CPU and memory configuration of a virtual machine.To change the CPU and memory configuration
settings, use the
VmHardwareCpuUpdateSpec
and VmHardwareMemoryUpdateSpec
data
structures. You can set the number of CPU cores in the virtual
machine by using the
count
property of the VmHardwareCpuUpdateSpec
data structure. The supported
range of CPU cores depends on the guest operating system and virtual hardware version of the
virtual machine. If you set the hot_add_enabled
and hot_remove_enabled
properties to true
, you allow virtual processors
to be added or removed from the virtual machine at runtime. You can set the memory size of a virtual machine by
using the
size_MiB
property
of the VmHardwareMemoryUpdateSpec
data structure. The supported range of
memory sizes depends on the configured guest operating system and virtual hardware version
of the virtual machine. If you set the hot_add_enabled
property to
true
while the virtual
machine is not powered on, you enable adding memory while the virtual machine is running.
Networks
You configure network settings so that a
virtual machine can communicate with the host and with other virtual machines. When you
configure a virtual machine, you can add network adapters (NICs) and specify the adapter
type.
You can add virtual Ethernet adapters to a virtual
machine by using the
VmHardwareEthernetCreateSpec
data structure. The VmHardwareEthernetEmulationType
enumerated type defines the valid emulation types for a virtual Ethernet adapter. The
VmHardwareEthernetMacAddressType
enumerated type defines the valid MAC
address origins for a virtual Ethernet adapter. You can set the MAC address type to MANUAL
, GENERATED
, or ASSIGNED
. To specify the MAC
address explicitly, select MANUAL
. You can specify also the physical resources that
back a virtual Ethernet adapter by using the
VmHardwareEthernetBackingSpec
data
structure. The VmHardwareEthernetBackingType
enumerated type defines the
valid backing types for a virtual Ethernet adapter. You can set the backing type to STANDARD_PORTGROUP
, HOST_DEVICE
, DISTRIBUTED_PORTGROUP
, or OPAQUE_NETWORK
.