tech:notes_cloudinit
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédente | |||
| tech:notes_cloudinit [2025/03/26 10:04] – Jean-Baptiste | tech:notes_cloudinit [2026/04/27 18:15] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes cloudinit | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | Voir aussi : | ||
| + | * Tiny Cloud | ||
| + | |||
| + | ~~~ | ||
| + | ubuntu@vm-testjb1: | ||
| + | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCZQwNs9aV// | ||
| + | ~~~ | ||
| + | |||
| + | ~~~yaml | ||
| + | # | ||
| + | packages: | ||
| + | - git-core | ||
| + | |||
| + | # | ||
| + | apt_update: true | ||
| + | |||
| + | #! | ||
| + | echo " | ||
| + | |||
| + | environment: | ||
| + | |||
| + | output: {all: '| tee -a / | ||
| + | ~~~ | ||
| + | |||
| + | ~~~ | ||
| + | ************************************************************************** | ||
| + | # This system is using the EC2 Metadata Service, but does not appear to # | ||
| + | # be running on Amazon EC2 or one of cloud-init' | ||
| + | # provide a EC2 Metadata service. In the future, cloud-init may stop # | ||
| + | # reading metadata from the EC2 Metadata Service unless the platform can # | ||
| + | # be identified. | ||
| + | # # | ||
| + | # If you are seeing this message, please file a bug against | ||
| + | # cloud-init at # | ||
| + | # https:// | ||
| + | # Make sure to include the cloud provider your instance is # | ||
| + | # running on. # | ||
| + | # # | ||
| + | # For more information see # | ||
| + | # | ||
| + | # # | ||
| + | # After you have filed a bug, you can disable this warning by # | ||
| + | # launching your instance with the cloud-config below, or # | ||
| + | # putting that content into # | ||
| + | # / | ||
| + | # # | ||
| + | # # | ||
| + | # datasource: | ||
| + | # Ec2: # | ||
| + | # | ||
| + | ************************************************************************** | ||
| + | |||
| + | Disable the warnings above by: | ||
| + | touch / | ||
| + | or | ||
| + | touch / | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## DRAFT - Se connecter à une instance dont on ne possède pas la clef | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | |||
| + | FIXME | ||
| + | |||
| + | ~~~bash | ||
| + | aws --region=eu-central-1 ec2 describe-instances --output=table | ||
| + | ~~~ | ||
| + | |||
| + | '' | ||
| + | ~~~bash | ||
| + | #!/bin/bash | ||
| + | cat >> / | ||
| + | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCZQwNs9aV// | ||
| + | EOF | ||
| + | |||
| + | sed -i ' | ||
| + | systemctl restart sshd | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | base64 my_script.sh > my_script_base64.txt | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ~~~bash | ||
| + | aws ec2 --region=eu-central-1 modify-instance-attribute --instance-id i-08df328706b9e6d46 --attribute userData --value file:// | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Autres | ||
| + | |||
| + | / | ||
| + | |||
| + | File | ||
| + | / | ||
| + | |||
| + | Kernel | ||
| + | ~~~ini | ||
| + | cloud-init=disabled | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Pb | ||
| + | |||
| + | ### Pb temps de démarrage élevé | ||
| + | |||
| + | ~~~ | ||
| + | # systemd-analyze | ||
| + | Startup finished in 3.195s (kernel) + 23.788s (userspace) = 26.983s | ||
| + | graphical.target reached after 23.230s in userspace | ||
| + | |||
| + | # systemd-analyze blame | ||
| + | | ||
| + | 5.854s docker.service | ||
| + | 3.440s mariadb.service | ||
| + | 2.459s cloud-init.service | ||
| + | 2.317s isc-dhcp-server.service | ||
| + | 1.984s php7.3-fpm.service | ||
| + | 1.916s proftpd.service | ||
| + | 1.200s cloud-config.service | ||
| + | 1.138s ifupdown-pre.service | ||
| + | 946ms bind9.service | ||
| + | 911ms dev-mapper-vgos\x2droot | ||
| + | ~~~ | ||
| + | |||
| + | Logs | ||
| + | * / | ||
| + | * / | ||
| + | |||
| + | ~~~bash | ||
| + | curl http:// | ||
| + | ~~~ | ||
| + | |||
| + | #### Solution | ||
| + | |||
| + | ~~~bash | ||
| + | dpkg -i cloud-init_20.2-2~deb10u1_all.deb cloud-guest-utils_0.29-1_all.deb | ||
| + | |||
| + | echo " | ||
| + | rm / | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | |||
