# AtlasOS – Calypso  
## SCST Sample Configuration Blueprint  
### (Disk + VTL (MHVTL) + Physical Tape Bridge)

Version: 1.0  
Status: Reference / Implementation Template  
Target OS: Ubuntu Server 24.04 LTS  
SCST Role: **Single iSCSI Target Framework**  
Date: 2025

---

## 1. Scope & Philosophy

Dokumen ini berisi **contoh konfigurasi SCST** yang digunakan oleh
AtlasOS – Calypso untuk:

- Disk-based backup repository (iSCSI block)
- Virtual Tape Library (MHVTL)
- Physical tape library bridge (SAS / FC → iSCSI)

⚠️ Catatan penting:
- **SCST tidak memiliki satu format config universal** antar distro/build.
- Pendekatan paling aman adalah **scstadmin-based configuration**.
- File ini adalah **template konseptual + praktis**, bukan hard-coded syntax
  yang dipaksakan ke semua environment.

Calypso akan **meng-generate dan meng-apply konfigurasi ini secara dinamis**.

---

## 2. Global Assumptions & Placeholders

Ganti placeholder berikut sesuai environment:

| Placeholder | Contoh |
|------------|-------|
| `<INITIATOR_IQN>` | `iqn.1993-08.org.debian:01:backupvm` |
| `<IQN_REPO>` | `iqn.2025.atlasos.calypso:repo.main` |
| `<IQN_VTL>` | `iqn.2025.atlasos.calypso:vtl.vtl01` |
| `<IQN_PHYS>` | `iqn.2025.atlasos.calypso:tape.physical.lib01` |

### Stable Device Paths (via udev – recommended)

/dev/calypso/
repo/
lun0
vtl/
vtl01/
changer
drive1
drive2
physical/
lib01/
changer
drive1
drive2


⚠️ SCST **HARUS** memakai path stabil ini, bukan `/dev/sgX` langsung.

---

## 3. Pre-flight Checks

```bash
systemctl status scst --no-pager
systemctl status iscsi-scst --no-pager

Capability detection:

scstadmin -list_handler
scstadmin -list_driver
scstadmin -list_target

Calypso WAJIB mendeteksi handler yang tersedia sebelum apply config.

4. Disk Repository Target (iSCSI Block)
4.1 Create Backend Device

Biasanya menggunakan handler vdisk.

scstadmin -open_dev repo_lun0 \
  -handler vdisk \
  -attributes filename=/dev/calypso/repo/lun0


4.2 Create iSCSI Target & LUN Mapping
scstadmin -add_target <IQN_REPO> -driver iscsi

scstadmin -add_lun 0 \
  -target <IQN_REPO> \
  -driver iscsi \
  -device repo_lun0

4.3 Initiator ACL
scstadmin -add_group repo_acl \
  -target <IQN_REPO> \
  -driver iscsi

scstadmin -add_init <INITIATOR_IQN> \
  -group repo_acl \
  -target <IQN_REPO> \
  -driver iscsi

(Opsional: CHAP bila diperlukan)

5. Virtual Tape Library (MHVTL → SCST)
5.1 Handler Strategy

Karena variasi build SCST, mode default paling aman:

Changer → SCSI Generic (sg passthrough)

Drives → SCSI Generic (atau native tape handler jika tersedia)

Handler aktual ditentukan lewat:

scstadmin -list_handler

Gunakan placeholder <SG_HANDLER>.

5.2 Create Backend Devices (VTL)
# Changer
scstadmin -open_dev vtl01_changer \
  -handler <SG_HANDLER> \
  -attributes filename=/dev/calypso/vtl/vtl01/changer

# Drives
scstadmin -open_dev vtl01_drive1 \
  -handler <SG_HANDLER> \
  -attributes filename=/dev/calypso/vtl/vtl01/drive1

scstadmin -open_dev vtl01_drive2 \
  -handler <SG_HANDLER> \
  -attributes filename=/dev/calypso/vtl/vtl01/drive2


5.3 Create iSCSI Target & LUN Mapping
scstadmin -add_target <IQN_VTL> -driver iscsi

# Mandatory LUN layout
scstadmin -add_lun 0 \
  -target <IQN_VTL> \
  -driver iscsi \
  -device vtl01_changer

scstadmin -add_lun 1 \
  -target <IQN_VTL> \
  -driver iscsi \
  -device vtl01_drive1

scstadmin -add_lun 2 \
  -target <IQN_VTL> \
  -driver iscsi \
  -device vtl01_drive2


5.4 ACL (Single Initiator)
scstadmin -add_group vtl_acl \
  -target <IQN_VTL> \
  -driver iscsi

scstadmin -add_init <INITIATOR_IQN> \
  -group vtl_acl \
  -target <IQN_VTL> \
  -driver iscsi


⚠️ Tape target WAJIB single initiator.

6. Physical Tape Library Bridge (SAS / FC)
6.1 Backend Devices

# Changer
scstadmin -open_dev phys_changer \
  -handler <SG_HANDLER> \
  -attributes filename=/dev/calypso/physical/lib01/changer

# Drives
scstadmin -open_dev phys_drive1 \
  -handler <SG_HANDLER> \
  -attributes filename=/dev/calypso/physical/lib01/drive1

scstadmin -open_dev phys_drive2 \
  -handler <SG_HANDLER> \
  -attributes filename=/dev/calypso/physical/lib01/drive2


6.2 Target & LUN Mapping
scstadmin -add_target <IQN_PHYS> -driver iscsi

scstadmin -add_lun 0 \
  -target <IQN_PHYS> \
  -driver iscsi \
  -device phys_changer

scstadmin -add_lun 1 \
  -target <IQN_PHYS> \
  -driver iscsi \
  -device phys_drive1

scstadmin -add_lun 2 \
  -target <IQN_PHYS> \
  -driver iscsi \
  -device phys_drive2


6.3 ACL (Single Initiator)
scstadmin -add_group phys_acl \
  -target <IQN_PHYS> \
  -driver iscsi

scstadmin -add_init <INITIATOR_IQN> \
  -group phys_acl \
  -target <IQN_PHYS> \
  -driver iscsi

7. Persist Configuration

Tergantung packaging SCST:

Common Method
scstadmin -write_config /etc/scst.conf


Calypso Recommended Pattern
/etc/calypso/scst/
  generated.conf
  last-known-good.conf


Flow:

Generate → validate

Apply

Health check

Promote to last-known-good

8. Initiator Validation
iscsiadm -m discovery -t sendtargets -p <CALYPSO_IP>
iscsiadm -m node --login
lsscsi -g


Untuk tape:
sg_inq /dev/sgX


Backup software harus melihat:

1 medium changer
N tape drives
Slot inventory valid

9. Operational Guardrails
Forbidden

Apply config saat drive busy

Delete tape target saat initiator login

Multiple initiators ke tape target

Mandatory

Audit semua perubahan

Async task execution

Rollback otomatis jika apply gagal

10. Authority

Dokumen ini adalah reference resmi untuk:

SCST config generation

VTL export

Physical tape bridge

Jika ada konflik:

Blueprint SCST + MHVTL

CURSOR.md

SRS

maka dokumen ini menang untuk domain SCST configuration.

AtlasOS – Calypso diperlakukan sebagai
enterprise-grade tape & VTL appliance, bukan sekadar target iSCSI biasa.