#!/usr/bin/env nu # Demo 1: Bare Metal to Cloud Provisioning # Shows how to provision physical servers and migrate to cloud # Target audience: SysAdmins, DevOps engineers print "=== Demo 1: Bare Metal to Cloud Provisioning ===" print "\n1. Starting with bare metal server provisioning..." # Generate infrastructure configuration for bare metal print "Creating bare metal infrastructure config..." run-external "provisioning" generate infra --new "bare-metal-demo" --provider local --target bare-metal # Show the generated configuration print "\n2. Generated KCL configuration:" open kcl/bare-metal-demo.k | head 20 print "\n3. Provisioning bare metal servers with IPMI/BMC control..." # Create bare metal servers (demo mode - won't actually provision) run-external "provisioning" server create --infra "bare-metal-demo" --count 3 --check --debug print "\n4. Installing base system on servers..." run-external "provisioning" taskserv create os-base --infra "bare-metal-demo" --target all --check print "\n5. Now let's migrate this same setup to AWS..." # Generate cloud version from existing bare metal config run-external "provisioning" generate infra --from "bare-metal-demo" --provider aws --new "cloud-demo" print "\n6. Cloud configuration (notice same structure, different provider):" run-external "provisioning" show settings --infra "cloud-demo" --out json | from json | select provider servers print "\n7. Deploy to AWS with same configuration:" run-external "provisioning" server create --infra "cloud-demo" --migrate-from "bare-metal-demo" --check print "\nāœ… Result: Same infrastructure definition, multiple deployment targets" print "šŸ’° Cost: Bare metal for base load, cloud for scaling" print "šŸ”§ Management: Single tool, unified interface"