2018-05-22 02:10:23 |
Chason Chan |
description |
Currently, init-runonce will check if it has been run by checking whether an image named 'cirros' existed. But the example blew shows "openstack image create" command run failed, and init-runonce still configuring neutron and so on:
[root@kolla-aio tools]# ./init-runonce
No module named cryptography
Checking for locally available cirros image.
None found, downloading cirros image.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12.1M 100 12.1M 0 0 2670k 0 0:00:04 0:00:04 --:--:-- 2671k
Creating glance image.
No module named cryptography
Configuring neutron.
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | UP |
| availability_zone_hints | |
| availability_zones | |
| created_at | 2018-05-21T02:28:11Z |
| description | |
| dns_domain | None |
| id | 30794571-2e8c-4c95-834d-87290361b1e4 |
| ipv4_address_scope | None |
| ipv6_address_scope | None |
| is_default | False |
| is_vlan_transparent | None |
| mtu | 1500 |
| name | public1 |
| port_security_enabled | True |
| project_id | 70fd1808ad5046d491212b03226c9295 |
| provider:network_type | flat |
| provider:physical_network | physnet1 |
| provider:segmentation_id | None |
| qos_policy_id | None |
| revision_number | 1 |
| router:external | External |
| segments | None |
| shared | False |
| status | ACTIVE |
| subnets | |
| tags | |
| updated_at | 2018-05-21T02:28:11Z |
+---------------------------+--------------------------------------+
When I run init-runonce secondly, as you can see, this script won't exit as we expected. It cannot be ensure run just once.
The improvement is to check whether image created successfully. If true, then go on, else exit. |
Currently, init-runonce will check if it has been run properly by checking whether an image named 'cirros' existed. But the example blew shows "openstack image create" command run failed, and init-runonce still configuring neutron and so on:
[root@kolla-aio tools]# ./init-runonce
No module named cryptography
Checking for locally available cirros image.
None found, downloading cirros image.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12.1M 100 12.1M 0 0 2670k 0 0:00:04 0:00:04 --:--:-- 2671k
Creating glance image.
No module named cryptography
Configuring neutron.
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | UP |
| availability_zone_hints | |
| availability_zones | |
| created_at | 2018-05-21T02:28:11Z |
| description | |
| dns_domain | None |
| id | 30794571-2e8c-4c95-834d-87290361b1e4 |
| ipv4_address_scope | None |
| ipv6_address_scope | None |
| is_default | False |
| is_vlan_transparent | None |
| mtu | 1500 |
| name | public1 |
| port_security_enabled | True |
| project_id | 70fd1808ad5046d491212b03226c9295 |
| provider:network_type | flat |
| provider:physical_network | physnet1 |
| provider:segmentation_id | None |
| qos_policy_id | None |
| revision_number | 1 |
| router:external | External |
| segments | None |
| shared | False |
| status | ACTIVE |
| subnets | |
| tags | |
| updated_at | 2018-05-21T02:28:11Z |
+---------------------------+--------------------------------------+
When I run init-runonce secondly, as you can see, this script won't exit as we expected. It cannot be ensure run just once.
The improvement is to check whether image created successfully. If true, then go on, else exit. |
|