(Optional) Installing Cloudbase-Init

To configure the ECS created from an image (for example, changing the ECS password), you are advised to install Cloudbase-Init. If you do not install it, the ECS cannot be configured and you can log in to the ECS only with the image password.

Install Cloudbase-Init

  1. Download the Cloudbase-Init installation package.

    The version of Cloudbase-Init may vary depending on the OS bit. The downloaded package must be saved to a local shared folder (download path: http://www.cloudbase.it/cloud-init-for-windows-instances/).

  2. On the VirtualBox Windows VM, choose Computer > Network > VBOXSVR.
  3. Double-click the shared folder, copy the Cloudbase-Init installation package to the newly created VM, and double-click the installation package.

    In this section, CloudbaseInitSetup_0_9_11_x64 is used as an example.

Configure Cloudbase-Init

  1. Edit configuration file C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init.conf in the Cloudbase-Init installation path.
    1. Add netbios_host_name_compatibility=false to the last line of the file so that the hostname supports a maximum of 63 characters.

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

    2. Add metadata_services=cloudbaseinit.metadata.services.httpservice.HttpService to enable the agent to access the IaaS OpenStack data source.
    3. (Optional) Add the following configuration items to configure the number of retry times and interval for obtaining metadata:
      retry_count=40
      retry_count_interval=5
    4. (Optional) Add the following configuration item to prevent metadata network disconnections caused by the default route 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.

      Change the value of user_password_length to customize the password length.

    6. (Optional) Add configuration item first_logon_behaviour=no to the cloudbase-init.conf configuration file in the C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\ directory to disable the function of changing the password.

      Add first_logon_behaviour=no.

  2. Release the current DHCP address so that the created ECS can obtain the correct addresses.

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

    ipconfig /release

    This operation will interrupt network connection and adversely affect ECS use. The network will automatically recover after the ECS is started again.

  3. When creating an image using a Windows ECS, you need to change the SAN policy of the ECS to OnlineAll. Otherwise, EVS disks attached to the ECSs created from the image may be offline.

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

    Table 1 SAN policies

    Type

    Description

    OnlineAll

    All newly detected disks are automatically brought online.

    OfflineShared

    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

    All newly detected disks are left offline.

    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 3.c.
    3. Run the following command to change the SAN policy of the ECS to OnlineAll:

      san policy=onlineall