# SDS-05: Integration Design ## 1. Integration Overview ### 1.1 External Systems Calypso integrates with several external systems: - **ZFS**: Zettabyte File System for storage management - **SCST**: SCSI target subsystem for iSCSI - **Bacula/Bareos**: Backup software - **MHVTL**: Virtual Tape Library emulation - **Systemd**: Service management - **PostgreSQL**: Database system ## 2. ZFS Integration ### 2.1 Integration Method - **Command Execution**: Execute `zpool` and `zfs` commands - **Output Parsing**: Parse command output - **Error Handling**: Handle command errors ### 2.2 ZFS Commands ```bash # Pool operations zpool create zpool list zpool status zpool destroy # Dataset operations zfs create zfs list zfs destroy zfs snapshot @ zfs clone zfs rollback ``` ### 2.3 Data Synchronization - **Pool Monitor**: Background service syncs pool status every 2 minutes - **Dataset Monitor**: Real-time dataset information - **ARC Stats**: Real-time ARC statistics ## 3. SCST Integration ### 3.1 Integration Method - **Configuration Files**: Read/write SCST configuration files - **Command Execution**: Execute SCST admin commands - **Config Apply**: Apply configuration changes ### 3.2 SCST Operations ```bash # Target management scstadmin -add_target scstadmin -enable_target scstadmin -disable_target scstadmin -remove_target # LUN management scstadmin -add_lun -driver -target scstadmin -remove_lun -driver -target # Initiator management scstadmin -add_init -driver -target scstadmin -remove_init -driver -target # Config apply scstadmin -write_config /etc/scst.conf ``` ### 3.3 Configuration File Format - **Location**: `/etc/scst.conf` - **Format**: SCST configuration syntax - **Backup**: Backup before modifications ## 4. Bacula/Bareos Integration ### 4.1 Integration Methods - **Database Access**: Direct PostgreSQL access to Bacula database - **Bconsole Commands**: Execute commands via `bconsole` - **Job Synchronization**: Sync jobs from Bacula database ### 4.2 Database Schema - **Tables**: Jobs, Clients, Filesets, Pools, Volumes, Media - **Queries**: SQL queries to retrieve backup information - **Updates**: Update job status, volume information ### 4.3 Bconsole Commands ```bash # Job operations run job= status job= list jobs list files jobid= # Client operations list clients status client= # Pool operations list pools list volumes pool= # Storage operations list storage status storage= ``` ### 4.4 Job Synchronization - **Background Sync**: Periodic sync from Bacula database - **Real-time Updates**: Update on job completion - **Status Mapping**: Map Bacula status to Calypso status ## 5. MHVTL Integration ### 5.1 Integration Method - **Configuration Files**: Read/write MHVTL configuration - **Command Execution**: Execute MHVTL control commands - **Status Monitoring**: Monitor VTL status ### 5.2 MHVTL Operations ```bash # Library operations vtlcmd -l -s vtlcmd -l -d -l vtlcmd -l -d -u # Media operations vtlcmd -l -m -l