cloud-init

Using cloud-init on an Azure VM to mount a data disk fails

随声附和 提交于 2020-07-22 05:27:05
问题 This is a similar problem to a previous SO question, from which I adapted my code How can i use cloud-init to load a datadisk on an ubuntu VM in azure Using a cloud-config file passed through Terraform: #cloud-config disk_setup: /dev/disk/azure/scsi1/lun0: table_type: gpt layout: true overwrite: false fs_setup: - device: /dev/disk/azure/scsi1/lun0 partition: 1 filesystem: ext4 mounts: - [ "/dev/disk/azure/scsi1/lun0-part1", "/opt/data", auto, "defaults,noexec,nofail", ] data "template_file"

How can i use cloud-init to load a datadisk on an ubuntu VM in azure

核能气质少年 提交于 2020-05-13 07:34:34
问题 I have been trying use cloud-init to partition and mount a datadisk on a Ubuntu VM in azure. Most of the online examples show how to do that for the temporary disk but not for data disk. I tried dabbling around with it with out much luck. Please let me know if I am doing something wrong in the below code or if its not possible to do it with cloud-init #cloud-config device_aliases: {'ephemeral0': '/dev/sdb','datadisk': '/dev/sdc1'} disk_setup: ephemeral0: table_type: mbr layout: True overwrite

Why is my cloud-init script not getting run?

﹥>﹥吖頭↗ 提交于 2020-01-16 09:08:31
问题 I have used terraform to create a VPC in AWS with (so far) 1 EC2 instance; I want to get it to install mysql-server, using cloud-init. I have managed to upload a text file to /var/lib/cloud/scripts/per-once , using user_data : admin@ip-10-0-1-194:~$ ll /var/lib/cloud/scripts/per-once total 4 -rw-r--r-- 1 root root 42 Sep 16 10:41 install_mysql admin@ip-10-0-1-194:~$ cat /var/lib/cloud/scripts/per-once/install_mysql #cloud-config packages: - mysql-server I can see in /var/log/cloud-init.log

cloud-init execution order doesn't respect /etc/cloud/cloud.cfg?

烈酒焚心 提交于 2019-12-23 11:45:18
问题 This is the content of /etc/cloud/cloud.cfg of Ubuntu cloud 16.04 image: # The top level settings are used as module # and system configuration. # A set of users which may be applied and/or used by various modules # when a 'default' entry is found it will reference the 'default_user' # from the distro configuration specified below users: - default # If this is set, 'root' will not be able to ssh in and they # will get a message to login instead as the above $user (ubuntu) disable_root: true #

Using cloud-init user data

二次信任 提交于 2019-12-22 07:46:56
问题 I have a simple cloud-init user data that I am passing in to ec2. I set this data on my ec2 instance by right clicking the instance and setting the user data in there. Following is my cloud-init user data #cloud-config runcmd: - [ ls, -l, / ] - [ sh, -xc, "echo $(date) ': hello world!'" ] - [ sh, -c, echo "=========hello world'=========" ] - [ touch, /home/ec2-user/hello.txt ] final_message: "The system is finally up, after 10 seconds" I got this example from here and I added the touch

Using cloud-init user data

你离开我真会死。 提交于 2019-12-22 07:46:21
问题 I have a simple cloud-init user data that I am passing in to ec2. I set this data on my ec2 instance by right clicking the instance and setting the user data in there. Following is my cloud-init user data #cloud-config runcmd: - [ ls, -l, / ] - [ sh, -xc, "echo $(date) ': hello world!'" ] - [ sh, -c, echo "=========hello world'=========" ] - [ touch, /home/ec2-user/hello.txt ] final_message: "The system is finally up, after 10 seconds" I got this example from here and I added the touch

How to run cloud-init manually?

元气小坏坏 提交于 2019-12-20 08:37:32
问题 I'm writing a CloudFormation template and I'm trying to debug the user-data script I provide in the template. How can I run the cloud-init manually and make it perform the same actions it does when starting a new instance? 回答1: You can just run it like this: /usr/bin/cloud-init -d init This runs the cloud init setup with the initial modules. (The -d option is for debug) If want to run all the modules you have to run: /usr/bin/cloud-init -d modules Keep in mind that the second time you run

/var/log/cloud-init-output.log is not present on RHEL 7.5

醉酒当歌 提交于 2019-12-14 03:45:25
问题 I've got a custom hardended RHEL 7.5 custom AMI. I want to use user data to complete some deploy time configuration. I've already ensured that /var/lib/cloud/* is removed before I create the AMI. These are the contents of my user data: echo "My script fired." >> /tmp/test.txt echo "This line should produce an output log." The file /tmp/test.txt is present, indicating the my script did indeed run. However, the expected result of the second statement is that a file /var/log/cloud-init-output

Bash script passed to AWS EC2 Instance as User Data file fails to load on initial boot

本秂侑毒 提交于 2019-12-12 04:58:30
问题 I have a simple bash script I'm trying to pass to an AWS EC2 ubuntu instance via a Powershell script using the AWS Library. #!/bin/bash apt-get update apt-get upgrade Heres the powershell script that encodes the file contents in base64 and calls the cmdlet that starts the EC2 instance: $fileContent = Get-Content $UserDataTarget $fileContentBytes = [System.Text.Encoding]::UTF8.GetBytes($fileContent) $fileContentEncoded = [System.Convert]::ToBase64String($fileContentBytes) $MasterInstance = New

Failed to start cloud-init at startup after upgrading to Python 3.6

妖精的绣舞 提交于 2019-12-11 15:09:30
问题 I've installed Python 3.6 instead of the default 3.5 release on a new cloud server (Ubuntu 16.04). After I restarted the server, I found that it failed to execute cloud-init at startup with the following errors in the syslog . Sep 20 16:16:14 cloud-init[1310]: Traceback (most recent call last): Sep 20 16:16:14 cloud-init[1310]: File "/usr/bin/cloud-init", line 9, in <module> Sep 20 16:16:14 cloud-init[1310]: load_entry_point('cloud-init==0.7.9', 'console_scripts', 'cloud-init')() Sep 20 16:16