aws ec2 run-instances with offline and unallocated disks

0

Hi Community
We have created a new ec2 instance with 3 drives by aws ec2 run-instances as below. The 3 volumes have been created and were shown as attached in the aws console ec2 volumes screen. Nevertheless on the server in Disk Management, only Drive C: was available, the additional 2 drives were offline and unallocated: Enter image description here We needed to take them online, initialize and allocate by Windows tools. Does anybody know how we make them online and allocated by an aws bash command? Thanks! Patrick


aws ec2 run-instances
--instance-type t2.xlarge
--image-id ami-0c6e3ed6b1dd28a39
--block-device-mappings file:///home/cloudshell-user/mapping.json
--key-name xxx
--security-group-ids xxx
--subnet-id xxx
--instance-initiated-shutdown-behavior stop
--disable-api-termination
mapping.json:
[
{
"DeviceName": "/dev/sda1",
"Ebs": {
"DeleteOnTermination": true,
"VolumeSize": 70,
"VolumeType": "gp2"
}
},
{
"DeviceName": "/dev/sdh",
"Ebs": {
"DeleteOnTermination": true,
"VolumeSize": 80,
"VolumeType": "gp2"
}
},
{
"DeviceName": "/dev/sdi",
"Ebs": {
"DeleteOnTermination": true,
"VolumeSize": 80,
"VolumeType": "gp2"
}
}
]

  • In order to accomplish this, you will have to provide user data with the powershell commands to mount and format the disks and then allocate them to drives as you wish. I am not well versed in powershell to provide the commands.

질문됨 2년 전459회 조회
1개 답변
0

Hi Rodney

Thanks for your comment. Do you mean I should use the '--user-data'-parameter in 'aws ec2 run-intances' to start a powershell script to mount and attach drives?

Thanks! Patrick

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠