Deprecate instance network boot

Remove or update the corresponding CI jobs. Use the new custom Cirros
image in the HTTP job to avoid relying on CentOS.

Temporary increase complexity requirements while we have a deprecation
warning in the provisioner.

Change-Id: I5e65f9949ee3b78430309017800b88c1ba21dd02
This commit is contained in:
Dmitry Tantsur 2022-08-23 17:55:24 +02:00
parent 6c5e68a443
commit 77d802f3d6
4 changed files with 32 additions and 30 deletions

View File

@ -114,6 +114,7 @@
centos_glance_kernel_image: test-centos-kernel centos_glance_kernel_image: test-centos-kernel
centos_glance_root_image: test-centos-partition centos_glance_root_image: test-centos-partition
centos_glance_whole_disk_image: test-centos-wholedisk centos_glance_whole_disk_image: test-centos-wholedisk
metalsmith_netboot: false
metalsmith_root_size: 9 metalsmith_root_size: 9
metalsmith_python: python3 metalsmith_python: python3
@ -138,7 +139,6 @@
s-object: false s-object: false
s-proxy: false s-proxy: false
configure_instance_user: metalsmith configure_instance_user: metalsmith
metalsmith_netboot: false
metalsmith_precreate_port: false metalsmith_precreate_port: false
metalsmith_partition_image: test-centos-partition metalsmith_partition_image: test-centos-partition
metalsmith_whole_disk_image: test-centos-wholedisk metalsmith_whole_disk_image: test-centos-wholedisk
@ -159,27 +159,12 @@
metalsmith_boot_mode: bios metalsmith_boot_mode: bios
- job: - job:
name: metalsmith-integration-glance-netboot-cirros name: metalsmith-integration-http-cirros
description: |
Integration job using Glance as image source and direct deploy.
parent: metalsmith-integration-base
run: playbooks/integration/run.yaml
vars:
devstack_localrc:
IRONIC_BOOT_MODE: bios
metalsmith_netboot: true
metalsmith_precreate_port: false
- job:
name: metalsmith-integration-http-netboot-cirros
description: | description: |
Integration job using HTTP as image source and direct deploy. Integration job using HTTP as image source and direct deploy.
parent: metalsmith-integration-base parent: metalsmith-integration-base
run: playbooks/integration/run.yaml run: playbooks/integration/run.yaml
vars: vars:
devstack_localrc:
IRONIC_BOOT_MODE: bios
metalsmith_netboot: true
metalsmith_precreate_port: true metalsmith_precreate_port: true
metalsmith_use_http: true metalsmith_use_http: true
@ -194,13 +179,11 @@
jobs: jobs:
- metalsmith-integration-glance-centos8-uefi - metalsmith-integration-glance-centos8-uefi
- metalsmith-integration-glance-centos8-legacy - metalsmith-integration-glance-centos8-legacy
- metalsmith-integration-glance-netboot-cirros - metalsmith-integration-http-cirros
- metalsmith-integration-http-netboot-cirros
- openstack-tox-linters - openstack-tox-linters
gate: gate:
jobs: jobs:
- metalsmith-integration-glance-centos8-uefi - metalsmith-integration-glance-centos8-uefi
- metalsmith-integration-glance-centos8-legacy - metalsmith-integration-glance-centos8-legacy
- metalsmith-integration-glance-netboot-cirros - metalsmith-integration-http-cirros
- metalsmith-integration-http-netboot-cirros
- openstack-tox-linters - openstack-tox-linters

View File

@ -14,6 +14,7 @@
# limitations under the License. # limitations under the License.
import logging import logging
import warnings
from openstack import connection from openstack import connection
from openstack import exceptions as os_exc from openstack import exceptions as os_exc
@ -350,6 +351,7 @@ class Provisioner(object):
:param hostname: Hostname to assign to the instance. If provided, :param hostname: Hostname to assign to the instance. If provided,
overrides the ``hostname`` passed to ``reserve_node``. overrides the ``hostname`` passed to ``reserve_node``.
:param netboot: Whether to use networking boot for final instances. :param netboot: Whether to use networking boot for final instances.
Deprecated and does not work in Ironic Zed.
:param capabilities: Requested capabilities of the node. If present, :param capabilities: Requested capabilities of the node. If present,
overwrites the capabilities set by :meth:`reserve_node`. overwrites the capabilities set by :meth:`reserve_node`.
Note that the capabilities are not checked against the ones Note that the capabilities are not checked against the ones
@ -368,6 +370,10 @@ class Provisioner(object):
is already finished. is already finished.
:raises: :py:class:`metalsmith.exceptions.Error` :raises: :py:class:`metalsmith.exceptions.Error`
""" """
if netboot:
warnings.warn("Network boot is deprecated and does not work in "
"Ironic Zed", DeprecationWarning)
if config is None: if config is None:
config = instance_config.GenericConfig() config = instance_config.GenericConfig()
if isinstance(image, str): if isinstance(image, str):

View File

@ -1,8 +1,8 @@
--- ---
- name: Find Cirros UEC image - name: Find Cirros partition image
shell: openstack image list -f value -c Name | grep 'cirros-.*-uec$' | sort | tail -n1 shell: openstack image list -f value -c Name | grep 'cirros-.*-partition$' | sort | tail -n1
register: cirros_uec_image_result register: cirros_partition_image_result
failed_when: cirros_uec_image_result.stdout == "" failed_when: cirros_partition_image_result.stdout == ""
- name: Find Cirros disk image - name: Find Cirros disk image
shell: openstack image list -f value -c Name | grep 'cirros-.*-disk$' | sort | tail -n1 shell: openstack image list -f value -c Name | grep 'cirros-.*-disk$' | sort | tail -n1
@ -12,10 +12,15 @@
- name: Set image facts for Glance image - name: Set image facts for Glance image
set_fact: set_fact:
metalsmith_whole_disk_image: "{{ cirros_disk_image_result.stdout }}" metalsmith_whole_disk_image: "{{ cirros_disk_image_result.stdout }}"
metalsmith_partition_image: "{{ cirros_uec_image_result.stdout }}" metalsmith_partition_image: "{{ cirros_partition_image_result.stdout }}"
when: not (metalsmith_use_http | default(false)) when: not (metalsmith_use_http | default(false))
- block: - block:
- name: Find Cirros UEC image
shell: openstack image list -f value -c Name | grep 'cirros-.*-uec$' | sort | tail -n1
register: cirros_uec_image_result
failed_when: cirros_uec_image_result.stdout == ""
- name: Get baremetal HTTP endpoint - name: Get baremetal HTTP endpoint
shell: | shell: |
source /opt/stack/devstack/openrc admin admin > /dev/null source /opt/stack/devstack/openrc admin admin > /dev/null
@ -25,7 +30,7 @@
register: baremetal_endpoint_result register: baremetal_endpoint_result
failed_when: baremetal_endpoint_result.stdout == "" failed_when: baremetal_endpoint_result.stdout == ""
- name: Copy partition images directory - name: Copy UEC images directory
command: > command: >
cp -r /opt/stack/devstack/files/images/{{ cirros_uec_image_result.stdout }} cp -r /opt/stack/devstack/files/images/{{ cirros_uec_image_result.stdout }}
/opt/stack/data/ironic/httpboot/metalsmith /opt/stack/data/ironic/httpboot/metalsmith
@ -41,6 +46,14 @@
creates: /opt/stack/data/ironic/httpboot/metalsmith/{{ cirros_disk_image_result.stdout }}.img creates: /opt/stack/data/ironic/httpboot/metalsmith/{{ cirros_disk_image_result.stdout }}.img
become: yes become: yes
- name: Copy partition image
command: >
cp /opt/stack/data/ironic/{{ cirros_partition_image_result.stdout }}.img
/opt/stack/data/ironic/httpboot/metalsmith
args:
creates: /opt/stack/data/ironic/httpboot/metalsmith/{{ cirros_partition_image_result.stdout }}.img
become: yes
- name: Create MD5 checksums file for images - name: Create MD5 checksums file for images
shell: md5sum cirros-* > CHECKSUMS shell: md5sum cirros-* > CHECKSUMS
args: args:
@ -65,7 +78,7 @@
- name: Set facts for HTTP image - name: Set facts for HTTP image
set_fact: set_fact:
metalsmith_partition_image: "{{ baremetal_endpoint_result.stdout}}/metalsmith/{{ cirros_uec_image_result.stdout | replace('-uec', '-blank') }}.img" metalsmith_partition_image: "{{ baremetal_endpoint_result.stdout}}/metalsmith/{{ cirros_partition_image_result.stdout }}.img"
metalsmith_partition_kernel_image: "{{ baremetal_endpoint_result.stdout}}/metalsmith/{{ cirros_uec_image_result.stdout | replace('-uec', '-vmlinuz') }}" metalsmith_partition_kernel_image: "{{ baremetal_endpoint_result.stdout}}/metalsmith/{{ cirros_uec_image_result.stdout | replace('-uec', '-vmlinuz') }}"
metalsmith_partition_ramdisk_image: "{{ baremetal_endpoint_result.stdout}}/metalsmith/{{ cirros_uec_image_result.stdout | replace('-uec', '-initrd') }}" metalsmith_partition_ramdisk_image: "{{ baremetal_endpoint_result.stdout}}/metalsmith/{{ cirros_uec_image_result.stdout | replace('-uec', '-initrd') }}"
metalsmith_partition_checksum: "{{ baremetal_endpoint_result.stdout}}/metalsmith/CHECKSUMS" metalsmith_partition_checksum: "{{ baremetal_endpoint_result.stdout}}/metalsmith/CHECKSUMS"

View File

@ -82,7 +82,7 @@ deps =
[flake8] [flake8]
# [W503] Line break before binary operator. # [W503] Line break before binary operator.
ignore = W503 ignore = W503
max-complexity=15 max-complexity=16
import-order-style = pep8 import-order-style = pep8
application-import-names = metalsmith application-import-names = metalsmith
# [H106] Don't put vim configuration in source files. # [H106] Don't put vim configuration in source files.
@ -100,4 +100,4 @@ deps =
ansible>=5,<6 ansible>=5,<6
ansible-lint>=5,<6 ansible-lint>=5,<6
commands = commands =
bash tools/ansible-lint.sh bash tools/ansible-lint.sh