Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change in VyOS image URL #113

Open
kevydotvinu opened this issue Oct 18, 2023 · 1 comment · Fixed by #119
Open

Change in VyOS image URL #113

kevydotvinu opened this issue Oct 18, 2023 · 1 comment · Fixed by #119

Comments

@kevydotvinu
Copy link
Owner

https://legacy-lts-images.vyos.io/1.2.9-S1/vyos-1.2.9-S1-10G-qemu.qcow2
kevydotvinu added a commit that referenced this issue Jan 5, 2024
- Modify VYOS_IMAGE Make target variable

Fixes #113

Signed-off-by: Vinu K <[email protected]>
@kevydotvinu kevydotvinu reopened this Sep 20, 2024
@kevydotvinu
Copy link
Owner Author

# The script needs userdata, networkdata, network and directory as an args

set -eou pipefail

BRIDGE=${1}
NETWORK=$(echo ${BRIDGE} | tr "," "\n" | while read bridge; do echo --network bridge=${bridge}; done)
DIRECTORY=${2}
CLOUDINIT_USER_DATA=${3}
CLOUDINIT_NETWORK_CONFIG=${4}
IMAGE=${5}
HOST_IP=$(/usr/sbin/ip r | grep default | awk '{print $9}' | head -n 1)
ONP_DIR=/home/onp/openshift-network-playground

VM_NAME=$(basename -- ${DIRECTORY})
VM_NAME=${VM_NAME%.*}
IMAGE_NAME=$(basename -- ${IMAGE})
EXTENSION=${IMAGE_NAME##*.}
DISK=${DIRECTORY}/${VM_NAME}.${EXTENSION}

sudo rm -rf ${DIRECTORY}
sudo mkdir -p ${DIRECTORY}
sudo cloud-localds -m local --network-config=${CLOUDINIT_NETWORK_CONFIG} ${DIRECTORY}/seed.iso ${CLOUDINIT_USER_DATA}
sudo qemu-img create -f raw ${DIRECTORY}/os.img 20G
echo "Downloading ${VM_NAME} image ..."
sudo curl -#Lo ${DISK} ${IMAGE}

sudo virsh -q destroy ${VM_NAME} > /dev/null || true
sudo virsh -q undefine ${VM_NAME} > /dev/null || true
sudo virt-install --name ${VM_NAME} \
                  --vcpus 1 \
                  --ram 2048 \
                  --os-variant fedora-unknown \
                  --import \
                  ${NETWORK} \
                  --disk ${DISK} \
                  --disk ${DIRECTORY}/os.img \
                  --disk ${DIRECTORY}/seed.iso \
                  --graphics spice,listen=${HOST_IP} \
                  --video virtio \
                  --channel spicevmc \
                  --console pty,target.type=virtio \
                  --serial pty \
                  --noautoconsole
sudo virsh detach-disk ${VM_NAME} vda
sudo virsh console ${VM_NAME}
onp vyos
install image
reboot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant