The Alibaba Cloud virtio driver, a high-performance I/O driver used for virtualization devices, is a required component in images released in Alibaba Cloud. When you create a Windows image, make sure that the Alibaba Cloud virtio driver is installed in the operating system. This ensures that the Elastic Compute Service (ECS) instances created from the image can properly recognize virtio virtualization devices and start as expected. This topic describes how to install the Alibaba Cloud virtio driver on a Windows virtual machine (VM) based on which you want to create an image.
Alibaba Cloud virtio driver
The Alibaba Cloud virtio driver is developed based on the Community Edition virtio driver to better adapt to Alibaba Cloud. All Windows public images provided by Alibaba Cloud are pre-installed with the Alibaba Cloud virtio driver. In most cases, other Windows images do not contain the Alibaba Cloud virtio driver. When you create a Windows custom image, we recommend that you install the Alibaba Cloud virtio driver. If you install the Community Edition virtio driver in the image, ECS instances created from the image may be unable to use the driver.
The following table describes the components in the Alibaba Cloud virtio driver.
Driver | Description |
netkvm | Network adapter driver. |
viostor | Storage driver. |
vioser | Serial port driver. |
balloon | The driver optimizes and manages the memory usage of VMs to ensure that VMs can dynamically adjust memory allocation without affecting performance. Note This driver is disabled on Alibaba Cloud. |
pvpanic | The driver provides a mechanism to ensure that VMs can report their status to the host when fatal errors or crashes occur. |
fwcfg | The driver passes the host configurations, such as the metadata, user data, or device parameters, to Windows VMs in a virtualization environment. Note This driver is available only in Windows 10 and later or Windows Server 2016 and later. |
The following table describes the release notes for the Alibaba Cloud virtio driver.
Driver version | Update | Release date | Supported operating system | Installation package |
58110 | New features:
Bug fixes:
| 2024-01 |
| |
58101 | New features:
Bug fixes:
| 2022-09 |
| |
| ||||
| ||||
58017 | Released based on the Community Edition released in January 2021. | 2021-04 |
| |
| ||||
| ||||
|
Procedure
Virtio driver versions may change. In this example, virtio driver version 58101 and Windows Server 2016 64-bit are used.
When you create an image based on a VM, download the installation package of a specific virtio driver version based on the operating system of the VM and decompress the installation package.
Install the virtio driver.
Install the virtio driver by using a GUI-based installation program
ImportantDuring the GUI-based installation of the virtio driver, network interface controller (NIC) drivers are updated. As a result, network connections are interrupted for approximately 10 seconds. To prevent the impacts of the network connection interruptions on your business, assess the risks and make preparations in advance.
Find and double-click the
AliyunVirtio_58101_WIN2016_x64.exe
file in the directory to which you downloaded the virtio driver installation package.Install the virtio driver as prompted.
Click Finish on the page shown in the following figure to restart the system for the configurations to take effect.
NoteIf you receive an error message that is similar to "
The SHA-2 patch must be installed for Windows 7 and Windows Server 2008 R2
", the patch that enables SHA2 code signing support is not installed. If you want to create an image based on the VM and import the image to Alibaba Cloud, we recommend that you install the patch on the VM to ensure that ECS instances created from the imported image start as expected.
Install the virtio driver by using a CLI
Run the following command in Windows PowerShell to switch to the directory to which you downloaded the virtio driver installation package. Example directory:
C:\test
.cd C:\test
Run the following command to install the virtio driver:
./AliyunVirtio_58101_WIN2016_x64.exe /SILENT /FORCE /NORESTART
Note/SILENT
: installs the virtio driver in silent mode./FORCE
: installs the virtio driver in force mode and force-overwrites existing virtio driver settings./NORESTART
: installs the virtio driver without automatically restarting the system.
Check whether the virtio driver is installed.
Run the following command in Windows PowerShell to query the version number of the virtio driver:
(Get-Item C:\Windows\System32\drivers\viostor.sys).VersionInfo.ProductVersion
The following command output is returned, which includes a driver version number and indicates that the virtio driver is installed.
Run the following command to obtain the registry configurations of the
viostor
service:Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\viostor"
NoteIn most cases, the
viostor
service is linked to the virtio driver in virtualization environments. If an entry about theviostor
service exists in the registry, a command output is returned indicating that the virtio driver is installed.The following command output indicates that the virtio driver is installed.
After you perform the preceding steps and verify that the virtio driver is installed, you can import the images that are created based on the VM to Alibaba Cloud.
References
After you install the virtio driver on a Windows operating system, you can obtain the Windows image file and import the image file to Alibaba Cloud.
Specific operations on Windows instances depend on the version of the virtio driver contained in the images. For example, the online disk resizing operation requires a virtio driver version that is later than
58011
, and queries for disk serial numbers require a virtio driver version that is later than58017
. If the current virtio driver version does not meet the requirement of the operation that you want to perform, update the driver before you perform the operation. For more information, see Update the Red Hat virtio driver on a Windows instance.