diff --git a/pkg/compute/guestdrivers/aws.go b/pkg/compute/guestdrivers/aws.go index eb845c2fcc..b535f357c0 100644 --- a/pkg/compute/guestdrivers/aws.go +++ b/pkg/compute/guestdrivers/aws.go @@ -140,8 +140,8 @@ func (self *SAwsGuestDriver) RequestDeployGuestOnHost(ctx context.Context, guest if err != nil { return nil, err } - log.Debugf("VMcreated %s, wait status ready ...", iVM.GetGlobalId()) - err = cloudprovider.WaitStatus(iVM, models.VM_READY, time.Second*5, time.Second*1800) + log.Debugf("VMcreated %s, wait status running ...", iVM.GetGlobalId()) + err = cloudprovider.WaitStatus(iVM, models.VM_RUNNING, time.Second*5, time.Second*1800) if err != nil { return nil, err } diff --git a/pkg/util/aws/host.go b/pkg/util/aws/host.go index ec82c3233d..e6e3992b76 100644 --- a/pkg/util/aws/host.go +++ b/pkg/util/aws/host.go @@ -56,6 +56,7 @@ func (self *SHost) GetIVMs() ([]cloudprovider.ICloudVM, error) { } func (self *SHost) GetIVMById(gid string) (cloudprovider.ICloudVM, error) { + log.Debugf("GetIVMById %s", gid) ivms, _, err := self.zone.region.GetInstances(self.zone.ZoneId, []string{gid}, 0, 1) if err != nil { return nil, err diff --git a/pkg/util/aws/instance.go b/pkg/util/aws/instance.go index 750373b9b8..586914a62f 100644 --- a/pkg/util/aws/instance.go +++ b/pkg/util/aws/instance.go @@ -404,6 +404,8 @@ func (self *SRegion) GetInstances(zoneId string, ids []string, offset int, limit if len(filters) > 0 { params = params.SetFilters(filters) } + + log.Debugf("GetInstances with params: %s", params.String()) res, err := self.ec2Client.DescribeInstances(params) if err != nil { log.Errorf("GetInstances fail %s", err) @@ -413,6 +415,7 @@ func (self *SRegion) GetInstances(zoneId string, ids []string, offset int, limit instances := []SInstance{} for _, reservation := range res.Reservations { for _, instance := range reservation.Instances { + log.Debugf("GetInstances %s", instance.String()) if err := FillZero(instance); err != nil { return nil, 0, err } @@ -540,7 +543,9 @@ func (self *SRegion) CreateInstance(name string, imageId string, instanceType st size = int64(disk.Size) ebs := &ec2.EbsBlockDevice{ DeleteOnTermination: &disk.DeleteWithInstance, - Encrypted: &disk.Encrypted, + // The st1 volume type cannot be used for boot volumes. Please use a supported boot volume type: standard,io1,gp2. + // the encrypted flag cannot be specified since device /dev/sda1 has a snapshot specified. + // Encrypted: &disk.Encrypted, VolumeSize: &size, VolumeType: &disk.Category, } @@ -581,7 +586,6 @@ func (self *SRegion) CreateInstance(name string, imageId string, instanceType st return "", err } - dryrun := true params := ec2.RunInstancesInput{ ImageId: &imageId, InstanceType: &instanceType, @@ -594,7 +598,6 @@ func (self *SRegion) CreateInstance(name string, imageId string, instanceType st Placement: &ec2.Placement{AvailabilityZone: &zoneId}, SecurityGroupIds: []*string{&securityGroupId}, TagSpecifications: []*ec2.TagSpecification{ec2TagSpec}, - DryRun: &dryrun, // todo: 测试 } res, err := self.ec2Client.RunInstances(¶ms) if err != nil {