Home > other >  Use the AWS EC2 cli how to create system disk to the SSD
Use the AWS EC2 cli how to create system disk to the SSD

Time:09-28

Consult: use the AWS EC2 cli how to create system disk to the SSD?

CodePudding user response:

In block - display device - the mappings using specified gp2 hard drive (SSD) as the root device (/dev/xvda)

 
Aws ec2 run - instances - image - id=e2a7c ami - 146 - key - name=your secret key - the instance - type=t2. Micro - block device - the mappings="[{" DeviceName \ ": "/dev/xvda \ "and " Ebs \ ": {" DeleteOnTermination \ ": true, " VolumeSize \ ": 8, " VolumeType \ ": " gp2 \}}] "


Different image root device path is not the same as
The roots of the following command to view the image device path, the following RootDeviceName field
 
Aws ec2 describe images - image - e2a7c ids ami - 146

{
"Images" : [
{
"VirtualizationType" : "HVM,"
"Name" : "amzn - ami - HVM - 2014.09.2. X86_64 - ebs",
"The Hypervisor" : "xen,"
"ImageOwnerAlias" : "amazon",
"SriovNetSupport" : "simple,"
"ImageId" : "e2a7c ami - 146,"
"State" : "available",
"BlockDeviceMappings" : [
{
"DeviceName" : "/dev/xvda",
"Ebs" : {
"DeleteOnTermination" : true,
"SnapshotId" : "snap - 6 a3ad4e7,"
"VolumeSize" : 8,
"VolumeType" : "standard",
"Encrypted" : false
}
}
],
"Architecture" : "x86_64,"
"ImageLocation" : "amazon/amzn - ami - HVM - 2014.09.2. X86_64 - ebs",
"RootDeviceType" : "ebs,"
"OwnerId" : "137112412989",
"RootDeviceName" : "/dev/xvda",
"CreationDate" : "the 2015-01-27 T23: behold. 000 z,"
"Public" : true,
"ImageType" : "the machine",
"Description" : "Amazon Linux AMI 2014.09.2 x86_64 HVM EBS"
}
]
}
  •  Tags:  
  • AWS
  • Related