Some checks failed
Test / test (push) Has been cancelled
Co-authored-by: Cursor <cursoragent@cursor.com>
6.5 KiB
6.5 KiB
Scripts Directory
This directory contains all automation scripts for the Azure Stack HCI project. Scripts are organized by function for easy navigation and maintenance.
Directory Structure
scripts/
├── deploy/ # Deployment scripts
├── infrastructure/ # Infrastructure setup scripts
├── maintenance/ # Maintenance scripts
│ ├── backup/ # Backup scripts
│ ├── update/ # Update scripts
│ └── cleanup/ # Cleanup scripts
├── vm-management/ # VM management scripts
│ ├── create/ # VM creation scripts
│ ├── configure/ # VM configuration scripts
│ └── monitor/ # VM monitoring scripts
├── testing/ # Testing scripts
├── health/ # Health check scripts
├── validate/ # Validation scripts
├── recovery/ # Recovery scripts
├── monitoring/ # Monitoring scripts
├── quality/ # Quality assurance scripts
├── docs/ # Documentation scripts
├── utils/ # Utility scripts
└── azure-arc/ # Azure Arc scripts
Script Categories
Deployment Scripts (deploy/)
Scripts for deploying the complete infrastructure:
complete-deployment.sh- Complete deployment automationdeploy-all-services.sh- Deploy all HC Stack servicesdeploy-start.sh- Start deployment processdeploy-without-azure.sh- Deploy without Azure integration
Infrastructure Scripts (infrastructure/)
Scripts for setting up infrastructure components:
setup-k3s.sh- Install and configure K3ssetup-git-server.sh- Deploy Git server (Gitea/GitLab)setup-cloudflare-tunnel.sh- Configure Cloudflare Tunnelsetup-observability.sh- Set up monitoring stacksetup-guest-agent.sh- Install QEMU guest agentdownload-ubuntu-cloud-image.sh- Download Ubuntu cloud imagesverify-proxmox-image.sh- Verify Proxmox image integrityfix-corrupted-image.sh- Fix corrupted imagesrecreate-vms-from-template.sh- Recreate VMs from templateauto-complete-template-setup.sh- Automate template setupautomate-all-setup.sh- Complete automation script
VM Management Scripts (vm-management/)
Create (vm-management/create/)
Scripts for creating VMs:
create-all-vms.sh- Create all service VMscreate-first-vm.sh- Create first VMcreate-vms-from-iso.sh- Create VMs from ISOcreate-vms-from-template.sh- Create VMs from templatecreate-vms-via-ssh.sh- Create VMs via SSHcreate-vm-from-image.sh- Create VM from disk imagecreate-vm-template.sh- Create VM templatecreate-proxmox-template.sh- Create Proxmox templatecreate-template-quick.sh- Quick template creationcreate-template-via-api.sh- Create template via API
Configure (vm-management/configure/)
Scripts for configuring VMs:
setup-vms-complete.sh- Complete VM setupcomplete-vm-setup.sh- Finish VM setupcomplete-all-vm-tasks.sh- Complete all VM tasksapply-install-scripts.sh- Apply installation scriptsfix-vm-config.sh- Fix VM configurationfix-vm-creation.sh- Fix VM creation issuesfix-all-vm-configs.sh- Fix all VM configurationsfix-boot-config.sh- Fix boot configurationfix-floppy-boot.sh- Fix floppy boot issuesfix-guest-agent.sh- Fix guest agent issuesfinal-vm-config-fix.sh- Final VM configuration fixset-boot-order-api.sh- Set boot order via APIattach-iso-webui-guide.sh- Guide for attaching ISOmanual-steps-guide.sh- Manual steps guide
Monitor (vm-management/monitor/)
Scripts for monitoring VMs:
check-vm-status.sh- Check VM statuscheck-vm-readiness.sh- Check VM readinesscheck-vm-disk-sizes.sh- Check VM disk sizescheck-and-recreate.sh- Check and recreate VMsmonitor-and-complete.sh- Monitor and complete setup
Utility Scripts (utils/)
General utility scripts:
prerequisites-check.sh- Check system prerequisitestest-proxmox-connection.sh- Test Proxmox connectiontest-cloudflare-connection.sh- Test Cloudflare connection
Azure Arc Scripts (azure-arc/)
Scripts for Azure Arc integration:
onboard-proxmox-hosts.sh- Onboard Proxmox hosts to Azure Arconboard-vms.sh- Onboard VMs to Azure Arcresource-bridge-setup.sh- Set up Azure Arc Resource Bridge
Quality Scripts (quality/)
Scripts for quality assurance:
lint-scripts.sh- Lint all scripts with shellcheckvalidate-scripts.sh- Validate script syntax and dependencies
Documentation Scripts (docs/)
Scripts for documentation management:
generate-docs-index.sh- Generate documentation indexvalidate-docs.sh- Validate documentationupdate-diagrams.sh- Update diagrams
Script Standards
All scripts should follow these standards:
- Shebang:
#!/bin/bash - Error Handling:
set -efor immediate exit on error - Logging: Use consistent logging functions
- Documentation: Include header with description and usage
- Parameters: Use consistent parameter handling
- Versioning: Include version information
Running Scripts
Prerequisites Check
Before running any scripts, check prerequisites:
./scripts/utils/prerequisites-check.sh
Testing Connections
Test connections before deployment:
# Test Proxmox
./scripts/utils/test-proxmox-connection.sh
# Test Cloudflare
./scripts/utils/test-cloudflare-connection.sh
Deployment
Run complete deployment:
./scripts/deploy/complete-deployment.sh
VM Management
Create VMs:
./scripts/vm-management/create/create-all-vms.sh
Monitor VMs:
./scripts/vm-management/monitor/check-vm-status.sh
Script Dependencies
Many scripts depend on:
- Environment variables from
.envfile - Proxmox API access
- Azure CLI authentication
- Network connectivity
Ensure these are configured before running scripts.
Troubleshooting Scripts
If a script fails:
- Check prerequisites:
./scripts/utils/prerequisites-check.sh - Verify environment variables:
cat .env - Check script logs and error messages
- Review script documentation in header
- Test individual components
Contributing
When adding new scripts:
- Place in appropriate directory
- Follow script standards
- Add to this README
- Include documentation header
- Test thoroughly