diff options
author | Rihab Banday <rihab.banday@ericsson.com> | 2020-07-30 09:16:28 +0000 |
---|---|---|
committer | Rihab Banday <rihab.banday@ericsson.com> | 2020-08-17 10:59:03 +0200 |
commit | 28d1cee5c7b95ae905a4481245d5d5650c87e101 (patch) | |
tree | cbbae35d848e257d6a29e0e31a2dede72d52c5c8 /create_vm.sh | |
parent | c9677cb936e57045c3a7e56c7368b27c7d09a5ad (diff) |
Update env variable extraction and VM creation steps
This change uses YAML parser to extract environmental variables from PDF
and IDF. Additionally it merges the VM creation step with the main
functions script.
Change-Id: I2089b7a84f15e892d57fbadf06252db8769f0fbf
Signed-off-by: Rihab Banday <rihab.banday@ericsson.com>
Diffstat (limited to 'create_vm.sh')
-rwxr-xr-x | create_vm.sh | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/create_vm.sh b/create_vm.sh deleted file mode 100755 index 74435f2..0000000 --- a/create_vm.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# SPDX-license-identifier: Apache-2.0 -############################################################################## -# Copyright (c) -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -# TODO This will be merged in main functions.sh - -sudo mkdir -p "/var/lib/libvirt/images/$1" -sudo qemu-img create -f qcow2 \ - -o backing_file=/var/lib/libvirt/images/ubuntu-18.04.qcow2 \ - "/var/lib/libvirt/images/$1/${1}.qcow2" 10G - -# Create cloud-init configuration files -cat <<EOL > user-data -#cloud-config -users: - - name: ubuntu - ssh-authorized-keys: - - $(cat "$HOME/.ssh/id_rsa.pub") - sudo: ['ALL=(ALL) NOPASSWD:ALL'] - groups: sudo - shell: /bin/bash -EOL -cat <<EOL > meta-data -local-hostname: $VM_NAME -EOL - -sudo genisoimage -output "/var/lib/libvirt/images/$1/$1-cidata.iso" \ - -volid cidata -joliet -rock user-data meta-data - -sudo virt-install --connect qemu:///system --name "$VM_NAME" \ - --ram 4096 --vcpus=4 --os-type linux --os-variant ubuntu16.04 \ - --disk path="/var/lib/libvirt/images/$1/${1}.qcow2",format=qcow2 \ - --disk "/var/lib/libvirt/images/$1/${1}-cidata.iso",device=cdrom \ - --import --network network=default \ - --network bridge="$BRIDGE",model=rtl8139 --noautoconsole |