Alibaba Cloud virtio drivers are high-performance I/O drivers in virtualization technology required for publishing images to the Alibaba Cloud platform. Pre-install virtio drivers when creating images. Otherwise, Elastic Compute Service (ECS) instances created from these images will fail to start. If an instance fails to start due to missing virtio drivers during image creation, you can follow the instructions in this topic to install virtio drivers offline.
Because the instance fails to start, you can only install virtio drivers by mounting the disk to a new instance. This is why it is called offline installation.
Procedure
Create a snapshot of the abnormal instance that fails to start to back up your data.
NoteCreating snapshots incurs snapshot fees. For more information, see Snapshot billing.
Purchase a new ECS instance. For more information, see Create an instance by using the wizard.
The new instance must meet the following requirements:
Virtual private cloud (VPC): It must be in the same VPC as the abnormal instance.
Image: We recommend that you use an official image with the same operating system as the abnormal instance.
NoteCreating a new ECS instance will incur fees for computing, storage, image, and other resources based on your actual configuration. Please pay attention to the billing of each billing item. After you finish using the new instance, release the resources as soon as possible to avoid continuous charges.
Detach the system disk of the abnormal instance and attach it as a data disk to the new instance purchased in Step 2.
For more information, see Detach or attach a system disk and Attach the system disk to another ECS instance as a data disk for repair.
Connect to the new instance and check the status of the attached abnormal disk in Disk Management and take appropriate actions.
Disk status
Solution
Disk is offline
Right-click the disk and select Online.
Disk is read-only
Run the following commands in Windows PowerShell to clear the read-only property of the disk:
diskpart list disk # Confirm the abnormal disk number (such as disk 1) select disk 1 # Select the abnormal system disk attributes disk # View current disk properties attributes disk clear readonly # If the disk is read-only, clear the read-only property exitPartition has no drive letter
Right-click the partition and select Change Drive Letter And Paths, and follow the interface prompts to assign a drive letter to the partition.
Export virtio drivers from the normal instance to a specified directory (in PowerShell).
Export-WindowsDriver -Online -Destination <directory for storing the exported data>Replace
<directory for storing the exported data>based on your actual environment, for example,C:\test.Install the exported drivers for the abnormal disk.
Add-WindowsDriver -Path <abnormal disk drive letter> -Driver <directory for restoring exported data> -RecurseReplace
<abnormal disk drive letter>and<directory for restoring exported data>based on your actual environment, for example:Add-WindowsDriver -Path D: -Driver C:\test -RecursePerform the following operations on the abnormal disk in sequence.
Take offline: In Disk Management, right-click and select Offline.
Detach: See Detach a data disk.
Attach to the source instance: Attach the repaired disk back to the source ECS instance as the system disk.
Restart the source ECS instance and verify that it starts normally and loads the virtio drivers.