OpenstackZedGlance部署实现
系统环境: UbuntuServer 22.04 LTS Mini
一: 设定Glance相关信息root@srv1:~(keystone)# openstack user create --domain default --project service --password servicepassword glance +---------------------+----------------------------------+ | Field | Value | +---------------------+----------------------------------+ | default_project_id | 4fabd4d8316c40a398d6496c0a733caf | | domain_id | default | | enabled | True | | id | 37fbc0869121415785509976bba657a5 | | name | glance | | options | {} | | password_expires_at | None | +---------------------+----------------------------------+ root@srv1:~(keystone)# openstack role add --project service --user glance admin root@srv1:~(keystone)# openstack role assignment list --name +-------+----------------+-------+-----------------+--------+--------+-----------+ | Role | User | Group | Project | Domain | System | Inherited | +-------+----------------+-------+-----------------+--------+--------+-----------+ | admin | glance@Default | | service@Default | | | False | | admin | admin@Default | | admin@Default | | | False | | admin | admin@Default | | | | all | False | +-------+----------------+-------+-----------------+--------+--------+-----------+ root@srv1:~(keystone)# openstack service create --name glance --description "OpenStack Image service" image +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | OpenStack Image service | | enabled | True | | id | c7945ac7deb044a6b3219c456c454d86 | | name | glance | | type | image | +-------------+----------------------------------+ root@srv1:~(keystone)# openstack endpoint create --region RegionOne image public https://srv1.1000y.cloud:9292 +--------------+----------------------------------+ | Field | Value | +--------------+----------------------------------+ | enabled | True | | id | e9d0001142c04262bd276c041c053b5d | | interface | public | | region | RegionOne | | region_id | RegionOne | | service_id | c7945ac7deb044a6b3219c456c454d86 | | service_name | glance | | service_type | image | | url | https://srv1.1000y.cloud:9292 | +--------------+----------------------------------+ root@srv1:~(keystone)# openstack endpoint create --region RegionOne image internal https://srv1.1000y.cloud:9292 +--------------+----------------------------------+ | Field | Value | +--------------+----------------------------------+ | enabled | True | | id | fe634386a635461d98c86eb3ef66069b | | interface | internal | | region | RegionOne | | region_id | RegionOne | | service_id | c7945ac7deb044a6b3219c456c454d86 | | service_name | glance | | service_type | image | | url | https://srv1.1000y.cloud:9292 | +--------------+----------------------------------+ root@srv1:~(keystone)# openstack endpoint create --region RegionOne image admin https://srv1.1000y.cloud:9292 +--------------+----------------------------------+ | Field | Value | +--------------+----------------------------------+ | enabled | True | | id | 127171465d97440cae85a463d562bd38 | | interface | admin | | region | RegionOne | | region_id | RegionOne | | service_id | c7945ac7deb044a6b3219c456c454d86 | | service_name | glance | | service_type | image | | url | https://srv1.1000y.cloud:9292 | +--------------+----------------------------------+ root@srv1:~(keystone)# openstack catalog show image +-----------+-------------------------------------------+ | Field | Value | +-----------+-------------------------------------------+ | endpoints | RegionOne | | | admin: https://srv1.1000y.cloud:9292 | | | RegionOne | | | public: https://srv1.1000y.cloud:9292 | | | RegionOne | | | internal: https://srv1.1000y.cloud:9292 | | | | | id | c7945ac7deb044a6b3219c456c454d86 | | name | glance | | type | image | +-----------+-------------------------------------------+
二: 创建Glance数据库root@srv1:~(keystone)# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or g. Your MariaDB connection id is 38 Server version: 10.6.7-MariaDB-2ubuntu1.1 Ubuntu 22.04 Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type "help;" or "h" for help. Type "c" to clear the current input statement. MariaDB [(none)]> create database glance; Query OK, 1 row affected (0.001 sec) MariaDB [(none)]> grant all privileges on glance.* to glance@"localhost" identified by "password"; Query OK, 0 rows affected (0.018 sec) MariaDB [(none)]> grant all privileges on glance.* to glance@"%" identified by "password"; Query OK, 0 rows affected (0.023 sec) MariaDB [(none)]> flush privileges; Query OK, 0 rows affected (0.002 sec) MariaDB [(none)]> exit Bye root@srv1:~(keystone)#
三: 安装及配置Glance1) 安装Glance root@srv1:~(keystone)# apt install glance -y 2) 配置Glance API root@srv1:~(keystone)# mv /etc/glance/glance-api.conf /etc/glance/glance-api.conf.bak root@srv1:~(keystone)# vim /etc/glance/glance-api.conf [DEFAULT] bind_host = 127.0.0.1 transport_url = rabbit://openstack:password@srv1.1000y.cloud [glance_store] stores = file,http default_store = file filesystem_store_datadir = /var/lib/glance/images/ [database] connection = mysql+pymysql://glance:password@srv1.1000y.cloud/glance [keystone_authtoken] www_authenticate_uri = https://srv1.1000y.cloud:5000 auth_url = https://srv1.1000y.cloud:5000 memcached_servers = srv1.1000y.cloud:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = glance password = servicepassword insecure = true [paste_deploy] flavor = keystone root@srv1:~(keystone)# chmod 640 /etc/glance/glance-api.conf root@srv1:~(keystone)# chown root.glance /etc/glance/glance-api.conf root@srv1:~(keystone)# su -s /bin/bash glance -c "glance-manage db_sync" 2022-10-24 16:30:42.719 11362 INFO alembic.runtime.migration [-] Context impl MySQLImpl. 2022-10-24 16:30:42.720 11362 INFO alembic.runtime.migration [-] Will assume non-transactional DDL. 2022-10-24 16:30:42.733 11362 INFO alembic.runtime.migration [-] Context impl MySQLImpl. 2022-10-24 16:30:42.733 11362 INFO alembic.runtime.migration [-] Will assume non-transactional DDL. INFO [alembic.runtime.migration] Context impl MySQLImpl. INFO [alembic.runtime.migration] Will assume non-transactional DDL. INFO [alembic.runtime.migration] Running upgrade -> liberty, liberty initial ...... ...... ...... ...... ...... ...... Database is synced successfully. root@srv1:~(keystone)# systemctl restart glance-api && systemctl enable glance-api 3) 配置Nginx Porxy root@srv1:~(keystone)# vim /etc/nginx/nginx.conf ...... ...... ...... ...... ...... ...... stream { upstream glance-api { server 127.0.0.1:9292; } server { listen srv1.1000y.cloud:9292 ssl; proxy_pass glance-api; } ssl_certificate "/etc/ssl/private/zed.crt"; ssl_certificate_key "/etc/ssl/private/zed.key"; } root@srv1:~(keystone)# systemctl restart nginx
四: 下载镜像并设定1) 下载镜像 root@srv1:~(keystone)# wget http://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img 2) 更改镜像设定 root@srv1:~(keystone)# modprobe nbd root@srv1:~(keystone)# qemu-nbd --connect=/dev/nbd0 ubuntu-22.04-server-cloudimg-amd64.img root@srv1:~(keystone)# mount /dev/nbd0p1 /mnt root@srv1:~(keystone)# chroot /mnt /bin/bash root@srv1:/# vim /etc/cloud/cloud.cfg ...... ...... ...... ...... ...... ...... disable_root: true # 于13行,添加如下内容 ssh_pwauth: true ...... ...... ...... ...... ...... ...... # System and/or distro specific settings # (not accessible to handlers/transforms) system_info: # This will affect which distro class gets used distro: ubuntu # Default user name + that default users groups (if added/used) default_user: # 更改102行的值 name: snow # 更改103行的值 lock_passwd: False # 更改104行的值 gecos: snow groups: [adm, audio, cdrom, dialout, dip, floppy, lxd, netdev, plugdev, sudo, video] sudo: ["ALL=(ALL) NOPASSWD:ALL"] shell: /bin/bash ...... ...... ...... ...... ...... ...... root@srv1:/# adduser snow Adding user `snow" ... Adding new group `snow" (1000) ... Adding new user `snow" (1000) with group `snow" ... Creating home directory `/home/snow" ... Copying files from `/etc/skel" ... New password: # 设定密码 Retype new password: passwd: password updated successfully Changing the user information for snow Enter the new value, or press ENTER for the default Full Name []: # 回车 Room Number []: # 回车 Work Phone []: # 回车 Home Phone []: # 回车 Other []: # 回车 Is the information correct? [Y/n] y root@srv1:/# exit root@srv1:~(keystone)# umount /mnt root@srv1:~(keystone)# qemu-nbd --disconnect /dev/nbd0p1 /dev/nbd0p1 disconnected
五: 将镜像添加至Glanceroot@srv1:~(keystone)# openstack image create "us2204" --file ubuntu-22.04-server-cloudimg-amd64.img --disk-format qcow2 --container-format bare --public +------------------+------------------------------------------------------- | Field | Value +------------------+------------------------------------------------------- | container_format | bare | created_at | 2022-10-24T08:51:03Z | disk_format | qcow2 | file | /v2/images/e1f0e4a7-26a6-4357-8358-9b35a76e3a9b/file | id | e1f0e4a7-26a6-4357-8358-9b35a76e3a9b | min_disk | 0 | min_ram | 0 | name | us2204 | owner | 994a4a3e0fbc4f5891f38470e158e6b4 | properties | os_hidden="False", owner_specified.openstack.md5="".. | protected | False | schema | /v2/schemas/image | status | queued | tags | | updated_at | 2022-10-24T08:51:03Z | visibility | public +------------------+------------------------------------------------------- root@srv1:~(keystone)# openstack image list +--------------------------------------+--------+--------+ | ID | Name | Status | +--------------------------------------+--------+--------+ | e1f0e4a7-26a6-4357-8358-9b35a76e3a9b | us2204 | active | +--------------------------------------+--------+--------+
外媒苹果先买后付服务将评估购物者资质环球网科技综合报道2月16日消息,据外媒报道,苹果公司正在针对即将推出的先买后付服务制定实施细则。外媒称,苹果将根据购物者的消费历史,以及他们拥有的苹果设备来评估其资质。同时,苹果
打死也要记住的Spring中9种设计模式!!!作者iCoding91来源httpt。csdn。cnMxOO5目录1。简单工厂(非23种设计模式中的一种)2。工厂方法3。单例模式4。适配器模式5。装饰器模式6。代理模式7。观察者
人这辈子,最大的自律不是早睡早起,而是逼着自己做好这两件事图来自网络,侵权请联系删除人因自律而自由,因自律而强大。但凡能够获得成功过得幸福的人,都是坚持自律的王者。只不过自律并不是我们想象的,非要规定自己几点起床,非要跑步多少公里。每个人
有一种期待,叫望眼欲穿,有一种深情,叫念念不忘头条创作挑战赛我走过万水千山,你依然是我心里最牵挂的人,时光悠悠,淡去了多少哀愁,唯有你藏在我的心里,永远都是那么清晰,我最放不下的人,永远都是你。有一种期待,叫望眼欲穿,有一种深
早安,置之不理才是一种智慧,做好自己,让别人说去吧自卑的本质是不客观,也可以称之为缺乏自我。凡事对自己的判断没有信心,做人容易耳软心活,人云亦云,主管情绪大于客观认知判断能力。坚定内心,放弃自卑,建立自信。祝愿所有有自卑特征的人,
特别的日子写给你特别的日子写给你作者水仙编辑秋枫亲,我一直假装你没有离去所以,我一直在忍,在期盼中隐忍今天,情人节一个特别的日子我再一次念你是否,你还会想起我今天,谁又陪在你身边一起度过让快乐的风
艾玛医疗科技荣获ISO9001和ISO27001双体系认证日前,艾玛医疗科技正式通过ISO9001质量管理体系认证和ISO27001信息安全管理体系认证,标志着艾玛医疗科技在质量管理和信息安全管理方面达到了国际化标准水平。ISO9001质
面板多股走高!行业新一轮涨价潮再起二季度需求或强势反弹科创板日报2月15日讯(编辑郑远方)今早,面板板块开盘走强。截至午间,华映科技彩虹股份涨停封板TCL科技宇顺电子京东方A涨超5莱特光电维信诺深天马A等跟涨。实际上,近一周以来已有多
事关你的钱袋子!个税汇算今年有这些变化国家税务总局近日发布公告,2022年度个人所得税综合所得汇算清缴办理时间为2023年3月1日至6月30日。值得注意的是,今年公告有这些变化在可享受的税前扣除部分,增加了3岁以下婴幼
伯克希尔四季度持仓重仓苹果抛售金融股周二美股盘后,美国证券交易委员会(SEC)披露了股神巴菲特旗下伯克希尔哈撒韦截至2022年12月31日的持仓报告(13F),其间共增持3家公司,减持8家公司,股票市值为2990。0
不必恐高,满仓满融继续看多午评不必恐高,满仓满融继续看多。在经历昨天短暂的洗盘以后,上证指数早盘再度冲破3300点,但这不是行情的结束,而上涨也将持续,神机继续满仓满融持续看多做多。说一下我的看法,供各位参