• Bare Metal Server

bms
  1. Help Center
  2. Bare Metal Server
  3. Private Image Creation Guide (BMS)
  4. Creating a Linux Image
  5. Configuring Cloud-Init
  6. Configuring Cloud-Init 17.1

Configuring Cloud-Init 17.1

  1. Add the key-value pair no_ssh_fingerprints: true and ensure that it has a blank row before and after it.
    no_ssh_fingerprints: true
  2. Change the value of users to default.
    users: 
         - default
  3. Change the value of disable_root to true. This parameter specifies whether remote login over SSH as user root is enabled.
    disable_root: true
  4. Add ssh_pwauth: false or ssh_pwauth: 0. This parameter specifies whether remote login over SSH as user root is enabled.
    ssh_pwauth: false
  5. Add the following content:
    network:
        config: disabled
    datasource_list: [ OpenStack ]

    For Ubuntu 16.04, do not add the following information:

    datasource_list: [ OpenStack ]
  6. Add the following content after - final-message in cloud_final_modules:
    - power-state-change
  7. Modify the content under system info as follows:
    system_info:
       distro: sles
       default_user:
         name: linux   //Username for logging in to the OS
         lock_passwd: True   //True indicates that password login is disabled. In some OSs, 1 indicates that password login is disabled.
         gecos: redhat
         groups: [adm, audio, cdrom, dialout, dip, floppy, lxd, netdev, plugdev, sudo, video]   //(Optional) This parameter specifies the groups to which the user is added. The value must contain groups that exist in the etc/group of the OS.
         sudo: ["ALL=(ALL) NOPASSWD:ALL"]   //The user has all permissions of user root.
         shell: /bin/bash   //The bash command is used to execute the shell script.
        paths:
          cloud_dir: /var/lib/cloud/
          templates_dir: /etc/cloud/templates/
        ssh_svcname: sshd

    The value of distro varies depending on the OS and can be slesrhelubuntudebian, or fedora.

  8. (Optional) For SUSE 12 SP1 and SUSE 12 SP2, run the following command to modify configuration item [Unit] in the /usr/lib/systemd/system/cloud-init-local.service configuration file:

    vi /usr/lib/systemd/system/cloud-init-local.service

    Ensure that the value of [Unit] is the same as the following:

    [Unit]
    Description=Initial cloud-init job (pre-networking)
    DefaultDependencies=no
    Wants=network-pre.target
    Wants=local-fs.target
    After=local-fs.target
    Before=network-pre.target
    Before=shutdown.target
    Before=basic.target
    Conflicts=shutdown.target
    # Other distros use Before=sysinit.target. There is not a clearly identified
    # reason for usage of basic.target instead.
  9. (Optional) For Ubuntu 16.04, run the following command to configure the OpenStack source:

    dpkg-reconf igure cloud-init