diff options
-rwxr-xr-x | xci/config/pinned-versions | 16 | ||||
-rw-r--r-- | xci/playbooks/roles/create-vm-nodes/tasks/create_vm.yml | 29 | ||||
-rw-r--r-- | xci/playbooks/roles/create-vm-nodes/tasks/main.yml | 2 | ||||
-rw-r--r-- | xci/playbooks/roles/create-vm-nodes/templates/vm.xml.j2 | 10 | ||||
-rw-r--r-- | xci/playbooks/roles/prepare-functest/templates/run-functest.sh.j2 | 11 | ||||
-rwxr-xr-x | xci/scripts/update-osa-version-files.sh | 8 |
6 files changed, 39 insertions, 37 deletions
diff --git a/xci/config/pinned-versions b/xci/config/pinned-versions index c075734f..0581a981 100755 --- a/xci/config/pinned-versions +++ b/xci/config/pinned-versions @@ -27,14 +27,14 @@ export OPNFV_RELENG_VERSION="master" # HEAD of bifrost "master" as of 30.08.2018 export OPENSTACK_BIFROST_VERSION=${OPENSTACK_BIFROST_VERSION:-"0d0cfd908d10a670668619c575fd338d1ff328b7"} -# HEAD of ironic "master" as of 30.08.2018 -export BIFROST_IRONIC_VERSION=${BIFROST_IRONIC_VERSION:-"0a10eb7794e1543ce2be09c0a55b62fa005b0710"} -# HEAD of ironic-client "master" as of 30.08.2018 -export BIFROST_IRONIC_CLIENT_VERSION=${BIFROST_IRONIC_CLIENT_VERSION:-"d30d415684f979fa78c70a738f90dab06b77a046"} -# HEAD of ironic-inspector "master" as of 30.08.2018 -export BIFROST_IRONIC_INSPECTOR_VERSION=${BIFROST_IRONIC_INSPECTOR_VERSION:-"56138d8f06f531fadc184b0e0efa537c9ad66022"} -# HEAD of ironic-inspector-client "master" as of 30.08.2018 -export BIFROST_IRONIC_INSPECTOR_CLIENT_VERSION=${BIFROST_IRONIC_INSPECTOR_CLIENT_VERSION:-"6eed85c38ee63ade0c2720120fbc9d0520c14f55"} +# HEAD of ironic "stable/rocky" as of 30.08.2018 +export BIFROST_IRONIC_VERSION=${BIFROST_IRONIC_VERSION:-"65ab326b449c30887062b4b2a037224c8d3db000"} +# HEAD of ironic-client "stable/rocky" as of 30.08.2018 +export BIFROST_IRONIC_CLIENT_VERSION=${BIFROST_IRONIC_CLIENT_VERSION:-"b29646d0e8db4c534ad7ca495a3fb73882f1ef43"} +# HEAD of ironic-inspector "stable/rocky" as of 30.08.2018 +export BIFROST_IRONIC_INSPECTOR_VERSION=${BIFROST_IRONIC_INSPECTOR_VERSION:-"403888919bc7f40c1c51f32fe23dff44da3cbcca"} +# HEAD of ironic-inspector-client "stable/rocky" as of 30.08.2018 +export BIFROST_IRONIC_INSPECTOR_CLIENT_VERSION=${BIFROST_IRONIC_INSPECTOR_CLIENT_VERSION:-"eb588de8ba69d750223b024b24346c088c023272"} # HEAD of osa "stable/rocky" as of 30.08.2018 export OPENSTACK_OSA_VERSION=${OPENSTACK_OSA_VERSION:-"b9d9269528ecbe04b2638a73c2b0f49839f27422"} export KEEPALIVED_VERSION=$(grep -E '.*name: keepalived' -A 3 \ diff --git a/xci/playbooks/roles/create-vm-nodes/tasks/create_vm.yml b/xci/playbooks/roles/create-vm-nodes/tasks/create_vm.yml index 008e5531..700c6c72 100644 --- a/xci/playbooks/roles/create-vm-nodes/tasks/create_vm.yml +++ b/xci/playbooks/roles/create-vm-nodes/tasks/create_vm.yml @@ -1,13 +1,8 @@ --- -# Create a VM and volume for it, save its MAC address -- shell: "sudo virsh list --all | grep 'shut off' | wc -l" - register: num_vms - - name: "Creating VM" block: - # NOTE(pas-ha) item here refers to name of the vm - set_fact: - vm_name: "{{ node_names[num_vms.stdout | int] }}" + vm_name: "{{ node_names[item.0 | int] }}" - set_fact: vm_log_file: "{{ node_logdir }}/{{ vm_name }}_console.log" @@ -41,7 +36,7 @@ register: _vm_volume_prepared - name: Resize opnfv VM image to {{ item.disks[0].disk_capacity }} - command: "qemu-img resize {{ opnfv_image_path }}/opnfv.qcow2 {{ item.disks[0].disk_capacity }}" + command: "qemu-img resize {{ opnfv_image_path }}/opnfv.qcow2 {{ item.1.disks[0].disk_capacity }}" when: - vm_name == 'opnfv' - _vm_volume_prepared.stat.exists @@ -52,7 +47,7 @@ command: > virsh --connect {{ vm_libvirt_uri }} vol-create-as {{ node_storage_pool }} {{ vm_name }}.qcow2 - {{ item.disks[0].disk_capacity }} + {{ item.1.disks[0].disk_capacity }} --format qcow2 {{ prealloc|default("") }} when: - not _vm_volume_prepared.stat.exists @@ -115,7 +110,7 @@ when: vbmc_list.stdout.find(vm_name) != -1 - set_fact: - virtual_ipmi_port: "{{ (vm_ipmi_port_start|default(623) | int ) + (num_vms.stdout | int ) }}" + virtual_ipmi_port: "{{ (vm_ipmi_port_start|default(623) | int ) + (item.0 | int) }}" - name: plug vm into vbmc command: vbmc add {{ vm_name }} --libvirt-uri {{ vm_libvirt_uri }} --port {{ virtual_ipmi_port }} @@ -135,7 +130,7 @@ - name: Fetch the ip set_fact: - vm_ip: "{%- for interface in item.interfaces %}{%- if 'native' in (interface.vlan | string) %}{{ interface.address }}{%- endif %}{%- endfor %}" + vm_ip: "{%- for interface in item.1.interfaces %}{%- if 'native' in (interface.vlan | string) %}{{ interface.address }}{%- endif %}{%- endfor %}" # Assumes there is only a single NIC per VM - name: get MAC from vm XML @@ -155,17 +150,17 @@ power: ipmi_address: "192.168.122.1" ipmi_port: "{{ virtual_ipmi_port }}" - ipmi_username: "{{ item.remote_management.user }}" - ipmi_password: "{{ item.remote_management.pass }}" + ipmi_username: "{{ item.1.remote_management.user }}" + ipmi_password: "{{ item.1.remote_management.pass }}" nics: - mac: "{{ vm_mac }}" ansible_ssh_host: "{{ vm_ip }}" ipv4_address: "{{ vm_ip }}" properties: - cpu_arch: "{{ item.node.arch }}" - ram: "{{ item.node.memory.rstrip('G') }}" - cpus: "{{ item.node.cpus }}" - disk_size: "{{ item.disks[0].disk_capacity.rstrip('G') }}" + cpu_arch: "{{ item.1.node.arch }}" + ram: "{{ item.1.node.memory.rstrip('G') }}" + cpus: "{{ item.1.node.cpus }}" + disk_size: "{{ item.1.disks[0].disk_capacity.rstrip('G') }}" - name: add created vm info set_fact: @@ -177,4 +172,4 @@ opnfv_vm_ip: "{{ vm_ip }}" when: vm_name == 'opnfv' - when: (num_nodes | int) > (num_vms.stdout | int) + when: (num_nodes | int) > (item.0 | int) diff --git a/xci/playbooks/roles/create-vm-nodes/tasks/main.yml b/xci/playbooks/roles/create-vm-nodes/tasks/main.yml index 7e0090e4..c1cee6dc 100644 --- a/xci/playbooks/roles/create-vm-nodes/tasks/main.yml +++ b/xci/playbooks/roles/create-vm-nodes/tasks/main.yml @@ -18,7 +18,7 @@ # First we create the opnfv_vm - include_tasks: create_vm.yml - with_items: "{{ [opnfv_vm] + nodes }}" + with_indexed_items: "{{ [opnfv_vm] + nodes }}" - name: Start the opnfv vm virt: diff --git a/xci/playbooks/roles/create-vm-nodes/templates/vm.xml.j2 b/xci/playbooks/roles/create-vm-nodes/templates/vm.xml.j2 index c44fa6aa..5c235f55 100644 --- a/xci/playbooks/roles/create-vm-nodes/templates/vm.xml.j2 +++ b/xci/playbooks/roles/create-vm-nodes/templates/vm.xml.j2 @@ -1,9 +1,9 @@ <domain type='{{ vm_domain_type }}'> <name>{{ vm_name }}</name> - <memory unit='GiB'>{{ item.node.memory.rstrip('G') }}</memory> - <vcpu>{{ item.node.cpus }}</vcpu> + <memory unit='GiB'>{{ item.1.node.memory.rstrip('G') }}</memory> + <vcpu>{{ item.1.node.cpus }}</vcpu> <os> - <type arch='{{ item.node.arch }}' machine='{{ item.node.model }}'>hvm</type> + <type arch='{{ item.1.node.arch }}' machine='{{ item.1.node.model }}'>hvm</type> {%- if 'opnfv' in vm_name -%} <boot dev='hd'/> {%- else -%} @@ -17,7 +17,7 @@ <apic/> <pae/> </features> - <cpu mode='{{ item.node.cpu_cflags }}'> + <cpu mode='{{ item.1.node.cpu_cflags }}'> <model fallback='allow'/> </cpu> <clock offset='utc'/> @@ -36,7 +36,7 @@ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> {% set native_interfaces = [] %} - {%- for interface in item.interfaces %} + {%- for interface in item.1.interfaces %} {%- if 'native' in (interface.vlan | string) %} {%- set _ = native_interfaces.append(interface) %} {%- endif %} diff --git a/xci/playbooks/roles/prepare-functest/templates/run-functest.sh.j2 b/xci/playbooks/roles/prepare-functest/templates/run-functest.sh.j2 index 6e62a3bb..5c6f0168 100644 --- a/xci/playbooks/roles/prepare-functest/templates/run-functest.sh.j2 +++ b/xci/playbooks/roles/prepare-functest/templates/run-functest.sh.j2 @@ -44,14 +44,21 @@ openstack --insecure subnet create --network {{ external_network }} \ --no-dhcp {{ subnet_name }} # the needed images differ between the suites so avoid downloading unnecessary images +echo "Downloading the images needed for functest-$FUNCTEST_SUITE_NAME" +mkdir ~/images && cd ~/images if [[ "$FUNCTEST_SUITE_NAME" =~ "healthcheck" ]]; then - mkdir ~/images && cd ~/images && wget -q http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img && cd ~ + wget -q http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img elif [[ "$FUNCTEST_SUITE_NAME" =~ "smoke" ]]; then - mkdir -p images && wget -q -O- https://git.opnfv.org/functest/plain/functest/ci/download_images.sh | bash -s -- images && ls -1 images/* + wget -q http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img \ + http://testresults.opnfv.org/functest/shaker-image.qcow2 \ + https://cloud-images.ubuntu.com/releases/14.04/release/ubuntu-14.04-server-cloudimg-amd64-disk1.img else echo "Unsupported test suite for functest" exit 1 fi +echo "------------------------------------------------------" +ls -al . && cd ~ +echo "------------------------------------------------------" # docker image to use will be different for healthcheck and smoke test DOCKER_IMAGE_NAME="ollivier/functest-${FUNCTEST_SUITE_NAME}" diff --git a/xci/scripts/update-osa-version-files.sh b/xci/scripts/update-osa-version-files.sh index 42405a3f..3ed2e182 100755 --- a/xci/scripts/update-osa-version-files.sh +++ b/xci/scripts/update-osa-version-files.sh @@ -76,20 +76,20 @@ cat $tempdir/openstack-ansible/ansible-role-requirements.yml >> $releng_xci_base # Update the pinned OSA version sed -i -e "/^export OPENSTACK_OSA_VERSION/s@:-\"[a-z0-9]*@:-\"${1}@" \ - -e "s/\(^# HEAD of osa.*of \).*/\1$(date +%d\.%m\.%Y)/" $releng_xci_base/config/pinned-versions + -e "s/\(^# HEAD of osa \).*/\1\"${OPENSTACK_OSA_VERSION:-master}\" as of $(date +%d\.%m\.%Y)/" $releng_xci_base/config/pinned-versions # Update the pinned bifrost version if [[ -n ${2:-} ]]; then echo "Updating bifrost..." sed -i -e "/^export OPENSTACK_BIFROST_VERSION/s@:-\"[a-z0-9]*@:-\"${2}@" \ - -e "s/\(^# HEAD of bifrost.*of \).*/\1$(date +%d\.%m\.%Y)/" $releng_xci_base/config/pinned-versions + -e "s/\(^# HEAD of bifrost \).*/\1\"${OPENSTACK_OSA_VERSION:-master}\" as of $(date +%d\.%m\.%Y)/" $releng_xci_base/config/pinned-versions # Get ironic shas for ironic in ironic_git_url ironic_client_git_url ironic_inspector_git_url ironic_inspector_client_git_url; do - ironic_sha=$(git ls-remote ${!ironic} | grep master | awk '{print $1}') + ironic_sha=$(git ls-remote ${!ironic} | grep "${OPENSTACK_OSA_VERSION:-master}" | awk '{print $1}') ironic=${ironic/_git*/} echo "... updating ${ironic}" sed -i -e "/^export BIFROST_${ironic^^}_VERSION/s@:-\"[a-z0-9]*@:-\"${ironic_sha}@" \ - -e "s/\(^# HEAD of ${ironic/_/-}.*of \).*/\1$(date +%d\.%m\.%Y)/" $releng_xci_base/config/pinned-versions + -e "s/\(^# HEAD of ${ironic/_/-} \).*/\1\"${OPENSTACK_OSA_VERSION:-master}\" as of $(date +%d\.%m\.%Y)/" $releng_xci_base/config/pinned-versions done fi |