• Image Management Service

ims
  1. Help Center
  2. Image Management Service
  3. User Guide
  4. Creating a Private Image
  5. Creating a System Disk Image Using a Windows ECS
  6. Installing Cloudbase-Init

Installing Cloudbase-Init

Scenarios

You are advised to install Cloudbase-Init on the ECS before using it to create a private image so that ECSs created from the private image support custom configurations.

  • If Cloudbase-Init is not installed, you can only log in to the ECS with the original image password, and cannot customize ECS configurations.
  • By default, ECSs created using a public image have Cloudbase-Init installed. You do not need to install and configure Cloudbase-Init again.
  • For ECSs created using an image file you imported, you must install and configure Cloudbase-Init by following the instructions in this section.

Prerequisites

  • An elastic IP address has been bound to the ECS.
  • You have logged in to the ECS.
  • DHCP has been configured for the NICs.

Installing Cloudbase-Init

  1. On the Windows Start menu, choose Control Panel > Programs > Programs and Features to check whether Cloudbase-Init is installed.
  2. Check whether a Windows desktop version is used as the OS:
    • If yes, go to 3.
    • If the OS is Windows Server, go to 4.
  3. Enable the administrator account (Windows 7 is used as an example).
    1. Click Start and choose Control Panel > System and Security > Administrative Tools.
    2. Double-click Computer Management.
    3. Choose System Tools > Local Users and Groups > Users.
    4. Right-click Administrator and select Properties.
    5. Deselect Account is disabled.
  4. Download the Cloudbase-Init installation package.

    Download the Cloudbase-Init installation package of the appropriate version based on the OS architecture from the Cloudbase-Init official website (http://www.cloudbase.it/cloud-init-for-windows-instances/).

    Cloudbase-Init has two versions: stable and beta.

    To obtain the stable version, visit the following paths:

    To obtain the beta version, visit the following paths:

  5. Double-click the Cloudbase-Init installation package.
  6. Click Next.
  7. Select I accept the terms in the License Agreement, and click Next.
  8. Retain the default path and click Next.
  9. In the Configuration options window, enter Administrator for Username, select COM1 for Serial port for logging, and ensure that Run Cloudbase-Init service as LocalSystem is not selected.
    NOTE:

    The version shown in the figure is for reference only. You must use the latest version.

    Figure 1 Configuring parameters
  10. Click Next.
  11. Click Install.
  12. In the Files in Use dialog box, select Close the application and attempt to restart them and click OK.
  13. Check whether a Windows desktop version is used as the OS:
    • If yes, go to 15.
    • If no, go to 14.
  14. In the Completed the Cloudbase-Init Setup Wizard window, ensure that neither option is selected.
    Figure 2 Completing the Cloudbase-Init installation
    NOTE:

    The version shown in the figure is for reference only. You must use the latest version.

  15. Click Finish.

Configuring Cloudbase-Init

  1. Add configuration item netbios_host_name_compatibility=false to the last row in the C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init.conf file. This will allow the hostname to contain a maximum of 63 characters.
    NOTE:

    NetBIOS contains no more than 15 characters due to Windows system restrictions.

  2. Enable the agent to access the IaaS OpenStack data source by adding configuration item metadata_services=cloudbaseinit.metadata.services.httpservice.HttpService to the cloudbase-init.conf configuration file in the C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\ directory.
  3. Add the following configuration to C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init.conf (Cloudbase-Init installation path) to set the number of retries and interval for obtaining metadata:
    retry_count=40
    retry_count_interval=5
  4. Add the following configuration to C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init.conf (Cloudbase-Init installation path) to prevent the metadata network from being disconnected because the default route is added by Windows:
    [openstack]
    add_metadata_private_ip_route=False
  5. (Optional) When the Cloudbase-Init version is 0.9.12 or later, you can customize the length of the password. To set the password length, change the value of user_password_length in C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init.conf.
  6. Release the current DHCP address so that created ECSs can obtain correct addresses.

    In the Windows command line, run the following command to release the current DHCP address:

    ipconfig /release

    NOTE:

    This operation will interrupt network connection of the ECS. After the ECS is restarted, the network connection will be restored.

  7. Set the SAN policy of the ECS to OnlineAll. Otherwise, the EVS disks attached to the ECS may be offline.

    Windows has three types of SAN policies: OnlineAll, OfflineShared, and OfflineInternal.

    Table 1 SAN policies

    Type

    Description

    OnlineAll

    Indicates that all disks are automatically brought online.

    OfflineShared

    Indicates that all disks on sharable buses, such as iSCSI and FC, are left offline by default, while disks on non-sharable buses are kept online.

    OfflineInternal

    Indicates that all disks on buses that are detected as internal are left offline as default.

    1. Execute cmd.exe and run the following command to query the current SAN policy of the ECS using DiskPart:

      diskpart

    2. Run the following command to view the SAN policy of the ECS:
      san
      • If the SAN policy is OnlineAll, run the exit command to exit DiskPart.
      • If the SAN policy is not OnlineAll, go to 7.c.
    3. Run the following command to change the SAN policy to OnlineAll:

      san policy=onlineall