Problem description
After you attach a disk to a Windows Elastic Compute Service (ECS) instance, open the Server Manager window and choose Tools > Computer Management. In the left-side navigation pane of the Computer Management window, choose Storage > Disk Management. You may find that the disk that you attached is in the Offline state. A disk may be in the Offline state in the following scenarios:
The disk is newly attached to the ECS instance.
Disks and elastic network interfaces (ENIs) on the ECS instance are alternately hot swapped and the ECS instance is restarted.
The instance type of the ECS instance is changed across instance type series and the ECS instance is restarted.
Cause
Storage Area Network (SAN) policies for Windows are categorized into three types. The following table describes the types. However, Windows instances of Alibaba Cloud, such as instances that run Windows 2008, 2012, 2016, 2019, and later, use the OfflineShared mode by default. This way, a disk is offline by default after you attach the disk to a Windows instance of Alibaba Cloud.
Type | Description |
OnlineAll | Indicates that all newly discovered disks are placed in online mode. |
OfflineShared | Indicates that all newly discovered disks on shared buses, such as Fiber Channel (FC) and Internet Small Computer Systems Interface (iSCSI) storage devices, are placed in offline mode and disks on non-shared buses are placed in online mode. |
OfflineInternal | Indicates that all newly discovered disks are placed in offline mode. |
Solution
After you attach a disk to the instance, right-click the disk and select Online.
If you want newly attached disks to automatically come online, use the DiskPart disk partition management tool to query and configure the SAN policy of the instance and change the SAN policy to OnlineAll.
Method 1:
Log on to the instance as an administrator, open the Run window, enter the
diskpart
command, and then click OK.Run the following command to query the current SAN policy of the ECS instance:
san
Run the following command to change the SAN policy of the ECS instance to OnlineAll:
san policy=onlineall
Rerun the
san
command to check whether the SAN policy is changed.
Method 2: Use Cloud Assistant. For more information, see Overview of Cloud Assistant.
Run the following PowerShell command to change the SAN policy of the ECS instance to OnlineAll:
@("san policy=onlineall") |diskpart
NoteTo query the current SAN policy, run the
@("san") |diskpart
command.