[root@controller ~]# cinder type-create lvm -------------------------------------- ------ ------------- ----------- | ID | Name | Description | Is_Public | -------------------------------------- ------ ------------- ----------- | eaa7387b-5656-4fa7-b1d9-c47893ef47b9 | lvm | - | True | -------------------------------------- ------ ------------- -----------
[root@controller ~]# cinder create --volume-type lvm --name BlockVloume 2 -------------------------------- -------------------------------------- | Property | Value | -------------------------------- -------------------------------------- | attachments | [] | | availability_zone | nova | | bootable | false | | consistencygroup_id | None | | created_at | 2022-06-05T18:39:12.000000 | | description | None | | encrypted | False | | id | 70c77e00-093a-48ea-a9e7-f40d8db0d16b | | metadata | {} | | migration_status | None | | multiattach | False | | name | BlockVloume | | os-vol-host-attr:host | None | | os-vol-mig-status-attr:migstat | None | | os-vol-mig-status-attr:name_id | None | | os-vol-tenant-attr:tenant_id | f9ff39ba9daa4e5a8fee1fc50e2d2b34 | | replication_status | disabled | | size | 2 | | snapshot_id | None | | source_volid | None | | status | creating | | updated_at | None | | user_id | 0befa70f767848e39df8224107b71858 | | volume_type | lvm | -------------------------------- --------------------------------------
[root@controller ~]# cinder show BlockVloume -------------------------------- -------------------------------------- | Property | Value | -------------------------------- -------------------------------------- | attachments | [] | | availability_zone | nova | | bootable | false | | consistencygroup_id | None | | created_at | 2022-06-05T18:39:12.000000 | | description | None | | encrypted | False | | id | 70c77e00-093a-48ea-a9e7-f40d8db0d16b | | metadata | {} | | migration_status | None | | multiattach | False | | name | BlockVloume | | os-vol-host-attr:host | controller@lvm#LVM | | os-vol-mig-status-attr:migstat | None | | os-vol-mig-status-attr:name_id | None | | os-vol-tenant-attr:tenant_id | f9ff39ba9daa4e5a8fee1fc50e2d2b34 | | replication_status | disabled | | size | 2 | | snapshot_id | None | | source_volid | None | | status | available | | updated_at | 2022-06-05T18:39:12.000000 | | user_id | 0befa70f767848e39df8224107b71858 | | volume_type | lvm |
+--------------------------------+--------------------------------------+
二、使用VMWare软件启动提供的opensatckallinone镜像,自行检查openstack中各服务的状态,若有问题自行排查。在xserver1节点的/root目录下存在一个cirros-0.3.4-x86_64-disk.img镜像;使用glance命令将镜像上传,并命名为mycirros,最后将glance image-show id命令的返回结果以文本形式提交到答题框。
[root@controller ~]# glance image-create --name mycirros --file cirros-0.3.4-x86_64-disk.img --disk-format iso --container-format bare
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | ee1eca47dc88f4879d8a229cc70a07c6 |
| container_format | bare |
| created_at | 2022-06-05T18:48:14Z |
| disk_format | iso |
| id | 26ad703b-ea6d-4207-94f9-5b391a843c0a |
| min_disk | 0 |
| min_ram | 0 |
| name | mycirros |
| owner | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
| protected | False |
| size | 13287936 |
| status | active |
| tags | [] |
| updated_at | 2022-06-05T18:48:15Z |
| virtual_size | None |
| visibility | private |
+------------------+--------------------------------------+
[root@controller ~]# glance image-show 26ad703b-ea6d-4207-94f9-5b391a843c0a
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | ee1eca47dc88f4879d8a229cc70a07c6 |
| container_format | bare |
| created_at | 2022-06-05T18:48:14Z |
| disk_format | iso |
| id | 26ad703b-ea6d-4207-94f9-5b391a843c0a |
| min_disk | 0 |
| min_ram | 0 |
| name | mycirros |
| owner | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
| protected | False |
| size | 13287936 |
| status | active |
| tags | [] |
| updated_at | 2022-06-05T18:48:15Z |
| virtual_size | None |
| visibility | private |
+------------------+--------------------------------------+
三、使用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命令所返回的结果以文本形式提交到答题框。
[root@controller ~]# neutron net-create --shared --provider:network_type flat --provider:physical_network gre --availability-zone-hint nova --router:external ext-net
Created a new network:
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| availability_zone_hints | nova |
| availability_zones | |
| created_at | 2022-06-05T19:05:45 |
| description | |
| id | d6fb8a21-514c-4100-b88a-7fb3d4d73e99 |
| ipv4_address_scope | |
| ipv6_address_scope | |
| is_default | False |
| mtu | 1500 |
| name | ext-net |
| port_security_enabled | True |
| provider:network_type | flat |
| provider:physical_network | gre |
| provider:segmentation_id | |
| router:external | True |
| shared | True |
| status | ACTIVE |
| subnets | |
| tags | |
| tenant_id | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
| updated_at | 2022-06-05T19:05:45 |
+---------------------------+--------------------------------------+
[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
Created a new subnet:
+-------------------+--------------------------------------------------------+
| Field | Value |
+-------------------+--------------------------------------------------------+
| allocation_pools | {"start": "192.168.200.100", "end": "192.168.200.200"} |
| cidr | 192.168.200.0/24 |
| created_at | 2022-06-05T19:22:19 |
| description | |
| dns_nameservers | 8.8.8.8 |
| enable_dhcp | True |
| gateway_ip | 192.168.200.2 |
| host_routes | |
| id | 6cbb07cd-4a9b-47c6-9d04-030677676a1a |
| ip_version | 4 |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | ext-subnet |
| network_id | d6fb8a21-514c-4100-b88a-7fb3d4d73e99 |
| subnetpool_id | |
| tenant_id | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
| updated_at | 2022-06-05T19:22:19 |
+-------------------+--------------------------------------------------------+
[root@controller ~]# neutron net-create int-net1
Created a new network:
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| availability_zone_hints | |
| availability_zones | |
| created_at | 2022-06-05T19:23:33 |
| description | |
| id | 95b933b4-ed7f-46d0-9005-144e3d8c479e |
| ipv4_address_scope | |
| ipv6_address_scope | |
| mtu | 1458 |
| name | int-net1 |
| port_security_enabled | True |
| provider:network_type | gre |
| provider:physical_network | |
| provider:segmentation_id | 69 |
| router:external | False |
| shared | False |
| status | ACTIVE |
| subnets | |
| tags | |
| tenant_id | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
| updated_at | 2022-06-05T19:23:33 |
+---------------------------+--------------------------------------+
[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
Created a new subnet:
+-------------------+----------------------------------------------+
| Field | Value |
+-------------------+----------------------------------------------+
| allocation_pools | {"start": "10.0.0.100", "end": "10.0.0.200"} |
| cidr | 10.0.0.0/24 |
| created_at | 2022-06-05T19:25:15 |
| description | |
| dns_nameservers | 8.8.8.8 |
| enable_dhcp | True |
| gateway_ip | 10.0.0.2 |
| host_routes | |
| id | 66765845-59da-4100-b62b-cda4411bb514 |
| ip_version | 4 |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | int-subnet1 |
| network_id | 95b933b4-ed7f-46d0-9005-144e3d8c479e |
| subnetpool_id | |
| tenant_id | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
| updated_at | 2022-06-05T19:25:15 |
+-------------------+----------------------------------------------+
[root@controller ~]#
[root@controller ~]# neutron router-create ext-router
Created a new router:
+-------------------------+--------------------------------------+
| Field | Value |
+-------------------------+--------------------------------------+
| admin_state_up | True |
| availability_zone_hints | |
| availability_zones | |
| description | |
| distributed | False |
| external_gateway_info | |
| ha | False |
| id | 8c688ea7-9863-43be-adf2-65f359b05202 |
| name | ext-router |
| routes | |
| status | ACTIVE |
| tenant_id | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
+-------------------------+--------------------------------------+
[root@controller ~]# neutron router-interface-add ext-router int-subnet1
Added interface 916a6a9b-d05d-431a-a8c8-610b4edde09c to router ext-router.
[root@controller ~]# neutron router-gateway-set ext-router ext-net
Set gateway for router ext-router
[root@controller ~]#
[root@controller ~]# neutron router-show ext-router
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
| admin_state_up | True |
| availability_zone_hints | |
| availability_zones | nova |
| description | |
| distributed | False |
| external_gateway_info | {"network_id": "d6fb8a21-514c-4100-b88a-7fb3d4d73e99", "enable_snat": true, "external_fixed_ips": [{"subnet_id": "6cbb07cd-4a9b- |
| | 47c6-9d04-030677676a1a", "ip_address": "192.168.200.101"}]} |
| ha | False |
| id | 8c688ea7-9863-43be-adf2-65f359b05202 |
| name | ext-router |
| routes | |
| status | ACTIVE |
| tenant_id | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
四、使用提供的“all-in-one”虚拟机,创建用户testuser,密码为xiandian,将testuser用户分配给admin项目,赋予用户admin的权限。依次将操作命令和查询结果以文本形式提交到答题框。
[root@controller ~]# openstack user create testuser --password xiandian --domain xiandian --project admin
+--------------------+----------------------------------+
| Field | Value |
+--------------------+----------------------------------+
| default_project_id | f9ff39ba9daa4e5a8fee1fc50e2d2b34 |
| domain_id | 9321f21a94ef4f85993e92a228892418 |
| enabled | True |
| id | 4d561090514d4fc6ab35f5d407104e54 |
| name | testuser |
+--------------------+----------------------------------+
[root@controller ~]# openstack role add admin --user testuser --domain xiandian
五、使用提供的“all-in-one”虚拟机,通过nova的相关命令创建名为exam,ID为1234,内存为1024M,硬盘为20G,虚拟内核数量为2的云主机类型,查看exam的详细信息。依次将操作命令及返回结果以文本形式提交到答题框。
[root@controller ~]# nova flavor-create exam 1234 1024 20 2
+------+------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+------+------+-----------+------+-----------+------+-------+-------------+-----------+
| 1234 | exam | 1024 | 20 | 0 | | 2 | 1.0 | True |
+------+------+-----------+------+-----------+------+-------+-------------+-----------+
[root@controller ~]# nova flavor-show exam
+----------------------------+-------+
| Property | Value |
+----------------------------+-------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| disk | 20 |
| extra_specs | {} |
| id | 1234 |
| name | exam |
| os-flavor-access:is_public | True |
| ram | 1024 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 2 |
+----------------------------+-------+