Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Deploy the Stein version of OpenStack (with Ceph storage section) using Kolla

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

This is my Wechat. If you have any questions, you can add communication.

And in the introduction of Kolla here do not elaborate too much, there are many documents on the Internet. This article is mainly aimed at the latest version of Kolla to solve the problem that a single node cannot deploy ceph-osd (it is found that multiple nodes cannot deploy Ceph-osd during testing). In the latest version of kolla, the official website has announced the removal of Ceph, as shown below:

This article will solve the problem that kolla-ansible cannot be deployed by modifying the ceph source code.

The specific process of deployment is as follows:

1. Prepare work 1.1 to install the Centos7.5 system, the process is brief. I use virtualbox to create a virtual machine and use two network cards. The first is the management network, which can access the public network, and the second is that the instance uses the network, which can be started without the need to configure IP. [root@openstack ~] # cat / etc/centos-releaseCentOS Linux release 7.5.1804 (Core) 1.2 turn off the firewall, Set selinux [root@localhost ~] # systemctl disable firewalld [root@localhost ~] # systemctl stop firewalld [root@localhost ~] # getenforce Disabled1.3 restart machine [root@localhost ~] # reboo71.4 set hostname [root@localhost ~] # hostnamectl set-hostname openstack [root@localhost ~] # cat / etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.137.2 openstack1.5 configuration DNS [ Root@openstack ~] # cat / etc/resolv.confnameserver 114.114.114.1141.6 add Ali YumSource [root@openstack ~] # rm-rfv * / etc/yum.repos.d/* [root@openstack ~] # curl-o / etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo2. Basic system configuration 2.1 installation common tools [root@openstack ~] # yum install vim bash-completion net-tools2.2 installation epel [root @ openstack ~] # yum install epel-release2.3 installation depends on [root@openstack ~] # yum install python-devel libffi-devel gcc openssl-devel libselinux-python-y2.4 installation pip[ root @ openstack ~] # yum install python-pip2.5 configuration pip Use Ali source [root@openstack ~] # mkdir ~ / .pip [root@openstack ~] # vim ~ / .pip/pip.conf [global] index-url = https://mirrors.aliyun.com/pypi/simple/[install]trusted-host=mirrors.aliyun.com2.6 to update pip [root@openstack ~] # pip install-U pip3. Install docker3.1 to add docker source, use Ali source [root@openstack ~] # yum install-y yum-utils device-mapper-persistent-data lvm2 [root@openstack ~] # yum-config-manager-- add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo3.2 install docker [root @ openstack ~] # yum- y install docker-ce3.3 configure docker Use Ali accelerator [root@openstack ~] # mkdir-p / etc/docker/ [root@openstack ~] # vim / etc/docker/daemon.json {"registry-mirrors": ["https://fl791z1h.mirror.aliyuncs.com"]}3.4 add kolla.conf [root@openstack ~] # mkdir-p / etc/systemd/system/docker.service.d/ [root@openstack ~] # vim / etc/systemd/system/docker.service.d/kolla.conf [Service MountFlags=shared3.5 starts docker [root @ openstack ~] # systemctl daemon-reload [root@openstack ~] # systemctl enable docker [root@openstack ~] # systemctl start docker4. Install ansible4.1 install Ansible [openstack ~] # yum install ansible4.2 configure ansible [root@openstack ~] # vim / etc/ansible/ansible.cfg [defaults] host_key_checking=Falsepipelining=Trueforks=1005. Install kolla-ansible5.1 installation dependency

Kolla is divided into two repositories, one is https://github.com/openstack/kolla and the other is https://github.com/openstack/kolla-ansible. There are requirements.txt files in these two repositories, and the dependencies need to be installed.

[root@openstack] # vim 1.txt pbricks 2.1.0, > = 2.0.0 # Apache-2.0docker > = 2.4.2 # Apache-2.0Jinja2 > = 2.8 # BSD License (3 clause) GitPython > = 1.0.1 # BSD License (3 clause) six > = 1.10.0 # MIToslo.config > = 5.1.0 # Apache-2.0oslo.utils > = 3.33.0 # ApacheML 2.0 setuptools24.0. 0. ! = 34.1.0 BSD, 34.1.1, 34.2.0, 34.3.0, 34.3.1, 34.3.2, 36.2.0, > = 21.0 # PSF/ZPLnetaddr > 0.7.18 # BSD [root@openstack ~] # vim 2.txt pbrication 2.1.0 > = 2.0.0 # Apache-2.0docker > = 2.4.2 # Apache-2.0Jinja2 > = 2.10 # BSD License (3 clause) six > = 1.10.0 # MIToslo.config > = 5.2.0 # Apache-2.0oslo.utils > = 3.33.0 # Apache 2.0setuptools24.0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 1. 4. 2. 4. 3. 4. 0. 0. 4. 0. 0. 4. 0. 0. 4. 0. 0. 4. 0. 0. 4. 0. 0. 4. 0. 0. 4. 0. 0. 4. 0. 4. 0. 0. 4. 0. 0. 4. 0. 0. 4. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0 ! = 34.3.2 # PSF/ZPLPyYAML 36.2.0, > = 21.0.0 # MITnetaddr > = 3.12 # MITnetaddr > = 0.7.18 # BSDcryptography > = 2.1 # BSD/Apache-2.0jmespath > = 0.9.3 # MIT

The above two files are copied from my new requirements.txt directly and can be installed directly.

Root@openstack ~] # pip install-r 1.txt DEPRECATION: Python 2.7will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-supportLooking in indexes: https://mirrors.aliyun.com/pypi/simple/Requirement already satisfied: Pbrication 2.1.0 > = 2.0.0 in / usr/lib/python2.7/site-packages (from-r 1.txt (line 1)) (5.4.2) Requirement already satisfied: docker > = 2.4.2 in / usr/lib/python2.7/site-packages (from-r 1.txt (line 2)) (4.0.2) Requirement already satisfied: Jinja2 > = 2.8in / usr/lib64/python2.7/site-packages (from-r 1.txt (line 3)) (2.10.1) Requirement already satisfied: GitPython > = 1.0.1 in / usr/lib/python2.7/site-packages (from-r 1.txt (line 4)) (3.0.2) ERROR: Package 'GitPython' requires a different Python: 2.7.5 not in' > = 3.0 ! = 3.0.percent,! = 3.1.percent,! = 3.2.percent,! = 3.3.percent'

During installation, you will be prompted that GitPython cannot be installed. You can use pip to specify GitPython for installation.

[root@openstack ~] # pip install GitPython==3.0.2

Install the second dependency

[root@openstack ~] # pip install-r 2.txt5.2 install kolla-ansible [root@openstack ~] # pip install kolla-ansible

The following error occurs when installing kolla-ansible

ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

As a workaround, ignore PyYAML when installing kolla-ansible

[root@openstack] # pip install kolla-ansible-- ignore-installed PyYAML5.3 installs Kolla [root @ openstack ~] # pip install kolla6. Configure kolla-ansible6.1 to create a kolla directory, copy globals.yml,passwords.yml [root@openstack ~] # mkdir-p / etc/kolla/ [root@openstack ~] # cp / usr/share/kolla-ansible/etc_examples/kolla/* / etc/kolla/6.2 because this environment is deployed in virtual machines Therefore, the type of virt_type is set to qemu [root@openstack ~] # mkdir-p / etc/kolla/config/nova/ [root@openstack ~] # vim / etc/kolla/config/nova/nova-compute.conf [libvirt] virt_type = none6.3 configuration ceph.conf, the number of device ceph replicas. This environment is one node, three OSD disks, and the set copy is 1. If it is three nodes, 9OSD disks, the copy is 3. [root@openstack ~] # vim / etc/kolla/config/ ceph.confi [global] osd pool default size = 1osd pool default min size = 16.4Configuring globals.yml [root@openstack ~] # cat / etc/kolla/globals.yml | grep-v ^ # kolla_base_distro: "centos" kolla_install_type: "source" openstack_release: "stein" kolla_internal_vip_address: "192.168.137.254" docker_registry: "registry. Cn-hangzhou.aliyuncs.com "docker_namespace:" openstackbl "network_interface:" enp0s3 "neutron_external_interface:" enp0s8 "neutron_plugin_agent:" linuxbridge "enable_ceph:" yes "ceph_osd_store_type:" bluestore "enable_ceph_rgw:" yes "enable_cinder:" yes "enable_neutron_qos:" yes "enable_ceph_rgw_keystone:" yes "glance_backend_ceph:" yes "glance_enable_rolling_. Upgrade: "no" cinder_backend_ceph: "{{enable_ceph}}" nova_backend_ceph: "{{enable_ceph}}" ironic_dnsmasq_dhcp_range:tempest_image_id:tempest_flavor_ref_id:tempest_public_network_id:tempest_floating_network_name:

In the above configuration, I used the docker warehouse I built on Ali. The image inside is from docker's official website push. This warehouse is a private warehouse, if you need to use it, please contact the author.

Note: if there are other openstack deployed using Kolla in the network where this environment is located, you need to modify the

# keepalived_virtual_router_id: "51"

Change 51 to an integer between 1 and 99.

7 deploy openstack7.1. This environment uses Ceph as backend storage. You need to add disks and do OSD. And modify the hard disk label [root@openstack ~] # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 200G 0 disk ├─ sda1 8:1 0 1G 0 part / boot └─ sda2 8:2 0199G 0 part ├─ centos-root 253 sda2 00150G 0 lvm / ├─ centos-swap 253 lvm [SWAP] └─ centos -home 253 homesdb 2 0 41.1 G 0 lvm / homesdb 8:16 0 100G 0 disk sdc 8:32 0 100G 0 disk sdd 8:48 0 100G 0 disk

You can see that there are three blank disks. Modify the label of these three disks.

[root@openstack ~] # parted / dev/sdb-s-- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP 1-1 [root@openstack ~] # parted / dev/sdc-s-mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP 1-1 [root@openstack] # parted / dev/sdd-s-mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP 1-1 [root@openstack ~] # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 200G 0 disk ├─ sda1 8:1 0 1G 0 part / boot └─ sda2 8:2 0 199G 0 part ├─ centos-root 253:0 0 150G 0 lvm / ├─ centos-swap 253:1 0 7.9G 0 lvm [SWAP] └─ centos-home 253:2 0 41.1G 0 lvm / homesdb 8:16 0 100G 0 disk └─ sdb1 8:17 0 100G 0 part sdc 8:32 0 100G 0 disk └─ sdc1 8:33 0100G 0 part sdd 8:48 0100G 0 disk └─ sdd1 8:49 0100G 0 part 7.2 generate openstack password [root@openstack ~] # kolla-genpwd7.3 pull image [root@openstack ~] # kolla-ansible pull.PLAY RECAP * * * * * localhost: ok=40 changed=0 unreachable=0 failed=0 skipped=77 rescued=0 ignored=0

Pull succeeded when prompted above. If there is a problem in pull, you can leave a message in the comments.

7.4 check Kolla [root@openstack ~] # kolla-ansible prechecksPLAY RECAP * * * localhost: ok=102 changed=0 unreachable=0 failed=0 skipped=147 rescued=0 ignored=0

Prechecks succeeded when prompted above. If you encounter any problems during the inspection, please leave a message in the comments section.

7.5 deploy Kolla [root@openstack ~] # kolla-ansible deploy-vvvTASK [ceph: Enable ceph dashboard] * * * task path: / usr/share/kolla-ansible/ansible/roles/ceph/tasks/start_ceph_dashboard.yml:2 ESTABLISH LOCAL CONNECTION FOR USER: root EXEC / bin/sh-c 'echo ~ root & & sleep 0' EXEC / bin/sh-c' (umask 77 & & mkdir-p "`echo / root/.ansible/tmp / ansible-tmp-1567411390.78-165388867051828` "& & echo ansible-tmp-1567411390.78-165388867051828 =" `echo / root/.ansible/tmp/ansible-tmp-1567411390.78-165388867051828` ") & & sleep 0'Using module file / usr/lib/python2.7/site-packages/ansible/modules/commands/command.py PUT / root/.ansible/tmp/ansible-local-7809exM0Cg/tmpteinHV TO / root/.ansible/tmp/ansible-tmp-1567411390.78-165388867051828/AnsiballZ_command.py EXEC / bin/sh-c 'chmod uplix / root/.ansible/tmp/ansible-tmp-1567411390.78-165388867051828 / / root/.ansible/tmp/ansible-tmp-1567411390.78-165388867051828/AnsiballZ_command.py & & sleep 0' EXEC / bin/sh-c' / usr/bin/python / root/.ansible/tmp/ansible-tmp-1567411390.78-165388867051828/AnsiballZ_command.py & & sleep 0' EXEC / bin/sh-c'rm-f-r / root/.ansible/tmp/ Ansible-tmp-1567411390.78-165388867051828 / > dev/null 2 > & 1 & & sleep 0'fatal: [localhost]: FAILED! = > {"changed": false "cmd": ["docker", "exec", "ceph_mon", "ceph", "mgr", "module", "enable", "dashboard"], "delta": "0exec 00.990347", "end": "2019-09-02 04VOD 11.952770" "invocation": {"module_args": {"_ raw_arams": "docker exec ceph_mon ceph mgr module enable dashboard", "_ uses_shell": false, "argv": null, "chdir": null, "creates": null, "executable": null, "removes": null "stdin": null, "stdin_add_newline": true, "strip_empty_ends": true, "warn": true}}, "msg": "non-zero return code", "rc": 2, "start": "2019-09-02 04stdin_add_newline 03Switzerland 10.962423" "stderr": "Error ENOENT: all mgr daemons do not support module 'dashboard', pass-- force to force enablement", "stderr_lines": ["Error ENOENT: all mgr daemons do not support module' dashboard', pass-- force to force enablement"], "stdout": " "stdout_lines": []} NO MORE HOSTS LEFT * * PLAY RECAP * * localhost: ok=194 changed=111 unreachable=0 failed=1 skipped=105 rescued=0 ignored=0

Add the-vvv parameter to debug during deployment. The above error is prompted when deploying this step, and the deployment is interrupted. Solution:

[root@openstack ~] # vim / usr/share/kolla-ansible/ansible/roles/ceph/tasks/start_ceph_dashboard.yml-name: Enable ceph dashboard become: true command: docker exec ceph_mon ceph mgr module enable dashboard-force changed_when: false run_once: true

Add-- force at the end of the command to solve this problem.

Uninstall the container you just deployed, and then redeploy:

[root@openstack] # kolla-ansible destroy-- yes-i-really-really-mean-itDestroy Kolla containers, volumes and host configuration: ansible-playbook-I / usr/share/kolla-ansible/ansible/inventory/all-in-one-e @ / etc/kolla/globals.yml-e @ / etc/kolla/passwords.yml-e CONFIG_DIR=/etc/kolla / usr/share/kolla-ansible/ansible/destroy.yml [DEPRECATION WARNING]: The TRANSFORM_INVALID_GROUP_CHARS settings is set to allow bad characters in group names by default, this will change But still be user configurable on deprecation. This feature will be removed in version 2.10. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. [WARNING]: Invalid characters were found in group names but not replaced Use-vvvv to see detailsPLAY [Apply role destroy] * * * TASK [Gathering Facts] * * ok: [localhost] TASK [destroy: include_tasks] * * * included: / usr/share/kolla-ansible/ansible/ Roles/destroy/tasks/validate_docker_execute.yml for localhostTASK [destroy: Ensure the docker service is running] * * changed: [localhost] TASK [destroy: include_tasks] * * included: / usr/share/kolla-ansible/ansible/roles/destroy/tasks/cleanup_containers.yml for localhostTASK [destroy: Destroying all Kolla containers and volumes] * * changed: [localhost] TASK [destroy: include_tasks] * * * included: / usr/share/kolla-ansible/ansible/roles/destroy/tasks/cleanup_images.yml for localhostTASK [destroy: Removing Kolla images] * * skipping: [localhost] TASK [destroy: include_tasks] * * included: / usr/share/kolla-ansible/ansible/roles/destroy/tasks/cleanup_host.yml for localhostTASK [destroy: Destroying Kolla host configuration] * * changed: [localhost] PLAY RECAP * * localhost: ok=8 changed=3 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 [root@openstack ~] # [root@openstack ~] # kolla-ansible deploy-vvv

During the deployment process, we can see feedback that the tasks related to ceph-osd were not performed correctly, as shown in the figure above. At this point, we can use the ceph osd tree command to see

[root@openstack ~] # docker exec ceph_mon ceph osd treeID CLASS WEIGHT TYPE NAME STATUS REWEIGHT PRI-AFF-1 0 root default [root@openstack ~] # docker exec ceph_mon ceph dfRAW STORAGE: CLASS SIZE AVAIL USED RAW USED% RAW USED TOTAL 0 B 0 POOLS: POOL ID STORED OBJECTS USED USED MAX AVAIL .rgw.root 1 0 B 0 0 B 0 0 B images 20 B 0 0 B 0 0 B volumes 3 0 B 0 0 B 0 0 B backups 4 0 B 0 0 B 0 0 B

By looking at it, we know that there is currently no osd running in the ceph cluster.

After waiting for a period of time, the deployment was completed and no error was reported.

PLAY [Apply role blazar] * * * skipping: no hosts matchedPLAY RECAP * * localhost: ok=411 changed=234 unreachable=0 failed=0 skipped=238 rescued=0 ignored=0 [root@openstack ~] #

After a little more than ten minutes, the openstack deployment was completed, and the report was correct.

7.6 generate admin-openrc.sh [root@openstack ~] # kolla-ansible post-deploy7.7 upload image

Ceph is stored as glance, and the image format is raw, as follows

[root@openstack ~] # yum install qemu-img-y [root@openstack ~] # qemu-img convert-f qcow2-O raw cirros-0.3.4-x86_64-disk.img cirros.raw [root@openstack ~] # source / etc/kolla/admin-openrc.sh [root@openstack ~] # glance image-create-name cirros--disk-format raw-container-format bare-- progress

< cirros.raw [========>

] 29%

When uploading to 29%, it cannot be uploaded. By looking up the reason, it is concluded that glance uses Ceph as the back-end storage, and the free space is zero. Here is the log and ceph status of glance.

2019-09-02 04 4129-a853 24 WARNING glance_store._drivers.rbd [req-7ee511be-930b-4e41-9c08-e1a90c375fe2 1148205e534a4832ba8700ea8b410534 d722008e46fa4ef799c68c766b26781b-default default] since image size is zero we will be doing resize-before-write for each chunk which will be considerably slower than normal [root@openstack] # docker exec ceph_mon ceph-s cluster: id: 055889bd-64a5-4129-a853-340d82bcddc5 health: HEALTH_WARN Reduced data availability: 40 pgs inactive services: mon: 1 daemons Quorum 192.168.137.2 (age 14m) mgr: localhost (active, since 14m) osd: 0 osds: 0 up, 0 in data: pools: 5 pools, 40 pgs objects: 0 objects, 0B usage: 0B used, 0B / 0 B avail pgs: 100.000% pgs unknown 40 unknown [root@openstack ~] #

You can see that the pg of ceph belongs to the unknown state, indicating that this ceph cluster cannot be used.

8. Modify the kolla-ansible source code 8.1 before modifying the source code We uninstall [root@openstack] # kolla-ansible destroy-- yes-i-really-really-mean-itDestroy Kolla containers from the deployed clusters. Volumes and host configuration: ansible-playbook-I / usr/share/kolla-ansible/ansible/inventory/all-in-one-e @ / etc/kolla/globals.yml-e @ / etc/kolla/passwords.yml-e CONFIG_DIR=/etc/kolla / usr/share/kolla-ansible/ansible/destroy.yml [DEPRECATION WARNING]: The TRANSFORM_INVALID_GROUP_CHARS settings is set to allow bad characters in group names by default, this will change, but still be user configurable on deprecation. This feature will be removed in version 2.10. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. [WARNING]: Invalid characters were found in group names but not replaced Use-vvvv to see detailsPLAY [Apply role destroy] * * * TASK [Gathering Facts] * * ok: [localhost] TASK [destroy: include_tasks] * * * included: / usr/share/kolla-ansible/ansible/ Roles/destroy/tasks/validate_docker_execute.yml for localhostTASK [destroy: Ensure the docker service is running] * * changed: [localhost] TASK [destroy: include_tasks] * * included: / usr/share/kolla-ansible/ansible/roles/destroy/tasks/cleanup_containers.yml for localhostTASK [destroy: Destroying all Kolla containers and volumes] * * changed: [localhost] TASK [destroy: include_tasks] * * * included: / usr/share/kolla-ansible/ansible/roles/destroy/tasks/cleanup_images.yml for localhostTASK [destroy: Removing Kolla images] * * skipping: [localhost] TASK [destroy: include_tasks] * * included: / usr/share/kolla-ansible/ansible/roles/destroy/tasks/cleanup_host.yml for localhostTASK [destroy: Destroying Kolla host configuration] * * changed: [localhost] PLAY RECAP * * localhost: ok=8 changed=3 unreachable=0 failed=0 skipped=1 rescued=0 ignored=08.2 modifies bootstrap_osds.yml

Modify lines 6, 19

[root@openstack ~] # vim / usr/share/kolla-ansible/ansible/roles/ceph/tasks/bootstrap_osds.yml-a "partition_name='KOLLA_CEPH_OSD_BOOTSTRAP' match_mode='prefix' use_udev= {{kolla_ceph_use_udev}}"-a "partition_name='KOLLA_CEPH_OSD_CACHE_BOOTSTRAP' match_mode='prefix' use_udev= {{kolla_ceph_use_udev}}"

Comment 39-42 lines, comment 100-102 lines. Add after lines 42 and 102

#-not item.external_journal | bool#-item.device.split ('/') [2] in ansible_devices # if there is no device in setup (like loopback We don't need to warn user#-ansible_devices [item.device.split ('/') [2]] .partitions | count > parties-ceph_osd_wipe_disk! = "yes-i-really-really-mean-it"-item.external_journal | bool = = False-ansible_devices [item.device.split ('/') [2]] .partitions | count > 1-ceph_osd_wipe_disk! = "yes-i-really-really-mean -it "#-not item.external_journal | bool#-ansible_devices [item.device.split ('/') [2]] .partitions | count > requests-ceph_osd_wipe_disk! =" yes-i-really-really-mean-it "- item.external_journal | bool = = False-ansible_devices [item.device.split ('/') [2]] .partitions | count > 1-ceph_osd_wipe_ Disk! = "yes-i-really-really-mean-it" 8.3 modify start_osds.yml

Modify the sixth line

[root@openstack ~] # vim / usr/share/kolla-ansible/ansible/roles/ceph/tasks/start_osds.yml-a "partition_name='KOLLA_CEPH_DATA_BS' match_mode='prefix' use_udev= {{kolla_ceph_use_udev}}" 9. Redeploy openstack

Execute deployment command

[root@openstack ~] # kolla-ansible deploy-vvv

Check whether osd is not started during deployment, as shown below

As you can see from the task, the OSD disk has been created successfully. You can view the osd container and ceph status with the following command

[root@openstack ~] # docker ps | grep ceph3b765534475d registry.cn-hangzhou.aliyuncs.com/openstackbl/centos-source-ceph-rgw:stein "dumb-init-- single- …" About a minute ago Up About a minute ceph_rgw7b326a2844f2 registry.cn-hangzhou.aliyuncs.com/openstackbl/centos-source-ceph-osd:stein "dumb-init-- single-..." About a minute ago Up About a minute ceph_osd_26abde420cd43 registry.cn-hangzhou.aliyuncs.com/openstackbl/centos-source-ceph-osd:stein "dumb-init-- single-..." About a minute ago Up About a minute ceph_osd_13576d8cf558c registry.cn-hangzhou.aliyuncs.com/openstackbl/centos-source-ceph-osd:stein "dumb-init-- single-..." About a minute ago Up About a minute ceph_osd_02658dfc87737 registry.cn-hangzhou.aliyuncs.com/openstackbl/centos-source-ceph-mgr:stein "dumb-init-- single-..." 2 minutes ago Up 2 minutes ceph_mgrc3a97ff4a395 registry.cn-hangzhou.aliyuncs.com/openstackbl/centos-source-ceph-mon:stein "dumb-init-single-..." 2 minutes ago Up 2 minutes ceph_ mon [root @ openstack ~] # docker exec-it ceph_mon ceph-s cluster: id: 055889bd-64a5-4129-a853-340d82bcddc5 health: HEALTH_WARN too few PGs per OSD (18

< min 30) services: mon: 1 daemons, quorum 192.168.137.2 (age 3m) mgr: localhost(active, since 3m) osd: 3 osds: 3 up (since 2m), 3 in (since 2m) rgw: 1 daemon active (radosgw.gateway) data: pools: 7 pools, 56 pgs objects: 219 objects, 1.2 KiB usage: 3.0 GiB used, 297 GiB / 300 GiB avail pgs: 56 active+clean[root@openstack ~]# 大概十几分钟后,openstack部署成功 PLAY [Apply role blazar] **************************************************************************************************************************************************skipping: no hosts matchedPLAY RECAP ****************************************************************************************************************************************************************localhost : ok=415 changed=237 unreachable=0 failed=0 skipped=234 rescued=0 ignored=0 至此ceph-osd创建成功。稍等片刻后,openstack部署成功后,接着下面的操作 10. 测试openstack10.1 上传镜像[root@openstack ~]# kolla-ansible post-deploy[root@openstack ~]# source /etc/kolla/admin-openrc.sh [root@openstack ~]# glance image-create --name cirros --disk-format raw --container-format bare --progress < cirros.raw [=============================>

] 100% "Property" + | Value | | | +-+- -+ | checksum | 56730d3091a764d5f8b38feeef0bfcef | | container_format | bare | | created_at | 2019-09-02T09:18:32Z | | disk_format | raw | | id | 07ab1c4e-d16d-4b55-b1f1-017a0699662e | | locations | [{"url": "rbd://" 055889bd-64a5-4129-a853-340d82bcddc5imagesUniverse 07ab1c4eMurd16d- | | 4b55-b1f1-017a0699662e/snap " "metadata": {}}] | | min_disk | 0 | | min_ram | 0 | | name | cirros | | os_hash_algo | sha512 | | os_hash_value | 34f5709bc2363eafe857ba1344122594a90a9b8cc9d80047c35f7e34e8ac28ef1e14e2e3c13d55a4 | 3b841f533435e914b01594f2c14dd597ff9949c8389e3006 | | | os_hidden | False | | owner | 544d94b977234b0295726b0c7163c3e8 | | protected | False | | | size | 41126400 | | status | active | | tags | [ ] | | updated_at | 2019-09-02T09:18:34Z | | virtual_size | Not available | | | visibility | shared | +-| -- + [root@openstack ~] #

You can see that the image can be uploaded successfully.

10.2 View the image in ceph [root@openstack ~] # docker exec ceph_mon rbd-p images ls07ab1c4e-d16d-4b55-b1f1-017a0699662e [root@openstack ~] # docker exec ceph_mon rbd-p images info 07ab1c4e-d16d-4b55-b1f1-017a0699662erbd image '07ab1c4e-d16d-4b55-b1f1-017a0699662eBelt: size 39 MiB in 5 objects order 23 (8 MiB objects) snapshot_count: 1 id: 11939304e103 block_name_prefix: rbd_data.11939304e103 format: 2 features: layering, exclusive-lock, object-map Fast-diff, deep-flatten op_features: flags: create_timestamp: Mon Sep 2 05:18:33 2019 access_timestamp: Mon Sep 2 05:18:33 2019 modify_timestamp: Mon Sep 2 05:18:33 2019 [root@openstack ~] #

You can see that the storage path of the mirror is ceph images pool.

11. Qrooma

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report