- Too many scripts in root directory (12 shell scripts)
- Unclear naming:
1-rook-ceph.sh,2-os.shvsdeploy_rook_ceph.sh,deploy_openstack.sh - Setup scripts mixed with deployment scripts
- Simulation script is massive (51K) and in wrong location
- Single monolithic config file (
rook_ceph.conf) with 60+ lines - Mixed concerns: hypervisor, network, Kubernetes, OpenStack, Ceph
- Hard to understand which settings apply to which hypervisor
- Hybrid mode settings scattered
- Users don't know which script to run first
- Numbered scripts (
1-,2-) suggest order but also have descriptive names (deploy_*) - No clear entry point for new users
- Setup vs deployment confusion
- 8 documentation files in
docs/directory - Some overlap and redundancy
- Hard to find the right guide for specific use case
openstack-ceph-virtualized/
├── config/
│ ├── default.conf # Main configuration with sensible defaults
│ ├── examples/
│ │ ├── proxmox.conf # Proxmox-specific overrides
│ │ ├── cloudhypervisor.conf # Cloud Hypervisor overrides
│ │ └── hybrid.conf # Hybrid mode overrides
│ └── README.md # Configuration guide
│
├── bin/ # Main executable scripts
│ ├── setup # Master setup script (interactive)
│ ├── deploy # Master deployment script
│ ├── create-vm # VM creation utility
│ └── destroy # Cleanup script
│
├── scripts/ # Internal scripts (not directly called by users)
│ ├── setup/
│ │ ├── setup-proxmox.sh # Proxmox setup (template creation)
│ │ ├── setup-cloudhypervisor.sh # Cloud Hypervisor setup
│ │ └── setup-hybrid.sh # Hybrid mode setup
│ ├── deploy/
│ │ ├── deploy-vms.sh # VM deployment
│ │ ├── deploy-kubernetes.sh # Kubernetes cluster
│ │ ├── deploy-rook-ceph.sh # Rook-Ceph storage
│ │ └── deploy-openstack.sh # OpenStack services
│ └── utils/
│ ├── validate-config.sh # Configuration validation
│ ├── check-prerequisites.sh # Prerequisites check
│ └── generate-inventory.sh # Ansible inventory generation
│
├── lib/ # Library functions (unchanged)
│ ├── hypervisor.sh
│ ├── hypervisors/
│ │ ├── proxmox.sh
│ │ ├── cloudhypervisor.sh
│ │ └── proxmox-cloudhypervisor.sh
│ └── common/
│ ├── network.sh
│ ├── storage.sh
│ └── cloudinit.sh
│
├── docs/ # Consolidated documentation
│ ├── README.md # Documentation index
│ ├── getting-started.md # Quick start (replaces multiple guides)
│ ├── hypervisors/
│ │ ├── proxmox.md
│ │ ├── cloudhypervisor.md
│ │ └── hybrid-mode.md
│ ├── architecture.md
│ ├── configuration.md
│ └── troubleshooting.md
│
├── tests/ # Test scripts
│ ├── test-hypervisor-detection.sh
│ ├── test-vm-creation.sh
│ └── simulate-deployment.sh # Moved from root
│
├── examples/ # Example deployments
│ ├── basic-cluster/
│ └── production-ha/
│
├── README.md # Main project README
├── LICENSE
└── .gitignore
Before:
# Confusing - which one to use?
./cloud-init-template.sh
./setup-cloud-hypervisor.sh
./setup-hybrid-mode.sh
./deploy_rook_ceph.sh
./1-rook-ceph.shAfter:
# Clear, single command with interactive wizard
./bin/setup
# Or specify mode directly
./bin/setup --hypervisor=proxmox
./bin/setup --hypervisor=cloudhypervisor
./bin/setup --hypervisor=hybrid
# Then deploy
./bin/deployBefore: One massive file
# rook_ceph.conf (60+ lines, all hypervisors mixed)
HYPERVISOR="auto"
CH_VM_DIR="/var/lib/cloud-hypervisor/vms"
HYBRID_BRIDGE_INTERNAL="vmbr1199"
TEMPLATE_ID=4444
...After: Modular configs
# config/default.conf (common settings)
VM_PREFIX="os"
NODE_COUNT=6
NETWORK_INTERNAL="10.1.199.0/24"
NETWORK_GATEWAY="10.1.199.254"
# config/examples/proxmox.conf (Proxmox-specific)
HYPERVISOR="proxmox"
TEMPLATE_ID=4444
BRIDGE_INTERNAL="vmbr1199"
BRIDGE_EXTERNAL="vmbr2199"
# config/examples/hybrid.conf (Hybrid-specific)
HYPERVISOR="proxmox-cloudhypervisor"
CH_VM_DIR="/var/lib/cloud-hypervisor/vms"
HYBRID_BRIDGE_INTERNAL="vmbr1199"
VM_ID_START=5000bin/ - User-facing commands (simple, documented)
- Master scripts with clear help text
- Interactive wizards for setup
- Validation before execution
scripts/ - Internal implementation (complex logic)
- Hypervisor-specific setup
- Deployment steps broken down
- Utilities for validation and checks
lib/ - Shared functions (no direct execution)
- Hypervisor abstraction
- Common utilities
- Imported by other scripts
Before: 8 separate files, unclear which to read
- README.md
- docs/INSTALLATION_GUIDE.md
- docs/CLOUD_HYPERVISOR.md
- docs/HYBRID_MODE.md
- docs/HYPERVISOR_ABSTRACTION.md
- docs/ARCHITECTURE.md
- docs/CONFIGURATION.md
- docs/TROUBLESHOOTING.md
After: Clear hierarchy
README.md # Overview, quick start, links
docs/getting-started.md # Comprehensive beginner guide
docs/hypervisors/
├── proxmox.md # Proxmox-specific guide
├── cloudhypervisor.md # Cloud Hypervisor guide
└── hybrid-mode.md # Hybrid mode guide
docs/architecture.md # Technical details
docs/configuration.md # Configuration reference
docs/troubleshooting.md # Common issues
- Create
config/directory - Split
rook_ceph.confinto modular files - Create
config/examples/with hypervisor-specific configs - Add config validation script
- Update scripts to load configs from new location
- Keep old
rook_ceph.confas symlink for backward compatibility
- Create
bin/,scripts/,tests/directories - Create master
bin/setupandbin/deployscripts - Move existing scripts to
scripts/subdirectories - Create wrapper scripts in
bin/that call internal scripts - Keep old scripts in root as symlinks to new locations
- Add deprecation warnings to old scripts
- Create
docs/getting-started.md(merge installation guides) - Reorganize hypervisor docs into
docs/hypervisors/ - Update README.md with new structure
- Add navigation between docs
- Keep old docs with redirects to new locations
- Test all workflows with new structure
- Update CI/CD if applicable
- Remove symlinks after deprecation period
- Archive old files to
legacy/directory - Final documentation pass
# Old way still works (via symlinks)
./deploy_rook_ceph.sh # → bin/deploy --stage=rook-ceph
# New way recommended
./bin/deploy --stage=rook-ceph
# Old config still works
source rook_ceph.conf # → config/default.conf + config/<hypervisor>.conf
# New config preferred
./bin/setup --config=config/examples/proxmox.conf- Week 1-2: Create new structure, keep old files as symlinks
- Week 3-4: Add deprecation warnings to old scripts
- Week 5-6: Update all documentation to use new structure
- Week 7+: Remove symlinks, archive old files
- Create
config/directory structure - Create
config/default.confwith common settings - Create
config/examples/proxmox.conf - Create
config/examples/cloudhypervisor.conf - Create
config/examples/hybrid.conf - Create
config/README.mddocumentation - Create
scripts/utils/validate-config.sh - Update all scripts to source new config files
- Create symlink:
rook_ceph.conf→config/default.conf - Test config loading in all scripts
- Create
bin/directory - Create
scripts/setup/directory - Create
scripts/deploy/directory - Create
scripts/utils/directory - Create master
bin/setupscript (interactive wizard) - Create master
bin/deployscript (orchestrator) - Create
bin/create-vm(wrapper for VM creation) - Move setup scripts to
scripts/setup/ - Move deployment scripts to
scripts/deploy/ - Create symlinks in root for old script names
- Add deprecation warnings to symlinked scripts
- Test all execution paths
- Create
docs/getting-started.md - Create
docs/hypervisors/directory - Move hypervisor docs to subdirectory
- Update README.md with new structure
- Create
docs/README.md(documentation index) - Add cross-references between docs
- Remove redundant content
- Create quick reference card
- Create
tests/directory - Move
simulate-deployment.shtotests/ - Create integration tests
- Test Proxmox workflow end-to-end
- Test Cloud Hypervisor workflow end-to-end
- Test Hybrid mode workflow end-to-end
- Update CI/CD pipelines
- Remove symlinks
- Archive old files to
legacy/ - Final documentation review
# User is confused about what to run first
$ ls *.sh
1-rook-ceph.sh 2-os.sh cloud-init-template.sh create-k8s.sh
create-vm.sh deploy_openstack.sh deploy_rook_ceph.sh
setup-cloud-hypervisor.sh setup-hybrid-mode.sh
# User reads multiple guides to figure out order
$ cat docs/INSTALLATION_GUIDE.md
$ cat docs/CLOUD_HYPERVISOR.md
$ cat docs/HYBRID_MODE.md
# User manually runs multiple commands
$ ./setup-hybrid-mode.sh
$ vi rook_ceph.conf # Edit complex config
$ ./create-vm.sh 4444 5001 os1.local 10.1.199.141/24 10.1.199.254
$ ./deploy_rook_ceph.sh# User runs single command
$ ./bin/setup
# Interactive wizard guides through setup
Welcome to OpenStack-Ceph Infrastructure Setup
==============================================
1. Select hypervisor:
[1] Proxmox VE
[2] Cloud Hypervisor (bare metal)
[3] Hybrid (Cloud Hypervisor on Proxmox)
Choice: 3
2. Verify Proxmox bridges:
✓ vmbr1199 found (10.1.199.254/24)
✓ vmbr2199 found (10.2.199.254/24)
3. Install Cloud Hypervisor? [Y/n]: y
✓ Downloaded Cloud Hypervisor v39.0
✓ Installed to /usr/local/bin/cloud-hypervisor
4. Download Ubuntu template? [Y/n]: y
✓ Downloaded ubuntu-24.04-server-cloudimg-amd64.img
✓ Converted to raw format
Configuration saved to: config/hybrid.conf
Setup complete! Next steps:
1. Add SSH keys to 'pub_keys' file
2. Run './bin/deploy' to create VMs and deploy cluster
# User runs single deploy command
$ ./bin/deploy
Deployment Plan
===============
Stage 1: Create 7 VMs (os0-os6)
Stage 2: Deploy Kubernetes cluster
Stage 3: Deploy Rook-Ceph storage
Stage 4: Deploy OpenStack services
Proceed? [Y/n]: y
[Stage 1] Creating VMs...
✓ os0.local (10.1.199.140) - Jump host
✓ os1.local (10.1.199.141) - K8s node 1
...
[Stage 2] Deploying Kubernetes...
✓ Kubespray inventory generated
✓ Running ansible-playbook...
...- Single entry point:
./bin/setupguides through everything - Clear documentation: One getting-started guide instead of 8 files
- Validation: Scripts check prerequisites and configs before running
- Better errors: Clear messages about what went wrong and how to fix
- Modular configs: Only edit what's relevant to your hypervisor
- Scriptable: Can bypass wizard with
./bin/setup --config=... - Organized: Easy to find and modify specific functionality
- Testable: Unit tests for each component
- Clear structure: Know where to add new features
- Separation of concerns: Setup vs deploy vs utilities
- Backward compatible: Changes don't break existing workflows
- Maintainable: Less code duplication, better organization
✅ Configuration splitting (keep old file as fallback) ✅ Documentation reorganization (keep old docs) ✅ Adding new wrapper scripts (don't touch old scripts)
🔴 Removing old scripts (only after deprecation period) 🔴 Breaking config file format (requires migration script)
Recommended Approach: Execute all phases but keep backward compatibility via symlinks and fallbacks. Remove legacy only after 2-3 months of stable usage.
- Phase 1 (Configuration): 2-3 days
- Phase 2 (Scripts): 3-4 days
- Phase 3 (Documentation): 2-3 days
- Phase 4 (Testing): 2-3 days
Total: ~10-14 days of work
Incremental approach: Can merge after each phase, users benefit immediately
Before starting implementation, confirm:
-
Backward compatibility requirement?
- Keep old scripts as symlinks? (Recommended: Yes)
- Keep old config format working? (Recommended: Yes)
- Deprecation timeline? (Recommended: 2-3 months)
-
Interactive setup wizard?
- Add interactive mode to
bin/setup? (Recommended: Yes) - Support non-interactive mode? (Recommended: Yes, via flags)
- Add interactive mode to
-
Documentation approach?
- One getting-started guide? (Recommended: Yes)
- Keep detailed hypervisor-specific guides? (Recommended: Yes, in subdirs)
-
Testing requirements?
- Need automated tests before merging? (Recommended: Yes, basic tests)
- Integration tests for all hypervisors? (Recommended: Yes, via simulation)
- Review this plan - Get approval on structure and approach
- Start with Phase 1 - Config refactoring (lowest risk, immediate benefit)
- Test thoroughly - Ensure nothing breaks
- Merge incrementally - Don't wait for all phases to complete
- Iterate based on feedback - Adjust plan as needed
Recommendation: Start with Phase 1 (configuration refactoring) as it's the lowest risk and provides immediate clarity for users. Then proceed to Phase 2 if Phase 1 is successful.