- Created docs/ directory for better organization - Moved 35 markdown files from root to docs/ - Includes all status reports, guides, and testing documentation Co-Authored-By: Warp <agent@warp.dev>
6.3 KiB
6.3 KiB
Phase C: Backend Core Domains - Progress Report
Status: In Progress (Core Components Complete)
✅ Completed Components
1. Database Schema (Migration 002)
- File:
backend/internal/common/database/migrations/002_storage_and_tape_schema.sql - Tables Created:
disk_repositories- Disk-based backup repositoriesphysical_disks- Physical disk inventoryvolume_groups- LVM volume groupsscst_targets- SCST iSCSI targetsscst_luns- LUN mappingsscst_initiator_groups- Initiator groupsscst_initiators- iSCSI initiatorsphysical_tape_libraries- Physical tape library metadataphysical_tape_drives- Physical tape drivesphysical_tape_slots- Tape slot inventoryvirtual_tape_libraries- Virtual tape library metadatavirtual_tape_drives- Virtual tape drivesvirtual_tapes- Virtual tape inventory
2. Storage Component ✅
- Location:
backend/internal/storage/ - Features:
- Disk Discovery (
disk.go):- Physical disk detection via
lsblk - Disk information via
udevadm - Health status detection
- Database synchronization
- Physical disk detection via
- LVM Management (
lvm.go):- Volume group listing
- Repository creation (logical volumes)
- XFS filesystem creation
- Repository listing and retrieval
- Usage monitoring
- Repository deletion
- API Handler (
handler.go):GET /api/v1/storage/disks- List physical disksPOST /api/v1/storage/disks/sync- Sync disks to database (async)GET /api/v1/storage/volume-groups- List volume groupsGET /api/v1/storage/repositories- List repositoriesGET /api/v1/storage/repositories/:id- Get repositoryPOST /api/v1/storage/repositories- Create repositoryDELETE /api/v1/storage/repositories/:id- Delete repository
- Disk Discovery (
3. SCST Integration ✅
- Location:
backend/internal/scst/ - Features:
- SCST Service (
service.go):- Target creation and management
- LUN mapping (device to LUN)
- Initiator ACL management
- Single initiator enforcement for tape targets
- Handler detection
- Configuration persistence
- API Handler (
handler.go):GET /api/v1/scst/targets- List all targetsGET /api/v1/scst/targets/:id- Get target with LUNsPOST /api/v1/scst/targets- Create new targetPOST /api/v1/scst/targets/:id/luns- Add LUN to targetPOST /api/v1/scst/targets/:id/initiators- Add initiatorPOST /api/v1/scst/config/apply- Apply SCST configuration (async)GET /api/v1/scst/handlers- List available handlers
- SCST Service (
4. System Management ✅
- Location:
backend/internal/system/ - Features:
- System Service (
service.go):- Systemd service status retrieval
- Service restart
- Journald log retrieval
- Support bundle generation
- API Handler (
handler.go):GET /api/v1/system/services- List all servicesGET /api/v1/system/services/:name- Get service statusPOST /api/v1/system/services/:name/restart- Restart serviceGET /api/v1/system/services/:name/logs- Get service logsPOST /api/v1/system/support-bundle- Generate support bundle (async)
- System Service (
🔄 In Progress / Pending
5. Physical Tape Bridge (Pending)
- Requirements (SRS-02):
- Tape library discovery (changer + drives)
- Slot inventory and barcode handling
- Load/unload operations
- iSCSI export via SCST
- Status: Database schema ready, implementation pending
6. Virtual Tape Library (Pending)
- Requirements (SRS-02):
- MHVTL integration
- Virtual tape management
- Tape image storage
- iSCSI export via SCST
- Status: Database schema ready, implementation pending
7. Enhanced Monitoring (Pending)
- Requirements (SRS-05):
- Enhanced health checks
- Alerting engine
- Metrics collection
- Status: Basic health check exists, alerting engine pending
API Endpoints Summary
Storage Endpoints
GET /api/v1/storage/disks
POST /api/v1/storage/disks/sync
GET /api/v1/storage/volume-groups
GET /api/v1/storage/repositories
GET /api/v1/storage/repositories/:id
POST /api/v1/storage/repositories
DELETE /api/v1/storage/repositories/:id
SCST Endpoints
GET /api/v1/scst/targets
GET /api/v1/scst/targets/:id
POST /api/v1/scst/targets
POST /api/v1/scst/targets/:id/luns
POST /api/v1/scst/targets/:id/initiators
POST /api/v1/scst/config/apply
GET /api/v1/scst/handlers
System Management Endpoints
GET /api/v1/system/services
GET /api/v1/system/services/:name
POST /api/v1/system/services/:name/restart
GET /api/v1/system/services/:name/logs
POST /api/v1/system/support-bundle
Architecture Highlights
- Clean Separation: Each domain has its own service and handler
- Async Operations: Long-running operations use task engine
- SCST Integration: Direct SCST command execution with database persistence
- Error Handling: Comprehensive error handling with rollback support
- Audit Logging: All mutating operations are audited (via middleware)
Next Steps
-
Physical Tape Bridge Implementation:
- Implement
tape_physical/service.gofor discovery and operations - Implement
tape_physical/handler.gofor API endpoints - Add tape endpoints to router
- Implement
-
Virtual Tape Library Implementation:
- Implement
tape_vtl/service.gofor MHVTL integration - Implement
tape_vtl/handler.gofor API endpoints - Add VTL endpoints to router
- Implement
-
Enhanced Monitoring:
- Implement alerting engine
- Add metrics collection
- Enhance health checks
Testing Recommendations
- Unit Tests: Test each service independently
- Integration Tests: Test SCST operations with mock commands
- E2E Tests: Test full workflows (create repo → export via SCST)
Known Limitations
- SCST Commands: Currently uses direct
scstadmincommands - may need abstraction for different SCST builds - Error Recovery: Some operations may need better rollback mechanisms
- Concurrency: Need to ensure thread-safety for SCST operations
- Validation: Additional input validation needed for some endpoints
Last Updated: Phase C - Core Components Complete Next Milestone: Physical and Virtual Tape Library Implementation