• Bare Metal Server

  1. Help Center
  2. Bare Metal Server
  3. Private Image Creation Guide (BMS)
  4. Creating a Linux Image
  5. Installing Cloud-Init
  6. SUSE 11 SP4


  1. Add the zypper source configuration file.
    1. Run the zypper addrepo url command.

      url in this command is an HTTP address, for example, http://download.opensuse.org/repositories/home:garloff:OTC:cloudinit/SLE_11_SP4/home:garloff:OTC:cloudinit.repo

    2. Run the zypper refresh command.
  2. Install Cloud-Init.

    The dependent software packages vary depending on the Cloud-Init version. This section uses cloud-init-0.7.6-27.19.1.x86_64.rpm as an example. You can use the latest version.

    Step 1: Install cloud-init-0.7.6-27.19.1.x86_64.rpm.

    1. Obtain the Cloud-Init installation package.

      Visit the SUSE official website https://software.opensuse.org/package/cloud-init, locate SUSE SLE-11 SP4, and click Show unstable packages.

      In the displayed Warning dialog box, click Continue.

    2. Click 64 Bit shown in the following figure. The browser will automatically download the Cloud-Init 0.7.6 software package.

    3. Upload the Cloud-Init 0.7.6 to the VM and run the rpm -ivh cloud-init-0.7.6-27.19.1.x86_64.rpm command to query the dependent packages.

    Step 2: Install the dependent software packages.

    Download dependent software packages from the zypper source. If some dependent software packages are not contained in the zypper source, download them from the SUSE official website https://software.opensuse.org/search and then upload them to the VM.

    1. Install python-six.

      Visit the SUSE official website https://software.opensuse.org/search and search for python-six.

      Click python-six in the search result, locate the SUSE 11 SP4 OS with OTC, and click 64 Bit.

      Upload the package to the VM and run the rpm -ivh python-six-xxx command to install python-six. The methods of installing other dependent packages are similar to this.

    2. During the installation, you are not prompted of the python-six dependent package and need to install it.

      Run the rpm -ivh Package name command to upload the package to the VM and install it.

      linux-dann:/tmp # rpm -ivh python-six-1.10.0-5.1.x86_64.rpm
      warning: rpm -ivh python-six-1.10.0-5.1.x86_64.rpm: Header V3 DSA signa
    3. Download the following dependent packages from the zypper source (the version numbers are only for reference and the latest versions are recommended):






      Run the zypper install python-cheetah command to install the python-Cheetah package. The methods of downloading other dependent packages are the same.

    4. Download the following dependent packages from the SUSE official website (the version numbers are only for reference and the latest versions are recommended) and run the rpm -ivh Package name command to upload them to the VM and install them:








    Step 3: Install the rpm package of Cloud-Init.

    Run the rpm -ivh cloud-init-0.7.6-32.8.x86_64.rpm command to install Cloud-Init.

    Step 4: Query the Cloud-Init version.

    Run the cloud-init -v command to query the Cloud-Init version to check whether the installation is successful.

  3. Configure the cloud.cfg file that defines the initialization tasks of Cloud-Init.

    Modify the /etc/cloud/cloud.cfg configuration file to customize the function configuration during BMS initialization using Cloud-Init.

    The following content is only for reference:

    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.
       - default
    3. Modify the following content:
      disable_root: True
      ssh_pwauth: false
      preserve_hostname: false
      syslog_fix_perms: root:root
    4. Use the number sign (#) to comment out the following rows:
      mount_default_fields: [~, ~, 'auto', 'defaults', '0', '2']
      manual_cache_clean: true
    5. Add the following content:
        config: disabled
        mode: false
    6. Add the following content after - final-message in cloud_final_modules:
      - power-state-change
    7. Modify the content under system info as follows:
         distro: sles
           name: linux
           lock_passwd: True
           gecos: redhat
           groups: [audio, cdrom, dialout, floppy, video]
           sudo: ["ALL=(ALL) NOPASSWD:ALL"]
           shell: /bin/bash
            cloud_dir: /var/lib/cloud/
            templates_dir: /etc/cloud/templates/
          ssh_svcname: sshd

      Change the value of distro based on the OS type, such as sles and rhel. In this section, SUSE 11 SP4 is used as an example. Change the value of distro to sles.

    8. Use the number sign (#) to comment out the following row:
      ssh_genkeytypes: ['rsa', 'dsa']