If the virtio driver is outdated or has compatibility issues, it can degrade the performance of your Elastic Compute Service (ECS) instance, resulting in reduced disk IOPS and increased network latency. It can also cause functional abnormalities, such as device recognition failures or metadata read failures. To ensure your ECS instance runs stably on the Alibaba Cloud platform, we recommend that you update the virtio driver in a timely manner.
Use cases
Alibaba Cloud periodically updates virtio drivers. Older versions may have known vulnerabilities. Updating the virtio driver can help you avoid potential risks and improve driver performance.
When you upgrade a Windows instance from an earlier version, such as Windows Server 2016, to a later version, such as Windows Server 2022, the existing virtio driver may be incompatible with the new operating system. This incompatibility can cause device recognition failures or other functional issues. Therefore, you must update the virtio driver to ensure compatibility.
Certain operations on Windows instances depend on the virtio driver version. For example, to expand a disk online, the virtio driver version must be later than
58011. Instances created before March 30, 2019 may not meet this requirement. To query the serial number of a disk, the virtio driver version must be later than58017. Instances created before May 1, 2020 may not meet this requirement. If the virtio driver on your instance does not meet the requirements for an operation, you must update the driver.
Limitation
You can update the virtio driver only for Windows Server 2008 and later versions.
Procedure
Make preparations.
Create a snapshot to back up data.
We recommend that you create a snapshot for your Windows instance to back up its data. If an issue occurs when you update the virtio driver, you can use the snapshot to roll back the instance.
Disable third-party antivirus software.
To ensure a smooth update, we recommend that you temporarily disable any third-party antivirus software installed on the instance. You do not need to disable the antivirus software that is included with the operating system. After the update is complete, remember to restart the antivirus software.
Update the virtio driver.
You can manually update the virtio driver using one of the following methods, depending on your business scenario.
Use a script (with Internet access)
If your Windows instance can access the Internet, you can use this method to quickly update the virtio driver.
Connect to the Windows instance.
For more information, see Connect to a Windows instance using a password.
In Windows PowerShell, run the following command to download the script:
Invoke-WebRequest -Uri "https://windows-driver-cn-beijing.oss-cn-beijing.aliyuncs.com/virtio/InstallVirtIo.ps1" -OutFile "C:\Users\Administrator\Downloads\InstallVirtIo.ps1"Execute the script.
powershell -ExecutionPolicy Bypass -File "C:\Users\Administrator\Downloads\InstallVirtIo.ps1"After the script is executed, restart the Windows instance for the driver update to take effect.
For more information, see Restart an instance.
Use an installation package to update (without Internet access)
On your local host, download the virtio driver installation package that corresponds to the instance's operating system.
For download URLs, see Install the virtio driver.
Upload the installation package to the Windows instance.
For more information, see Use Remote Desktop Connection or Windows App to transfer files to a Windows instance.
On the Windows instance, install the new version of the virtio driver.
GUI installation
This section uses the installation of Alibaba Cloud virtio driver 58101 as an example.
ImportantDuring the GUI-based installation of the virtio driver, the network adapter driver is updated. This causes a network interruption of about 10 seconds, which may affect your services. You should perform a risk assessment and make preparations in advance.
In the directory where you uploaded the installation package, find and double-click
AliyunVirtio_58101_WIN2016_x64.exe.Follow the on-screen instructions to complete the installation.

When the following page appears, restart the system for the configuration to take effect.
NoteIf the message
For Windows 7/Windows Server 2008 R2 systems, you must install the SHA-2 patch!appears during the installation on a Windows 7 or Windows Server 2008 R2 system, the SHA-2 signing patch is missing. To prevent startup exceptions after the image is imported, we recommend that you install the signing patch beforehand.
Command-line installation
In Windows PowerShell, run the following command to switch to the directory where you uploaded the package, such as
C:\test.cd C:\testRun the following command to install the virtio driver:
./AliyunVirtio_58101_WIN2016_x64.exe /SILENT /FORCE /NORESTARTNote/SILENT: Specifies silent mode./FORCE: Forces an overwrite installation if a virtio driver is already installed./NORESTART: Prevents the system from restarting automatically.
Use Cloud Assistant to batch update on multiple instances
To update the virtio drivers on multiple ECS instances, and the instances can access the Internet or virtual private clouds (VPCs), you can use Cloud Assistant to perform a batch update.
NoteTo perform a batch update using Cloud Assistant, you must download the required installation package. The system attempts to download the package over the internal network within a VPC. If the package cannot be downloaded over the internal network, the system downloads it over the Internet.
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select a region.
The region you select must be the one where your ECS instances reside.
Use Cloud Assistant to batch update the drivers.
You can use Cloud Assistant to manually specify the command content to update the drivers, or you can use a public Cloud Assistant command to quickly update the drivers. This topic describes both methods.
(Recommended) Use a public command to batch update drivers
On the ECS Cloud Assistant page, click the Common Commands tab. Then, search for and execute
ACS-ECS-InstallVirtioDriver-windows.ps1.In the Run Command panel, in the Select Instance section, select the IDs of the instances for which you want to update the drivers.
Manually specify the command content to perform a batch update
On the ECS Cloud Assistant page, click Create/Run Command.
In the Create Command panel, complete the following configurations.
In the Command Information section, the required parameters are described in the following table. You can retain the default values for the other parameters. For more information about the parameters, see Create and run a command.
Parameter
Description
Command Source
Select Enter Command Content.
Command Type
Select PowerShell.
Command content
You can use one of the following methods to update the virtio driver:
Update the virtio driver using the InstallVirtIo.ps1 script.
You need to download the InstallVirtIo.ps1 script on your local host, and then copy the full content of the script to the command content field in the Cloud Assistant console.
Update the virtio driver using the Cloud Assistant plugin.
Copy the following command to the command content field in the Cloud Assistant console.
acs-plugin-manager.exe --exec --plugin=UpdateVirtIo
Execution Plan
Select Immediate execution.
In the Select Instance section, select the IDs of the instances for which you want to update the drivers, and then click Run.
Restart the Windows instances in a batch for the driver update to take effect.
For more information, see Restart an instance.
Check the installed virtio driver version in Device Manager.
NoteMost new Alibaba Cloud instance types, such as ecs.g8a, use disks that support the NVMe protocol. For these instances, the storage controller is an NVMe controller. Other instance types typically use traditional SCSI controllers that are simulated by VirtIO SCSI. When you update the virtio driver for an NVMe device, the storage driver (viostor) update may not take effect. This means the driver version number is not updated. In this case, we recommend that you check the driver version of the network adapter.
If the storage controller is displayed as Red Hat VirtlO SCSI controller, it is a virtio block device. For a virtio block device, you must determine the virtio driver version from the end of the Driver Version number for the Storage controller.

If the storage controller name contains NVMe, such as Aibaba NVMe Elastic Block Storage Adapter as shown in the figure, it is an NVMe device. For an NVMe device, you must determine the virtio driver version from the end of the Driver Version number for the Network adapters.






