New Question
0

Cloud-init stopped working for AWS?

asked 2024-07-26 19:00:29 +0200

ali2k4000 gravatar image

Hi, all. I've been using cloud-init successfully for my windows 2022 core image. All of a sudden, last week it stopped working. It doesn't look like the user is being created and the the metadata is inaccessible. Here are the lines from the bottom of the log file:

2024-07-25 15:26:38.830 2160 ERROR cloudbaseinit.metadata.services.ec2service File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\metadata\services\base.py", line 325, in getdata 2024-07-25 15:26:38.830 2160 ERROR cloudbaseinit.metadata.services.ec2service response = self.httprequest(path) 2024-07-25 15:26:38.830 2160 ERROR cloudbaseinit.metadata.services.ec2service ^^^^^^^^^^^^^^^^^^^^^^^^ 2024-07-25 15:26:38.830 2160 ERROR cloudbaseinit.metadata.services.ec2service File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\metadata\services\base.py", line 319, in httprequest 2024-07-25 15:26:38.830 2160 ERROR cloudbaseinit.metadata.services.ec2service response.raiseforstatus() 2024-07-25 15:26:38.830 2160 ERROR cloudbaseinit.metadata.services.ec2service File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\requests\models.py", line 1021, in raiseforstatus 2024-07-25 15:26:38.830 2160 ERROR cloudbaseinit.metadata.services.ec2service raise HTTPError(httperrormsg, response=self) 2024-07-25 15:26:38.830 2160 ERROR cloudbaseinit.metadata.services.ec2service requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: http://169.254.169.254/2009-04-04/met... 2024-07-25 15:26:38.830 2160 ERROR cloudbaseinit.metadata.services.ec2service 2024-07-25 15:26:38.869 2160 DEBUG cloudbaseinit.metadata.services.ec2service [-] Metadata not found at URL 'http://169.254.169.254/' load C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\metadata\services\ec2service.py:46 2024-07-25 15:26:38.869 2160 ERROR cloudbaseinit.init [-] No metadata service found: cloudbaseinit.exception.MetadataNotFoundException: No available service found 2024-07-25 15:26:38.869 2160 INFO cloudbaseinit.init [-] Plugins execution done 2024-07-25 15:26:38.947 2708 INFO cloudbaseinit.init [-] Process execution ended with exit code: 0

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
0

answered 2024-07-29 10:07:02 +0200

avladu gravatar image

Hello,

This error here: HTTPError: 401 Client Error: Unauthorized for url: http://169.254.169.254is very likely caused by the new way of using the AWS metadata service, called IMDSv2 https://docs.aws.amazon.com/AWSEC2/la... .

Currently, Cloudbase-init does not support IMDSv2.

Can you please confirm that your instances use IMDSv1 or IMDSv2? In this documentation page: https://docs.aws.amazon.com/AWSEC2/la... , you can find how to check if your instance uses IMDSv2 at the section Step 4: Check if your instances are transitioned to IMDSv2.

I have created an issue on Cloudbase-init github repository to track the addition of the IMDSV2 support here: https://github.com/cloudbase/cloudbas... .

Would be great to continue this thread on the github issue link.

Thank you, Adrian Vladu

edit flag offensive delete link more

Comments

Thank you, Adrian. This resolved my issue.

ali2k4000 gravatar imageali2k4000 ( 2024-07-29 16:49:24 +0200 )edit

Hello, if you can also give a thumbs up for the IMDSv2 support issue, to make sure it gets prioritized. https://github.com/cloudbase/cloudbase-init/issues/150 . Thanks!

avladu gravatar imageavladu ( 2024-08-05 15:47:25 +0200 )edit
0

answered 2024-07-26 22:36:24 +0200

ali2k4000 gravatar image

I'm also getting this at the beginning:

2024-07-25 14:59:45.516 2208 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' loadclass C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\utils\classloader.py:27 2024-07-25 14:59:47.048 2208 DEBUG cloudbaseinit.osutils.windows [-] Checking if service exists: cloudbase-init checkserviceexists C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\osutils\windows.py:1104 2024-07-25 14:59:47.048 2208 DEBUG cloudbaseinit.osutils.windows [-] Getting service username: cloudbase-init getserviceusername C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\osutils\windows.py:1237 2024-07-25 14:59:47.048 2208 DEBUG cloudbaseinit.osutils.windows [-] Resetting password for service user: .\cloudbase-init resetservicepassword C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\osutils\windows.py:1260 2024-07-25 14:59:47.079 2208 DEBUG cloudbaseinit.osutils.windows [-] Setting service credentials: cloudbase-init setservicecredentials C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\osutils\windows.py:1220 2024-07-25 14:59:47.079 2208 INFO cloudbaseinit.init [-] Respawning current process with updated credentials. 2024-07-25 14:59:47.079 2208 DEBUG cloudbaseinit.osutils.windows [-] Creating logon session for user: .\cloudbase-init createuserlogonsession C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\osutils\windows.py:651 2024-07-25 14:59:47.095 2208 DEBUG cloudbaseinit.utils.retrydecorator [-] Got expected exception Cannot load user profile: 'The device is not ready.' while calling function cloudbaseinit.osutils.windows.WindowsUtils.createuserlogonsession. Retries left: 3. Time left: undefined. Time elapsed: 0.015629291534423828 Retrying in 1 seconds. inner C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\utils\retrydecorator.py:72 2024-07-25 14:59:48.104 2208 DEBUG cloudbaseinit.osutils.windows [-] Creating logon session for user: .\cloudbase-init createuserlogonsession C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\osutils\windows.py:651 2024-07-25 14:59:48.104 2208 DEBUG cloudbaseinit.utils.retrydecorator [-] Got expected exception Cannot load user profile: 'The device is not ready.' while calling function cloudbaseinit.osutils.windows.WindowsUtils.createuserlogonsession. Retries left: 2. Time left: undefined. Time elapsed: 1.025136947631836 Retrying in 1 seconds. inner C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\utils\retrydecorator.py:72 2024-07-25 14:59:49.107 2208 DEBUG cloudbaseinit.osutils.windows [-] Creating logon session for user: .\cloudbase-init createuserlogonsession C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\osutils\windows.py:651

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2024-07-26 19:00:29 +0200

Seen: 240 times

Last updated: Jul 29