当前位置:   article > 正文

1+X操作题 OpenStack管理_使用提供的“all-in-one”镜像,自行检查openstack中各服务的状态,若有问题自行排

使用提供的“all-in-one”镜像,自行检查openstack中各服务的状态,若有问题自行排

一、使用VMWare软件启动提供的opensatckallinone镜像,自行检查openstack中各服务的状态,若有问题自行排查。使用Cinder服务,创建名为“ lvm”的卷类型,然后创建一块带“lvm” 标识的云硬盘,名称为 BlockVloume,大小为 2G,查询该云硬盘详细信息。完成后,将cinder show BlockVloume命令的返回结果以文本形式提交到答题框。

  1. [root@controller ~]# cinder type-create lvm
  2. +--------------------------------------+------+-------------+-----------+
  3. | ID | Name | Description | Is_Public |
  4. +--------------------------------------+------+-------------+-----------+
  5. | eaa7387b-5656-4fa7-b1d9-c47893ef47b9 | lvm | - | True |
  6. +--------------------------------------+------+-------------+-----------+
  1. [root@controller ~]# cinder create --volume-type lvm --name BlockVloume 2
  2. +--------------------------------+--------------------------------------+
  3. | Property | Value |
  4. +--------------------------------+--------------------------------------+
  5. | attachments | [] |
  6. | availability_zone | nova |
  7. | bootable | false |
  8. | consistencygroup_id | None |
  9. | created_at | 2022-06-05T18:39:12.000000 |
  10. | description | None |
  11. | encrypted | False |
  12. | id | 70c77e00-093a-48ea-a9e7-f40d8db0d16b |
  13. | metadata | {} |
  14. | migration_status | None |
  15. | multiattach | False |
  16. | name | BlockVloume |
  17. | os-vol-host-attr:host | None |
  18. | os-vol-mig-status-attr:migstat | None |
  19. | os-vol-mig-status-attr:name_id | None |
  20. | os-vol-tenant-attr:tenant_id | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  21. | replication_status | disabled |
  22. | size | 2 |
  23. | snapshot_id | None |
  24. | source_volid | None |
  25. | status | creating |
  26. | updated_at | None |
  27. | user_id | 0befa70f767848e39df8224107b71858 |
  28. | volume_type | lvm |
  29. +--------------------------------+--------------------------------------+
  1. [root@controller ~]# cinder show BlockVloume
  2. +--------------------------------+--------------------------------------+
  3. | Property | Value |
  4. +--------------------------------+--------------------------------------+
  5. | attachments | [] |
  6. | availability_zone | nova |
  7. | bootable | false |
  8. | consistencygroup_id | None |
  9. | created_at | 2022-06-05T18:39:12.000000 |
  10. | description | None |
  11. | encrypted | False |
  12. | id | 70c77e00-093a-48ea-a9e7-f40d8db0d16b |
  13. | metadata | {} |
  14. | migration_status | None |
  15. | multiattach | False |
  16. | name | BlockVloume |
  17. | os-vol-host-attr:host | controller@lvm#LVM |
  18. | os-vol-mig-status-attr:migstat | None |
  19. | os-vol-mig-status-attr:name_id | None |
  20. | os-vol-tenant-attr:tenant_id | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  21. | replication_status | disabled |
  22. | size | 2 |
  23. | snapshot_id | None |
  24. | source_volid | None |
  25. | status | available |
  26. | updated_at | 2022-06-05T18:39:12.000000 |
  27. | user_id | 0befa70f767848e39df8224107b71858 |
  28. | volume_type | lvm |
  29. +--------------------------------+--------------------------------------+

二、使用VMWare软件启动提供的opensatckallinone镜像,自行检查openstack中各服务的状态,若有问题自行排查。在xserver1节点的/root目录下存在一个cirros-0.3.4-x86_64-disk.img镜像;使用glance命令将镜像上传,并命名为mycirros,最后将glance image-show id命令的返回结果以文本形式提交到答题框。

  1. [root@controller ~]# glance image-create --name mycirros --file cirros-0.3.4-x86_64-disk.img --disk-format iso --container-format bare
  2. +------------------+--------------------------------------+
  3. | Property | Value |
  4. +------------------+--------------------------------------+
  5. | checksum | ee1eca47dc88f4879d8a229cc70a07c6 |
  6. | container_format | bare |
  7. | created_at | 2022-06-05T18:48:14Z |
  8. | disk_format | iso |
  9. | id | 26ad703b-ea6d-4207-94f9-5b391a843c0a |
  10. | min_disk | 0 |
  11. | min_ram | 0 |
  12. | name | mycirros |
  13. | owner | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  14. | protected | False |
  15. | size | 13287936 |
  16. | status | active |
  17. | tags | [] |
  18. | updated_at | 2022-06-05T18:48:15Z |
  19. | virtual_size | None |
  20. | visibility | private |
  21. +------------------+--------------------------------------+
  1. [root@controller ~]# glance image-show 26ad703b-ea6d-4207-94f9-5b391a843c0a
  2. +------------------+--------------------------------------+
  3. | Property | Value |
  4. +------------------+--------------------------------------+
  5. | checksum | ee1eca47dc88f4879d8a229cc70a07c6 |
  6. | container_format | bare |
  7. | created_at | 2022-06-05T18:48:14Z |
  8. | disk_format | iso |
  9. | id | 26ad703b-ea6d-4207-94f9-5b391a843c0a |
  10. | min_disk | 0 |
  11. | min_ram | 0 |
  12. | name | mycirros |
  13. | owner | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  14. | protected | False |
  15. | size | 13287936 |
  16. | status | active |
  17. | tags | [] |
  18. | updated_at | 2022-06-05T18:48:15Z |
  19. | virtual_size | None |
  20. | visibility | private |
  21. +------------------+--------------------------------------+

三、使用VMWare软件启动提供的opensatckallinone镜像,自行检查openstack中各服务的状态,若有问题自行排查。在dashboard界面创建云主机外部网络ext-net,子网为ext-subnet,云主机浮动IP可用网段为192.168.200.100 ~ 192.168.200.200,网关为192.168.200.1。创建云主机内部网络int-net1,子网为int-subnet1,云主机子网IP可用网段为10.0.0.100 ~ 10.0.0.200,网关为10.0.0.1。添加名为ext-router的路由器,添加网关在ext-net网络,添加内部端口到int-net1网络,完成内部网络int-net1和外部网络的连通。将执行neutron router-show ext-router命令所返回的结果以文本形式提交到答题框。

  1. [root@controller ~]# neutron net-create --shared --provider:network_type flat --provider:physical_network gre --availability-zone-hint nova --router:external ext-net
  2. Created a new network:
  3. +---------------------------+--------------------------------------+
  4. | Field | Value |
  5. +---------------------------+--------------------------------------+
  6. | admin_state_up | True |
  7. | availability_zone_hints | nova |
  8. | availability_zones | |
  9. | created_at | 2022-06-05T19:05:45 |
  10. | description | |
  11. | id | d6fb8a21-514c-4100-b88a-7fb3d4d73e99 |
  12. | ipv4_address_scope | |
  13. | ipv6_address_scope | |
  14. | is_default | False |
  15. | mtu | 1500 |
  16. | name | ext-net |
  17. | port_security_enabled | True |
  18. | provider:network_type | flat |
  19. | provider:physical_network | gre |
  20. | provider:segmentation_id | |
  21. | router:external | True |
  22. | shared | True |
  23. | status | ACTIVE |
  24. | subnets | |
  25. | tags | |
  26. | tenant_id | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  27. | updated_at | 2022-06-05T19:05:45 |
  28. +---------------------------+--------------------------------------+
  1. [root@controller ~]# neutron subnet-create ext-net 192.168.200.0/24 --allocation-pool start=192.168.200.100,end=192.168.200.200 --name ext-subnet --gateway 192.168.200.2 --dns-nameserver 8.8.8.8
  2. Created a new subnet:
  3. +-------------------+--------------------------------------------------------+
  4. | Field | Value |
  5. +-------------------+--------------------------------------------------------+
  6. | allocation_pools | {"start": "192.168.200.100", "end": "192.168.200.200"} |
  7. | cidr | 192.168.200.0/24 |
  8. | created_at | 2022-06-05T19:22:19 |
  9. | description | |
  10. | dns_nameservers | 8.8.8.8 |
  11. | enable_dhcp | True |
  12. | gateway_ip | 192.168.200.2 |
  13. | host_routes | |
  14. | id | 6cbb07cd-4a9b-47c6-9d04-030677676a1a |
  15. | ip_version | 4 |
  16. | ipv6_address_mode | |
  17. | ipv6_ra_mode | |
  18. | name | ext-subnet |
  19. | network_id | d6fb8a21-514c-4100-b88a-7fb3d4d73e99 |
  20. | subnetpool_id | |
  21. | tenant_id | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  22. | updated_at | 2022-06-05T19:22:19 |
  23. +-------------------+--------------------------------------------------------+
  1. [root@controller ~]# neutron net-create int-net1
  2. Created a new network:
  3. +---------------------------+--------------------------------------+
  4. | Field | Value |
  5. +---------------------------+--------------------------------------+
  6. | admin_state_up | True |
  7. | availability_zone_hints | |
  8. | availability_zones | |
  9. | created_at | 2022-06-05T19:23:33 |
  10. | description | |
  11. | id | 95b933b4-ed7f-46d0-9005-144e3d8c479e |
  12. | ipv4_address_scope | |
  13. | ipv6_address_scope | |
  14. | mtu | 1458 |
  15. | name | int-net1 |
  16. | port_security_enabled | True |
  17. | provider:network_type | gre |
  18. | provider:physical_network | |
  19. | provider:segmentation_id | 69 |
  20. | router:external | False |
  21. | shared | False |
  22. | status | ACTIVE |
  23. | subnets | |
  24. | tags | |
  25. | tenant_id | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  26. | updated_at | 2022-06-05T19:23:33 |
  27. +---------------------------+--------------------------------------+
  1. [root@controller ~]# neutron subnet-create int-net1 10.0.0.0/24 --allocation-pool start=10.0.0.100,end=10.0.0.200 --name int-subnet1 --gateway 10.0.0.2 --dns-nameserver 8.8.8.8
  2. Created a new subnet:
  3. +-------------------+----------------------------------------------+
  4. | Field | Value |
  5. +-------------------+----------------------------------------------+
  6. | allocation_pools | {"start": "10.0.0.100", "end": "10.0.0.200"} |
  7. | cidr | 10.0.0.0/24 |
  8. | created_at | 2022-06-05T19:25:15 |
  9. | description | |
  10. | dns_nameservers | 8.8.8.8 |
  11. | enable_dhcp | True |
  12. | gateway_ip | 10.0.0.2 |
  13. | host_routes | |
  14. | id | 66765845-59da-4100-b62b-cda4411bb514 |
  15. | ip_version | 4 |
  16. | ipv6_address_mode | |
  17. | ipv6_ra_mode | |
  18. | name | int-subnet1 |
  19. | network_id | 95b933b4-ed7f-46d0-9005-144e3d8c479e |
  20. | subnetpool_id | |
  21. | tenant_id | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  22. | updated_at | 2022-06-05T19:25:15 |
  23. +-------------------+----------------------------------------------+
  24. [root@controller ~]#
  1. [root@controller ~]# neutron router-create ext-router
  2. Created a new router:
  3. +-------------------------+--------------------------------------+
  4. | Field | Value |
  5. +-------------------------+--------------------------------------+
  6. | admin_state_up | True |
  7. | availability_zone_hints | |
  8. | availability_zones | |
  9. | description | |
  10. | distributed | False |
  11. | external_gateway_info | |
  12. | ha | False |
  13. | id | 8c688ea7-9863-43be-adf2-65f359b05202 |
  14. | name | ext-router |
  15. | routes | |
  16. | status | ACTIVE |
  17. | tenant_id | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  18. +-------------------------+--------------------------------------+
  19. [root@controller ~]# neutron router-interface-add ext-router int-subnet1
  20. Added interface 916a6a9b-d05d-431a-a8c8-610b4edde09c to router ext-router.
  21. [root@controller ~]# neutron router-gateway-set ext-router ext-net
  22. Set gateway for router ext-router
  23. [root@controller ~]#
  1. [root@controller ~]# neutron router-show ext-router
  2. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
  3. | Field | Value |
  4. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
  5. | admin_state_up | True |
  6. | availability_zone_hints | |
  7. | availability_zones | nova |
  8. | description | |
  9. | distributed | False |
  10. | external_gateway_info | {"network_id": "d6fb8a21-514c-4100-b88a-7fb3d4d73e99", "enable_snat": true, "external_fixed_ips": [{"subnet_id": "6cbb07cd-4a9b- |
  11. | | 47c6-9d04-030677676a1a", "ip_address": "192.168.200.101"}]} |
  12. | ha | False |
  13. | id | 8c688ea7-9863-43be-adf2-65f359b05202 |
  14. | name | ext-router |
  15. | routes | |
  16. | status | ACTIVE |
  17. | tenant_id | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  18. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------+

四、使用提供的“all-in-one”虚拟机,创建用户testuser,密码为xiandian,将testuser用户分配给admin项目,赋予用户admin的权限。依次将操作命令和查询结果以文本形式提交到答题框。

  1. [root@controller ~]# openstack user create testuser --password xiandian --domain xiandian --project admin
  2. +--------------------+----------------------------------+
  3. | Field | Value |
  4. +--------------------+----------------------------------+
  5. | default_project_id | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
  6. | domain_id | 9321f21a94ef4f85993e92a228892418 |
  7. | enabled | True |
  8. | id | 4d561090514d4fc6ab35f5d407104e54 |
  9. | name | testuser |
  10. +--------------------+----------------------------------+
  11. [root@controller ~]# openstack role add admin --user testuser --domain xiandian

五、使用提供的“all-in-one”虚拟机,通过nova的相关命令创建名为exam,ID为1234,内存为1024M,硬盘为20G,虚拟内核数量为2的云主机类型,查看exam的详细信息。依次将操作命令及返回结果以文本形式提交到答题框。

  1. [root@controller ~]# nova flavor-create exam 1234 1024 20 2
  2. +------+------+-----------+------+-----------+------+-------+-------------+-----------+
  3. | ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
  4. +------+------+-----------+------+-----------+------+-------+-------------+-----------+
  5. | 1234 | exam | 1024 | 20 | 0 | | 2 | 1.0 | True |
  6. +------+------+-----------+------+-----------+------+-------+-------------+-----------+
  1. [root@controller ~]# nova flavor-show exam
  2. +----------------------------+-------+
  3. | Property | Value |
  4. +----------------------------+-------+
  5. | OS-FLV-DISABLED:disabled | False |
  6. | OS-FLV-EXT-DATA:ephemeral | 0 |
  7. | disk | 20 |
  8. | extra_specs | {} |
  9. | id | 1234 |
  10. | name | exam |
  11. | os-flavor-access:is_public | True |
  12. | ram | 1024 |
  13. | rxtx_factor | 1.0 |
  14. | swap | |
  15. | vcpus | 2 |
  16. +----------------------------+-------+

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
  

闽ICP备14008679号