Skip to content

Conversation

@mohitrajain
Copy link
Contributor

@mohitrajain mohitrajain commented Dec 23, 2025

Summary of changes :

  • Removed command-line argument parsing - Script no longer supports --deploy-vm, --verbose, or -h flags; now only deploys the full 7-VM standard infrastructure.
  • Switched from static to dynamic DHCP IPs - VMs now acquire IPs automatically via DHCP instead of using pre-configured static IPs (192.168.122.10-33).
  • Replaced Autoinstall with Cloud-Init - Simplified provisioning from complex Ubuntu Installer to lightweight cloud-init with cloud-localds seed ISOs. VMs creation was taking 8 mins on physical hypervisor(KVM) enabled nodes and VM were in shut-off state once created, manual start was required. Now it takes 1.5 mins for 6 VMs.
  • Centralized SSH keys to deploy_dir/ssh/ - SSH keypairs now stored locally in the project directory instead of user's home .ssh/ folder with automatic permission validation.
  • Added .vm-env environment file export - Script now generates and exports all VM IPs as environment variables for downstream automation and inventory generation.
  • IP management was static - now it is DHCP based - better way to avoid collisions and in virtual network native way
  • If VMs are ready - old way was simple running check - modified to perform a ssh check

This ticket is part of cascading PRs:
#846 - ansible prepare host for vm provisioning
#847 - minor fixes for bin/offline-deploy.sh and cd.sh terraform inventory
#848 - add terraform resources for wiab-staging
#849 - add cd_staging.sh script
#850 - GitHub workflow wiab staging - All the changes are being verified here
#851 - docs for wiab-staging are here
#852 - clean old wiab staging script and workflows
#853 - Testing wiab-staging solution for wire-server-5.14
#856 - postgresql repmgr node config

No labels:
The changes in the PR - can't be verified using Github workflows - will add an asciinema.

Change type

  • Fix
  • Feature
  • Documentation
  • Security / Upgrade

Basic information

  • THIS CHANGE REQUIRES A DEPLOYMENT PACKAGE RELEASE
  • THIS CHANGE REQUIRES A WIRE-DOCS RELEASE

Testing

  • I ran/applied the changes myself, in a test environment.
  • The CI job attached to this repo will test it for me.

Offline Build CI (label-based)

Add one or more labels to trigger offline builds:

  • build-default - Full production build (ansible, terraform, all packages)
  • build-demo - Demo/WIAB build
  • build-min - Minimal build (fastest, essential charts only)
  • build-all - Run all three builds

Note: No builds run by default. Add a label to trigger CI.

Tracking

  • I added a new entry in an appropriate subdirectory of changelog.d
  • I mentioned this PR in Jira, OR I mentioned the Jira ticket in this PR.
  • I mentioned this PR in one of the issues attached to one of our repositories.

Knowledge Transfer

  • An Asciinema session is attached to the Jira ticket.

Motivation

Objective

Reason

Use case

@mohitrajain mohitrajain requested review from a team and julialongtin as code owners December 23, 2025 16:19
@mohitrajain mohitrajain changed the title fix: wpb-21356 offline-vm-setup script to manage VMs fix: wpb-21356 offline-vm-setup script to manage VMs wiab-staging Dec 28, 2025
@mohitrajain mohitrajain changed the title fix: wpb-21356 offline-vm-setup script to manage VMs wiab-staging fix: wpb-22439 offline-vm-setup script to manage VMs wiab-staging Jan 5, 2026
BASE_IMAGE="$BASE_IMAGE_DIR/ubuntu-22.04-base.qcow2"
IMAGE_URL="https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img"

if [ ! -d "$NOCLOUD_DIR" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the if block. -p is unconditional, and always succeeds.

VM_VCPU=(2 6 6 6 4 4 4)
VM_RAM=(4096 8192 8192 8192 8192 8192 8192)
VM_DISK=(100 100 100 100 100 100 100)
if [ ! -d "$BASE_IMAGE_DIR" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here. do not mkdir -p in a if'd off block, unless you are doing something else with the if.

# Download base Ubuntu cloud image if not present
if [ ! -f "$BASE_IMAGE" ]; then
msg "Downloading Ubuntu 22.04 cloud image to $BASE_IMAGE ..."
wget -q "$IMAGE_URL" -O "$BASE_IMAGE" || die "Failed to download Ubuntu cloud image"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wget vs curl here. if you're specifying the output file name, curl is same as wget, only saner to debug.

ssh-keygen -t ed25519 -q -N '' -f "$HOME"/.ssh/id_ed25519
SSHKEY_DEMO=$(cat "$HOME"/.ssh/id_ed25519.pub)
SSH_DIR="$DEPLOY_DIR/ssh"
if [ ! -d "$SSH_DIR" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mkdir -p here.

@mohitrajain mohitrajain force-pushed the wpb-21356-update-vm-management branch from 5441047 to 71c155e Compare January 29, 2026 11:12
@mohitrajain mohitrajain changed the base branch from master to wpb-22439-0-enable-rabbitmq-ansible January 29, 2026 11:12
@mohitrajain mohitrajain force-pushed the wpb-21356-update-vm-management branch from 1f58fc3 to 7b9a97f Compare January 29, 2026 15:25
@sonarqubecloud
Copy link

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 this pull request may close these issues.

4 participants