DEV Community

Jonas Oliveira
Jonas Oliveira

Posted on • Originally published at tecmestre.com.br

Migração Bacula Enterprise para Oracle Cloud (OCI): Guia Completo

Planejar uma migração do bacula oracle cloud oci exige atenção aos detalhes de armazenamento de blocos e latência de rede para garantir a integridade dos dados.

Você precisa migrar seu Bacula Enterprise para Oracle Cloud Infrastructure (OCI) e está enfrentando desafios com mount points, credenciais e redes privadas?

Este guia fornece um playbook completo para recriar sua infraestrutura de backup no OCI, incluindo configuração de Block Volumes, Object Storage e troubleshooting de conectividade.

Para mais informações, consulte a documentação oficial Bacula.

🎯 Cenário: Migração para OCI com Proxmox

Este tutorial cobre a migração de um ambiente com:

- ✅ **Bacula Director/SD:** Oracle Linux 9.6
- ✅ **Hypervisor:** Proxmox VE 9.x
- ✅ **Storage:** Block Volume OCI (iSCSI) + Object Storage (arquivamento)
- ✅ **Rede:** Privada (sem acesso público direto ao Object Storage)
Enter fullscreen mode Exit fullscreen mode

🏗️ Arquitetura Alvo no OCI

Componente
Tipo OCI
Configuração

Compute (VM Bacula)
VM.Standard.E4.Flex
4 OCPUs, 32 GB RAM

Storage Primário
Block Volume (iSCSI)
500 GB, Performance Tier

Storage Secundário
Object Storage
Standard Tier (cold backup)

Rede
VCN Privada
10.0.0.0/16 com Service Gateway

📋 Passo 1: Preparar Ambiente OCI

1.1: Criar VCN e Subnet Privada

No Console OCI → Networking → Virtual Cloud Networks:

Nome: vcn-bacula-prod
CIDR: 10.0.0.0/16

Subnet Privada:
  Nome: subnet-bacula-private
  CIDR: 10.0.1.0/24
  Route Table: rtable-private (com Service Gateway)
Enter fullscreen mode Exit fullscreen mode

1.2: Configurar Service Gateway (Para Object Storage)

Nome: sgw-bacula
Serviços: OCI Object Storage (região local)
Enter fullscreen mode Exit fullscreen mode

Route Rule:

Destino: Object Storage (via Service Gateway)
Target: sgw-bacula
Enter fullscreen mode Exit fullscreen mode

1.3: Criar Block Volume

Nome: bv-bacula-backup
Size: 500 GB
Performance: Balanced
Attachment Type: iSCSI
Enter fullscreen mode Exit fullscreen mode

📦 Passo 2: Provisionar e Configurar VM

2.1: Criar Compute Instance

Image: Oracle Linux 9.6
Shape: VM.Standard.E4.Flex (4 OCPU / 32 GB RAM)
Network: subnet-bacula-private
Public IP: Não (acesso via Bastion ou VPN)
Enter fullscreen mode Exit fullscreen mode

2.2: Anexar Block Volume (iSCSI)

No Console OCI → Attached Block Volumes → Attach Commands:

# Conectar iSCSI
sudo iscsiadm -m node -o new -T iqn.2015-12.com.oracleiaas:XXXXXX -p 169.254.2.2:3260
sudo iscsiadm -m node -o update -T iqn.2015-12.com.oracleiaas:XXXXXX -n node.startup -v automatic
sudo iscsiadm -m node -T iqn.2015-12.com.oracleiaas:XXXXXX -p 169.254.2.2:3260 -l

# Verificar disco
lsblk  # Deve aparecer como /dev/sdb (por exemplo)

# Formatar e montar
sudo mkfs.xfs /dev/sdb
sudo mkdir -p /backup
echo '/dev/sdb /backup xfs defaults,_netdev 0 2' | sudo tee -a /etc/fstab
sudo mount -a
sudo chown -R bacula:bacula /backup
Enter fullscreen mode Exit fullscreen mode

🔐 Passo 3: Configurar Credenciais OCI para Object Storage

3.1: Criar API Key

No Console OCI → Identity → Users → Seu Usuário → API Keys:

openssl genrsa -out ~/.oci/oci_api_key.pem 2048
openssl rsa -pubout -in ~/.oci/oci_api_key.pem -out ~/.oci/oci_api_key_public.pem
Enter fullscreen mode Exit fullscreen mode

Adicione a chave pública no console OCI e copie o Fingerprint.

3.2: Criar Arquivo de Configuração OCI

mkdir -p /opt/bacula/.oci
cat > /opt/bacula/.oci/config <<EOF
[DEFAULT]
user=ocid1.user.oc1..aaaaaaaa...
fingerprint=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
tenancy=ocid1.tenancy.oc1..aaaaaaaa...
region=sa-saopaulo-1
key_file=/opt/bacula/.oci/oci_api_key.pem
EOF

sudo chown -R bacula:bacula /opt/bacula/.oci
sudo chmod 600 /opt/bacula/.oci/*
Enter fullscreen mode Exit fullscreen mode

📡 Passo 4: Instalar e Configurar Bacula Enterprise

4.1: Adicionar Repositório Bacula

cat > /etc/yum.repos.d/Bacula-Enterprise.repo <<'EOF'
[baculasystems-bin]
name = rhel9-64 - baculasystems bin 18.2.1
baseurl = https://www.baculasystems.com/dl/[SEU-DA-CODE]/rpms/bin/18.2.1/rhel9-64/
enabled = 1
gpgcheck = 0
EOF

dnf -y install bacula-enterprise-director bacula-enterprise-storage bacula-enterprise-client
Enter fullscreen mode Exit fullscreen mode

4.2: Configurar Storage para Block Volume

Edite /opt/bacula/etc/bacula-sd.conf:

Device {
  Name = FileChgr1-Dev1
  Media Type = File1
  Archive Device = /backup
  LabelMedia = yes
  Random Access = yes
  AutomaticMount = yes
  RemovableMedia = no
  AlwaysOpen = no
  Maximum Concurrent Jobs = 10
}
Enter fullscreen mode Exit fullscreen mode

4.3: Configurar Cloud Storage para Object Storage OCI

Cloud {
  Name = OCI-ObjectStorage
  Driver = "S3"
  HostName = "objectstorage.sa-saopaulo-1.oraclecloud.com"
  BucketName = "bacula-archive"
  AccessKey = "[ACCESS-KEY]"
  SecretKey = "[SECRET-KEY]"
  Protocol = HTTPS
  UriStyle = VirtualHost
  Upload = EachPart
  MaximumUploadBandwidth = 10MB/s
}
Enter fullscreen mode Exit fullscreen mode

⚠️ IMPORTANTE: O acesso ao Object Storage via rede privada não suporta autenticação IAM nativa. Você precisa usar Customer Secret Keys (compatível com S3).

4.4: Gerar Customer Secret Keys

No Console OCI → Identity → Users → Seu Usuário → Customer Secret Keys:

Nome: bacula-s3-access
# Copie Access Key e Secret Key
Enter fullscreen mode Exit fullscreen mode

✅ Passo 5: Validação e Testes

5.1: Testar Conectividade com Object Storage

# Instalar OCI CLI
bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"

# Testar upload
echo "teste" > /tmp/teste.txt
oci os object put --bucket-name bacula-archive --file /tmp/teste.txt --name teste.txt --config-file /opt/bacula/.oci/config
Enter fullscreen mode Exit fullscreen mode

5.2: Testar Mount do Block Volume

df -h | grep /backup
# Deve mostrar 500G disponível

# Teste de escrita
sudo -u bacula dd if=/dev/zero of=/backup/teste.dat bs=1M count=1000
sudo rm -f /backup/teste.dat
Enter fullscreen mode Exit fullscreen mode

5.3: Executar Backup de Teste

bconsole
*run job=backup-catalogo yes
*status dir
Enter fullscreen mode Exit fullscreen mode

⚠️ Troubleshooting

Erro: "Cannot connect to Object Storage endpoint"

Causa: Service Gateway não configurado ou Route Table incorreta.

Solução:

- Verificar Route Table da Subnet tem regra para Service Gateway
- Testar conectividade: `telnet objectstorage.sa-saopaulo-1.oraclecloud.com 443`
- Verificar Security List permite tráfego HTTPS (porta 443)
Enter fullscreen mode Exit fullscreen mode

Erro: "Block Volume disconnected after reboot"

Causa: iSCSI não configurado para autostart.

Solução:

sudo systemctl enable iscsid
sudo systemctl enable iscsi
Enter fullscreen mode Exit fullscreen mode

Performance lenta no Object Storage

Verificar:

- Bandwidth configurado no Cloud Storage (`MaximumUploadBandwidth`)
- Tamanho dos chunks (`Upload = EachPart` vs `AfterJob`)
- Latência da rede (ping para endpoint OCI)
Enter fullscreen mode Exit fullscreen mode

📊 Custos Estimados (OCI - São Paulo)

Recurso
Especificação
Custo Mensal (USD)

Compute VM
4 OCPU, 32 GB RAM
~$80

Block Volume
500 GB Balanced
~$30

Object Storage
1 TB Standard
~$23

TOTAL
~$133/mês

❓ FAQ

Posso usar IAM Authentication em vez de Customer Secret Keys?

Não em redes privadas. O Bacula S3 driver requer credenciais estáticas (Access Key + Secret Key).

É possível usar Archive Storage em vez de Standard?

Sim, mas o custo de retrieval é alto. Recomendamos Archive apenas para backups com retenção > 1 ano.

Como migrar volumes existentes para OCI?

Use bcopy ou bscan para recriar o catálogo após copiar volumes via rsync ou rclone.

🔗 Recursos Adicionais

- [OCI Block Volumes Documentation](https://docs.oracle.com/en-us/iaas/Content/Block/home.htm)
- [Bacula Enterprise Cloud Storage](https://www.baculasystems.com/documentation-downloads/)
- [Mais tutoriais de Bacula no TecMestre](https://tecmestre.com.br/bacula-enterprise/)
Enter fullscreen mode Exit fullscreen mode

Última atualização: Janeiro de 2026 | Testado no OCI São Paulo com Bacula 18.2.1


Originally published at https://tecmestre.com.br

Top comments (0)