Files
BAMS/README.md

133 lines
3.5 KiB
Markdown

# BAMS - Backup Appliance Management System
A comprehensive management system for backup appliances, providing unified control over disk repositories, tape libraries, iSCSI targets, and Bacula integration.
## Features
- **Dashboard**: Real-time monitoring of storage, tape library, iSCSI sessions, and Bacula status
- **Disk Repository Management**: Create and manage LVM and ZFS repositories
- **Tape Library Management**: Inventory, load/unload operations for LTO-8 libraries
- **iSCSI Target Management**: Configure SCST targets with portal and initiator ACL
- **Bacula Integration**: Status monitoring, config generation, and inventory operations
- **Logs & Diagnostics**: Live log viewing and support bundle generation
## Architecture
- **Backend**: Go-based REST API service running as systemd service
- **Frontend**: Cockpit plugin providing web-based UI
- **Storage**: LVM and ZFS support for disk repositories
- **iSCSI**: SCST framework for iSCSI target management
- **Tape**: Support for LTO-8 SAS/FC tape libraries
## Requirements
- Ubuntu Server 24.04 LTS
- Go 1.21+
- Cockpit 300+
- SCST (stable)
- Bacula Community/Enterprise
- LTO-8 compatible tape library
## Installation
### 1. Build Backend
```bash
cd backend
go mod download
go build -o bams-backend .
sudo cp bams-backend /usr/local/bin/
```
### 2. Install Cockpit Plugin
```bash
sudo cp -r cockpit /usr/share/cockpit/bams
sudo systemctl restart cockpit
```
### 3. Configure System
```bash
# Create user and group
sudo useradd -r -s /bin/false bams
sudo groupadd bams-admin
sudo groupadd bams-operator
# Create directories
sudo mkdir -p /var/lib/bams
sudo mkdir -p /etc/bams
sudo mkdir -p /var/log/bams
# Copy configuration
sudo cp configs/config.yaml.example /etc/bams/config.yaml
sudo cp configs/bams.service /etc/systemd/system/
# Install polkit rules
sudo cp configs/polkit.rules /etc/polkit-1/rules.d/50-bams.rules
# Set permissions
sudo chown -R bams:bams /var/lib/bams
sudo chown -R bams:bams /var/log/bams
sudo chmod 640 /etc/bams/config.yaml
```
### 4. Start Service
```bash
sudo systemctl daemon-reload
sudo systemctl enable bams.service
sudo systemctl start bams.service
```
## Configuration
Edit `/etc/bams/config.yaml` to customize:
- Port number (default: 8080)
- Log level (debug, info, warn, error)
- Data directory
- SCST and Bacula config paths
- Security settings
## Usage
1. Access Cockpit web interface
2. Navigate to "BAMS" in the tools menu
3. Use the dashboard to monitor system status
4. Manage storage repositories, tape library, and iSCSI targets through the UI
## API Endpoints
The backend provides a REST API at `http://localhost:8080/api/v1/`:
- `GET /dashboard` - Dashboard summary
- `GET /disk/repositories` - List repositories
- `POST /disk/repositories` - Create repository
- `GET /tape/library` - Library status
- `POST /tape/inventory` - Run inventory
- `GET /iscsi/targets` - List iSCSI targets
- `POST /iscsi/targets` - Create target
- `GET /bacula/status` - Bacula SD status
- `GET /logs/{service}` - Get logs
- `GET /diagnostics/bundle` - Download support bundle
## Security
- Privileged operations require polkit authorization
- Users must be in `bams-admin` or `bams-operator` groups
- HTTPS/TLS recommended for production
- Audit logging for configuration changes
## Troubleshooting
- Check service status: `sudo systemctl status bams`
- View logs: `sudo journalctl -u bams -f`
- Verify Cockpit plugin: Check `/usr/share/cockpit/bams` exists
- Test API: `curl http://localhost:8080/api/v1/health`
## License
GPL-3.0