@@ -647,9 +647,10 @@ func (d *Driver) Create() error {
647647 // PreCreateCheck has already been called
648648
649649 if err := d .innerCreate (); err != nil {
650+ log .Warnf ("error encountered during instance creation: %s" , err .Error ())
650651 // cleanup partially created resources
651- if err := d .Remove (); err != nil {
652- return err
652+ if removalErr := d .Remove (); removalErr != nil {
653+ return removalErr
653654 }
654655 return err
655656 }
@@ -690,7 +691,7 @@ func (d *Driver) innerCreate() error {
690691 var instance * ec2.Instance
691692 if d .RequestSpotInstance {
692693 req := ec2.RunInstancesInput {
693- ImageId : & d .AMI ,
694+ ImageId : & d .AMI ,
694695 MinCount : aws .Int64 (1 ),
695696 MaxCount : aws .Int64 (1 ),
696697 Placement : & ec2.Placement {
@@ -706,11 +707,11 @@ func (d *Driver) innerCreate() error {
706707 EbsOptimized : & d .UseEbsOptimizedInstance ,
707708 BlockDeviceMappings : bdmList ,
708709 UserData : & userdata ,
709- MetadataOptions : & ec2.InstanceMetadataOptionsRequest {},
710+ MetadataOptions : & ec2.InstanceMetadataOptionsRequest {},
710711 InstanceMarketOptions : & ec2.InstanceMarketOptionsRequest {
711712 MarketType : aws .String (ec2 .MarketTypeSpot ),
712713 SpotOptions : & ec2.SpotMarketOptions {
713- MaxPrice : & d .SpotPrice ,
714+ MaxPrice : & d .SpotPrice ,
714715 SpotInstanceType : aws .String (ec2 .SpotInstanceTypeOneTime ),
715716 },
716717 },
@@ -808,7 +809,7 @@ func (d *Driver) innerCreate() error {
808809 EbsOptimized : & d .UseEbsOptimizedInstance ,
809810 BlockDeviceMappings : bdmList ,
810811 UserData : & userdata ,
811- MetadataOptions : & ec2.InstanceMetadataOptionsRequest {},
812+ MetadataOptions : & ec2.InstanceMetadataOptionsRequest {},
812813 TagSpecifications : resourceTags ,
813814 }
814815
0 commit comments