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.
- 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.
Step 1: Check the version of the driver
- Method 1: Use the PowerShell script to check the version of the driver
- Connect to the Windows instance. For more information, see Connect to a Windows instance by using a username and password.
- 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:
- Method 2: Manually check the version of the driver
- 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 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.
- Connect to your Windows instance. For more information, see Connection methods.
- In the Windows instance, download the script used to update the virtio driver. Click InstallVirtIo.ps1 to download the InstallVirtIo.ps1 script.
- Run the InstallVirtIo.ps1 script to update the virtio driver. In this example, InstallVirtIo.ps1 is downloaded to the C:\test directory.
- Access the C:\test directory. Access the directory to which InstallVirtIo.ps1 is downloaded.
- Select and right-click InstallVirtIo.ps1 and then select Run with PowerShell. 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.
- Access the C:\test directory.
- 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
- For information about how to resize a disk online, see Resize a disk online for Linux instances.
- For information about how to query the serial number of a disk, see Query the serial number of a disk.
- For more information about how to manually update the Red Hat virtio drivers on Windows instances, see Manually update virtio drivers of Windows instances.