diff options
author | Manuel Buil <mbuil@suse.com> | 2018-10-03 18:18:05 +0200 |
---|---|---|
committer | Manuel Buil <mbuil@suse.com> | 2018-10-03 19:44:03 +0200 |
commit | f54c78e2c36d7db53260bc868b5b538cb8e9d911 (patch) | |
tree | f4a7954c1e283a55eb051df3043aa82efc479713 /xci/playbooks/roles/create-nodes/templates | |
parent | 6158af2f83842e3d6bdcba8c7ba93b4116b405ae (diff) |
[Baremetal] - Change roles and playbooks names
A few playbooks and the create-vm-nodes role should change the name to
reflect the new reality once the baremetal patches are merged. The
playbooks that must change the name are:
- xci-prepare-virtual.yml
- xci-create-virtual.yml
Change-Id: Iaed1f93561fa9d39c7916e0643a5445cdddf4f97
Signed-off-by: Manuel Buil <mbuil@suse.com>
Diffstat (limited to 'xci/playbooks/roles/create-nodes/templates')
3 files changed, 89 insertions, 0 deletions
diff --git a/xci/playbooks/roles/create-nodes/templates/net.xml.j2 b/xci/playbooks/roles/create-nodes/templates/net.xml.j2 new file mode 100644 index 00000000..7e372ffe --- /dev/null +++ b/xci/playbooks/roles/create-nodes/templates/net.xml.j2 @@ -0,0 +1,14 @@ +<network> + <name>{{ vm_network }}</name> + <forward mode='nat'> + <nat> + <port start='1024' end='65535'/> + </nat> + </forward> + <bridge name='{{ network_interface }}' stp='on' delay='0'/> + <ip address='{{ opnfv_vm_pdf.interfaces[opnfv_vm_idf.net_config.admin.interface].gateway }}' netmask='{{ node_network_netmask }}'> + <dhcp> + <host mac="{{ opnfv_vm_pdf.interfaces[opnfv_vm_idf.net_config.admin.interface].mac_address }}" ip="{{ opnfv_vm_pdf.interfaces[opnfv_vm_idf.net_config.admin.interface].address }}"/> + </dhcp> + </ip> +</network> diff --git a/xci/playbooks/roles/create-nodes/templates/pool_dir.xml.j2 b/xci/playbooks/roles/create-nodes/templates/pool_dir.xml.j2 new file mode 100644 index 00000000..e4645deb --- /dev/null +++ b/xci/playbooks/roles/create-nodes/templates/pool_dir.xml.j2 @@ -0,0 +1,7 @@ +<pool type='dir'> + <name>{{ node_storage_pool }}</name> + <target> + <path>{{ node_storage_pool_path }}</path> + </target> +</pool> + diff --git a/xci/playbooks/roles/create-nodes/templates/vm.xml.j2 b/xci/playbooks/roles/create-nodes/templates/vm.xml.j2 new file mode 100644 index 00000000..e4e41eda --- /dev/null +++ b/xci/playbooks/roles/create-nodes/templates/vm.xml.j2 @@ -0,0 +1,68 @@ +<domain type='{{ vm_domain_type }}'> + <name>{{ vm_name }}</name> + <memory unit='GiB'>{{ item.1.node.memory.rstrip('G') }}</memory> + <vcpu>{{ item.1.node.cpus }}</vcpu> + <os> + <type arch='{{ item.1.node.arch }}' machine='{{ item.1.node.model }}'>hvm</type> + {%- if 'opnfv' in vm_name -%} + <boot dev='hd'/> + {%- else -%} + <boot dev='network'/> + {% endif -%} + <bootmenu enable='no'/> + <bios useserial='yes' rebootTimeout='10000'/> + </os> + <features> + <acpi/> + <apic/> + <pae/> + </features> + <cpu mode='{{ item.1.node.cpu_cflags }}'> + <model fallback='allow'/> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>restart</on_crash> + <devices> + <emulator>{{ vm_emulator }}</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='{{ vm_disk_cache }}'/> + <source file='{{ vm_volume_path }}'/> + <target dev='vda' bus='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> + </disk> + <controller type='ide' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <interface type='network'> + <source network='{{ vm_network }}'/> + <model type='{{ vm_nic }}'/> + <mac address='{{ item.1.interfaces[opnfv_vm_idf.net_config.admin.interface].mac_address }}'/> + </interface> + <input type='mouse' bus='ps2'/> + <graphics type='vnc' port='-1' autoport='yes'/> + <video> + <model type='cirrus' vram='9216' heads='1'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <serial type='file'> + <source path='{{ vm_log_file }}'/> + <target port='0'/> + <alias name='serial0'/> + </serial> + <serial type='pty'> + <source path='/dev/pts/49'/> + <target port='1'/> + <alias name='serial1'/> + </serial> + <console type='file'> + <source path='{{ vm_log_file }}'/> + <target type='serial' port='0'/> + <alias name='serial0'/> + </console> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> + </memballoon> + </devices> +</domain> |