Configure bare metal storage

Create a cloud disk

You can perform this task if bare metal interoperates with a storage service, for example, ONEStor iSCSI. For information about how to create a cloud disk, see "Create a cloud host."

When you create a cloud disk, make sure the storage AZ to which the cloud host belongs and the compute AZ to which the bare metal instance belongs are on the same compute node.

Attach or detach a cloud disk

Prerequisites

Procedure

  1. On the top navigation bar, click Cloud Services, and then select Cloud Disks from the Storage menu.

  1. Click Attach to Bare Metal or Detach from Bare Metal in the Actions column for a cloud disk. Make sure the storage AZ to which the cloud disk belongs and the compute AZ to which the bare metal instance belongs are on the same compute node.

  1. On the top navigation bar, click Cloud Services, and then select Bare Metal from the Compute menu.

  1. Click a bare metal name to access the details page.

  1. To attach a cloud disk, select Disk Settings, click Attach Disk, and then select a cloud disk instance.

  1. To detach a cloud disk, access the Disk Settings page.

To attach or detach a cloud disk, you must access the operating system of a bare metal instance to install the required software package after you install that bare metal instance. The following tasks use ONEStor iSCSI as an example.

Remove the old volume agent software package

  1. Stop the volume agent service.

# systemctl stop h3cloudos-volume-agent.service

  1. Delete the rpm package.

# rpm -e h3cloudos_volume_agent

  1. Delete the remnant data.

# cd /usr/lib/python2.7/site-packages/

# ll

total 48K

drwxr-xr-x  3 root root 4.0K Feb 13 17:56 bondnictool

-rw-r--r--  1 root root  219 Feb 13 17:56 bondnictool-1.0-py2.7.egg-info

-rw-r--r--. 1 root root  126 Jan  1  2022 easy_install.py

-rw-r--r--. 2 root root  315 Jan  1  2022 easy_install.pyc

-rw-r--r--. 2 root root  315 Jan  1  2022 easy_install.pyo

drwxr-xr-x  3 root root 4.0K Feb 15 13:56 h3cloudos_volume_agent

drwxr-xr-x  2 root root 4.0K Feb 15 13:56 h3cloudos_volume_agent-1.0.0-py2.7.egg-info

drwxr-xr-x. 4 root root 4.0K Nov 11 16:14 pip

drwxr-xr-x. 2 root root 4.0K Nov 11 16:14 pip-20.2.2.dist-info

drwxr-xr-x. 4 root root 4.0K Nov 11 16:14 pkg_resources

drwxr-xr-x. 5 root root 4.0K Nov 11 16:14 setuptools

drwxr-xr-x. 2 root root 4.0K Nov 11 16:14 setuptools-44.1.1.dist-info

# rm -rf h3cloudos_volume_agent*

Install a new volume agent software package

The following uses a CentOS 7.8 operating system as an example. If you use another type of operating system, follow the instructions provided by that operating system to install a new volume agent sofware package. The volume_agent runs in Python 2.7.

  1. Identify whether the iscsi-initiator-utils software package has been installed, enable the iSCSI service and set it to start automatically.

  # rpm -qa | grep iscsi-initiator-utils  //If the following information is displayed, the iscsi-initiator-utils software package has been installed.

  iscsi-initiator-utils-6.2.0.874-20.el7_9.x86_64

iscsi-initiator-utils-iscsiuio-6.2.0.874-20.el7_9.x86_64

# systemctl enable iscsi.service  //Enable the iSCSI service and set it to start automatically.

# systemctl enable iscsid.service

  1. Identify whether the multipath software package has been installed, enable the multipath service and set it to start automatically.

  # rpm -qa | grep multi    //If the following information is displayed, the multipath software package has been installed.

device-mapper-multipath-libs-0.4.9-134.el7_9.x86_64

device-mapper-multipath-0.4.9-134.el7_9.x86_64

# /usr/sbin/mpathconf --enable  // Enable the multipath service and set it to start automatically.

# systemctl enable multipathd.service

  1. Decompress and install the software package.

     # tar zxvf h3cloudos_volume_agent-2.0.1.tar.gz

      # cd h3cloudos_volume_agent-2.0.1

      # python setup.py install

  1. Start the service.

      # systemctl start h3cloudos-volume-agent.service