You can resize the disks of Windows ECS instances online without having to restart the instances. You can also query the serial numbers of disks from the operating systems. If you want to resize the disks of a Windows ECS instance created before March 30, 2019 or query the serial numbers of the disks of an instance created before May 1, 2020, follow the procedure described in this topic to check whether the Red Hat VirtIO driver of the instances needs to be updated.

Background information

  • The Red Hat VirtIO driver is supported only on Windows Server 2008 and later.
  • If an ECS instance has multiple data disks attached, the driver update process may take a few minutes to complete.

Procedure

You can follow the following procedure to update the Red Hat VirtIO driver of a Windows ECS instance:
  1. Step 1. Check the driver version
  2. Step 2. Download the driver
  3. Step 3. Update the Red Hat VirtIO driver

Step 1. Check the driver version

You can use one of the following methods to check the driver version:
  • Method 1: Use the PowerShell script to check the driver version
    1. Connect to the Windows instance. For more information, see Connect to a Windows instance.
    2. Open Command Prompt.
    3. Enter powershell to access the PowerShell interactive interface.
    4. Enter and run the following command to check the driver version and determine whether the Windows instance supports online disk resizing based on the command output:
      [System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Windows\System32\drivers\viostor.sys")
      Check the driver version
  • Method 2: Manually check the driver version
    1. Connect to the Windows instance.
    2. Go to the system directory C:\Windows\System32\drivers.
    3. Right-click the viostor.sys file, select Properties, and 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 Red Hat VirtIO SCSI driver version Operation
Resize a disk online 58011 or later Resize the disk online. For more information, see Extend a disk online.
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.
Earlier than 58015 Proceed to the next step.

Step 2. Download the driver

Download and decompress the VirtIO driver package. The subsequent steps in this topic are based on the assumption that the decompressed driver package is located at C:\Users\Administrator\Desktop\virtioDriver. The following table lists the extracted folders corresponding to ECS instances of different operating system versions.

Driver file (folder) name Description
win7 Windows Server 2008 R2 and Windows 7
Wlh Windows Server 2008
Win8 Windows Server 2012 and Windows Server 2012 R2
win10 Windows 10, Windows Server 2016, and Windows Server systems of later versions
amd64 64-bit
x86 32-bit

Step 3. Update the Red Hat VirtIO driver

You can use one of the following methods to update the Red Hat VirtIO driver:
  • Method 1: Use pnputil to add and install the driver
    1. Open Command Prompt.
    2. Run the following command to add the driver package:
      pnputil -i -a <path to virtio driver inf>

      Make sure that you have extracted the .inf target file to the specified directory <path to virtio driver inf>. (Example: C:\Users\Administrator\Desktop\virtioDriver\win7\amd64\viostor.inf)

      • To update only the disk driver, run the following command:
        pnputil -i -a C:\Users\Administrator\Desktop\virtioDriver\win7\amd64\viostor.inf
      • To update all Red Hat VirtIO drivers, run the following command:
        pnputil -i -a C:\Users\Administrator\Desktop\virtioDriver\win7\amd64\*.inf
    3. Restart the operating system of the ECS instance for the driver update to take effect.
  • Method 2: Manually add the driver
    1. Open Device Manager.
    2. Right-click Red Hat VirtIO SCSI controller under Storage controllers and select Update Driver Software....
      Note If multiple Red Hat VirtIO SCSI controller devices appear, you only need to update one of them.
      Update the driver
    3. Select Browse my computer for driver software.
    4. Select Let me pick from a list of device drivers on my computer.
    5. Click Have Disk.
    6. Select the driver file viostor in the corresponding folder, and follow the wizard to update the driver.
    7. Restart the operating system of the ECS instance for the driver update to take effect.

What to do next