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年前465ビュー
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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ