Ubuntu AMI not loading user-data

后端 未结 2 665
予麋鹿
予麋鹿 2021-02-09 02:10

I am attempting to load user data into an Ubuntu 12.04 LTS AMI (ami-a29943cb, but I\'ve tried a few others to no avail) via boto\'s ec2.run_instances(..., user_data=USER_DATA).

2条回答
  •  终归单人心
    2021-02-09 02:51

    It's hard to know what happened without an error message, but there are a few places you can look:

    1. The file /var/log/cloud-init.log will usually contain any errors (e.g. boto import failure) that occurred during instance bootstrapping.
    2. The directory /var/lib/cloud/instance will contain the raw scripts and user-data downloaded to the instance
    3. You can View/Edit USER_DATA inside the AWS console by right-clicking the instance, to see if boto populated it correctly.

    Looking in those places should help provide clarity.

    I know Ubuntu 12.04 comes with boto 2.2.2:

    root@vanilla-562c:/var/lib/cloud/instance# python
    Python 2.7.3 (default, Apr 20 2012, 22:44:07) 
    [GCC 4.6.3] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import boto
    >>> boto.__version__
    '2.2.2'
    

    ..but I wonder if it's actually accessible in your PYTHONPATH at runtime.

提交回复
热议问题