← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2008764] [NEW] Data source: none, and not able to execute user-script in AWS EC2

 

Public bug reported:

Details can be found here :
https://stackoverflow.com/questions/75507635/not-able-to-run-a-user-
script-on-some-ec2-instances-started-from-an-ami-of-ubunt


I am launching multiple ( more than 100 EC2 instances ) from a
previously set AMI. This AMI is made from an Ubuntu 20.04 AMI.
Everything that is required for the work is already satisfied in AMI.
Now I just want execute an user-script while launching EC2 using AMI.
But the problem is coming that for 2-3% of the Ec2 instances are not
able to execute the userscript , othere 97-98% of launched instances are
running perfectly fine. These instances are being launched using spot
requests so they are exactly similar in configurations. I am able to ssh
into the faulty instances too . Last few lines of /var/log/cloud-init-
output.log looks something like this:

Cloud-init v. 22.2-0ubuntu1~22.04.3 running 'modules:config' at Mon, 20 Feb 2023 08:21:36 +0000. Up 41.66 seconds.
Cloud-init v. 22.2-0ubuntu1~22.04.3 running 'modules:final' at Mon, 20 Feb 2023 08:21:39 +0000. Up 45.11 seconds.
Cloud-init v. 22.2-0ubuntu1~22.04.3 finished at Mon, 20 Feb 2023 08:21:39 +0000. Datasource DataSourceNone.  Up 45.51 seconds
2023-02-20 08:21:39,953 - cc_final_message.py[WARNING]: Used fallback datasource

/var/lib/cloud/instance normally points to the a folder in with the name
of instance id but in this faulty case , it is pointing at this ->
/var/lib/cloud/instances/iid-datasource-none

For Faulty instance:

ubuntu@ip-172-31-21-43:/var/lib/cloud/instances/iid-datasource-none$ cat datasource 
DataSourceNone: DataSourceNone

For healthy instance:

ubuntu@ip-172-31-20-76:/var/lib/cloud/instances/i-0c964c834bf91ce81$ cat datasource 
DataSourceEc2Local: DataSourceEc2Local

Now I am not able to figure out that why the userscript is being
executed in most of the instances but these few 2-3%.

** Affects: cloud-init
     Importance: Undecided
         Status: New


** Tags: aws datasource-none ec2 user-script

** Attachment added: "cloud-init tarball"
   https://bugs.launchpad.net/bugs/2008764/+attachment/5650441/+files/cloud-init.tar.gz

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/2008764

Title:
  Data source: none, and not able to execute user-script in AWS EC2

Status in cloud-init:
  New

Bug description:
  Details can be found here :
  https://stackoverflow.com/questions/75507635/not-able-to-run-a-user-
  script-on-some-ec2-instances-started-from-an-ami-of-ubunt


  I am launching multiple ( more than 100 EC2 instances ) from a
  previously set AMI. This AMI is made from an Ubuntu 20.04 AMI.
  Everything that is required for the work is already satisfied in AMI.
  Now I just want execute an user-script while launching EC2 using AMI.
  But the problem is coming that for 2-3% of the Ec2 instances are not
  able to execute the userscript , othere 97-98% of launched instances
  are running perfectly fine. These instances are being launched using
  spot requests so they are exactly similar in configurations. I am able
  to ssh into the faulty instances too . Last few lines of
  /var/log/cloud-init-output.log looks something like this:

  Cloud-init v. 22.2-0ubuntu1~22.04.3 running 'modules:config' at Mon, 20 Feb 2023 08:21:36 +0000. Up 41.66 seconds.
  Cloud-init v. 22.2-0ubuntu1~22.04.3 running 'modules:final' at Mon, 20 Feb 2023 08:21:39 +0000. Up 45.11 seconds.
  Cloud-init v. 22.2-0ubuntu1~22.04.3 finished at Mon, 20 Feb 2023 08:21:39 +0000. Datasource DataSourceNone.  Up 45.51 seconds
  2023-02-20 08:21:39,953 - cc_final_message.py[WARNING]: Used fallback datasource

  /var/lib/cloud/instance normally points to the a folder in with the
  name of instance id but in this faulty case , it is pointing at this
  -> /var/lib/cloud/instances/iid-datasource-none

  For Faulty instance:

  ubuntu@ip-172-31-21-43:/var/lib/cloud/instances/iid-datasource-none$ cat datasource 
  DataSourceNone: DataSourceNone

  For healthy instance:

  ubuntu@ip-172-31-20-76:/var/lib/cloud/instances/i-0c964c834bf91ce81$ cat datasource 
  DataSourceEc2Local: DataSourceEc2Local

  Now I am not able to figure out that why the userscript is being
  executed in most of the instances but these few 2-3%.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/2008764/+subscriptions



Follow ups