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.

demandé il y a 2 ans459 vues
1 réponse
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

répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions