You can resize the disks of Windows 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 instance created before March 30, 2019 or query the serial numbers of the disks attached to an instance created before May 1, 2020, follow the procedure described in this topic to check whether Red Hat virtio drivers of the instances must be updated.
Background information
- Red Hat virtio drivers are supported in only Windows Server 2008 and later.
- If an ECS instance has multiple data disks attached, the driver update process may take one to two minutes to complete.
Procedure
Step 1: Check the version of the drivers
- Method 1: Use the PowerShell script to check the version of the drivers.
- Connect to the Windows instance. For more information, see Connect to a Windows instance from a local client.
- Open Command Prompt.
- Enter powershell to access the PowerShell interactive interface.
- 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")
- Method 2: Manually check the version of the drivers
- Connect to the Windows instance.
- Go to the C:\Windows\System32\drivers system directory.
- Right-click the viostor.sys file, select Properties, and then view the file version on the Details tab.
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 Linux 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: Download the drivers
Click here to download the virtio driver package and decompress it. 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, Windows Server 2019, and Windows Server systems of later versions |
amd64 | 64-bit |
x86 | 32-bit |
Step 3. Update the Red Hat virtio drivers
- Method 1: Use pnputil to add and install the drivers
- Open Command Prompt.
- 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 file to the specified directory, which is <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
- To update only the disk driver, run the following command:
- Restart the operating system of the ECS instance for the driver update to take effect.
- Method 2: Manually add the drivers
- Open Device Manager.
- 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 need to update only one of them.
- Select Browse my computer for driver software.
- Select Let me pick from a list of device drivers on my computer.
- Click Have Disk.
- Select the viostor driver file in the corresponding folder, and follow the wizard to update the driver.
- Restart the operating system of the ECS instance for the driver update to take effect.
What to do next
- For more information about how to resize a disk online, see Resize a disk online.
- For more information about how to query the serial number of a disk, see Query the serial number of a disk.