You can resize the disks of a Windows Elastic Compute Service (ECS) instance online without the need to restart the instance. You can also query the serial numbers of disks from the operating system of the instance. If you want to resize the disks of a Windows instance created before March 30, 2019 or query the serial numbers of the disks attached to an instance created before May 1, 2020, perform the operations described in this topic to check whether the Red Hat virtio driver of the instance must be updated.

Background information

  • Red Hat virtio drivers are supported only in Windows Server 2008 and later.
  • If an ECS instance has multiple data disks attached, the driver update process may take 1 to 2 minutes to complete.

Procedure

Perform the following operations to update the Red Hat virtio driver of a Windows instance:
  1. Step 1: Check the version of the driver
  2. Step 2: Update the driver

Step 1: Check the version of the driver

You can use one of the following methods to check the version of the driver:
  • Method 1: Use the PowerShell script to check the version of the driver
    1. Connect to the Windows instance. For more information, see Connect to a Windows instance by using a username and password.
    2. Open Command Prompt.
    3. Enter powershell to access the PowerShell interactive interface.
    4. Enter and run the following command to check the version and determine whether the ECS instance supports resizing disks online based on the command output:
      [System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Windows\System32\drivers\viostor.sys")
      Check the version of the driver
  • Method 2: Manually check the version of the driver
    1. Connect to the Windows instance.
    2. Go to the C:\Windows\System32\drivers system directory.
    3. Right-click the viostor.sys file, select Properties, and then view the file version on the Details tab. File version
Determine whether the requirements of the file version are met based on the query results, and perform corresponding operations.
Scenario Version of the Red Hat virtio-scsi driver Operation
Resize a disk online 58011 or later Resize the disk online. For more information, see Resize disks online for Windows instances.
Earlier than 58011 Proceed to the next step.
Query the serial number of a disk 58015 or later Query the serial number of the disk. For more information, see Query the serial number of a disk.
Earlier than 58015 Proceed to the next step.

Step 2: Update the driver

If your Windows instance can access the Internet, we recommend that you perform the operations described in this section to update the virtio driver of your instance in a quick manner. If the instance cannot access the Internet or if you want to batch update the virtio drivers, perform the operations described in Manually update virtio drivers of Windows instances.

Create a snapshot for a disk

  1. Connect to your Windows instance.
    For more information, see Connection methods.
  2. In the Windows instance, download the script used to update the virtio driver.
    Click InstallVirtIo.ps1 to download the InstallVirtIo.ps1 script.
  3. Run the InstallVirtIo.ps1 script to update the virtio driver.
    In this example, InstallVirtIo.ps1 is downloaded to the C:\test directory.
    1. Access the C:\test directory.
      Access the directory to which InstallVirtIo.ps1 is downloaded.
    2. Select and right-click InstallVirtIo.ps1 and then select Run with PowerShell.
      Run the script
      Alternatively, you can press the Shift key and right-click a blank area in the folder window at the same time. Then, select Open PowerShell window here. Run the InstallVirtIo.ps1 script in Windows PowerShell.
      Note
      • If you are logged on to the Windows instance as a regular user, you must run this script as an administrator. If you are logged on as an administrator, you can directly run this script.
      • If you are prompted that you are not allowed to run the script when you manually run the script, you must first modify the script execution policy of PowerShell. For more information, see FAQ.
  4. After the script is run, restart the instance.
    For more information, see Reboot the instance. The updated virtio driver takes effect after your instance is restarted.

What to do next