Posted on

Nakivo : Pre and Post Job Scripts on Linux Appliance

NAKIVO Backup & Replication provides you with the ability to run a script before a job begins (a pre-job script) and after the job has been completed (a post-job script)

SSH Login

Unsing, for example Putty, you have to login Nakivo Director :

Default ssh port for the Nakvo Director is 2221.

Login to nakivo appliance using this credential :

Username: nkvuser
Password: QExS-6b%3D

cd /opt

sudo su

you have to insert password again

mkdir backup

Change new folder permission

chmod 777 backup

Upload file script

Using for example WinSCP with the same above configuration (port and credential) , browse to the new folder /opt/backup and upload here your scripts sh.

Using putty give execution permission to files :

cd backup

chmod +x ./your_file.sh

Take note of the full path of the script file : /opt/backup/your_file.sh

Config Pre and Post script

Using nakivo portal appliance now you have to implement your scripts on job execution. You need to use this guide :

https://prev-helpcenter.nakivo.com/User-Guide/Content/Backup/Creating-VMware-Backup-Jobs/Backup-Job-Wizard-for-VMware-Options.htm#Pre

 

 

Posted on

Esportazione di una macchina virtuale Hyper-v

Per esportare una macchina virtuale Hyper-v è necessario aprire powershell con permessi amministrativi ed eseguire il seguente comando :

Export-VM -Name <virtual machine name> -Path <path>

Errore sulla rete

Nei nostri test ci siamo resi conto che il comando è sempre valido quando il path di destinazione è una cartella del server mentre ci sono difficolta se il path di destinazione è una cartella in rete. In particolare non siamo riusciti ad esportare direttamente su una cartella Linux (es. nas) perché l’esportazione viene eseguita dall’account System.

Vedi documentazione Microsoft

Posted on

Nakivo : Backup da Vmware su QNAP

Di seguito un promemoria dei passi per eseguire la configurazione di una struttura composta da un server Vmware che contiene una appliance Nakivo e che deve eseguire i backup su un nas QNAP.

Installare l’appliance Nakivo sul server Vmware

Seguire i seguenti passaggi dalla seguente documentazione :

https://helpcenter.nakivo.com/User-Guide/Content/Deployment/Installing-NAKIVO-Backup-and-Replication/Deploying-VMware-Virtual-Appliance.htm

Configurazione QNAP

Nel QNPA creare una cartella dedicata (es. NakivoBck) , senza il cestino di rete (togliere il flag dalle proprietà della cartella).

Installare nel QNAP il Transporter Nakivo

documentazione : https://mecdata.it/2023/08/updating-nakivo-appliance-in-environment-with-qnap-nas/

Configurazione Nakivo

Usare il browser Edge per entrare in Nakivo

Alla voce Nodes configurare il Transporter di destinazione cioè quello inserito nel QNAP

Passare alla sezione Repositories. Creare unn nuovo backup Repository.

Selezionare CIFS Share e compilare

Name : un nome per identificare il repository sul transporter (qnap)

Assigned Trasporter : selezionare il trasporter inserito precedentemnete

Path to the share : \\ip del nas\cartella

username : del nas

password : del nas

 

Posted on

Nakivo request support

The Nakivo backup software license allows you to use Nakivo technicians to resolve any problems. To contact the technicians, in the left menu click on “Help” and then on “Request support”. A new screen will open where you will have to push “Create new bundle”. A new form opens for generating the bundle that will be sent to Nakivo. In the Nakivo software there is the possibility of setting the various tasks or devices to record a verbose log. This may be useful to Nakivo technicians to help you solve your problem.

Job Verbose Log

To enable verbose logging in a job, in the “Options” section you must select “Bottleneck detection”.

Transporter Verbose Log

To enable verbose logging in the transporters (Source and Target) used in a job, select the individual transporter and select “Enable debug logging for this node”.

Posted on

Come deve essere eseguito un backup ?

Non esiste una normativa unica e specifica che stabilisca esattamente come deve essere effettuato un backup, ma ci sono diverse linee guida e regolamenti che richiedono alle aziende e alle organizzazioni di implementare misure adeguate per la protezione e il backup dei dati, specialmente in settori che trattano informazioni sensibili o critiche.

Principali riferimenti normativi e standard per il backup:

1. GDPR (Regolamento Generale sulla Protezione dei Dati – UE 2016/679)

Il GDPR non definisce esattamente come deve essere fatto un backup, ma stabilisce che i dati personali devono essere protetti contro la perdita, la distruzione accidentale e il furto. Le aziende devono quindi adottare misure tecniche e organizzative adeguate per garantire l’integrità e la disponibilità dei dati, e il backup è una di queste misure.

  • Art. 32: Impone alle aziende di garantire la sicurezza dei dati trattati, incluse misure per la disponibilità e l’accesso tempestivo ai dati personali in caso di incidenti fisici o tecnici.
  • Art. 5: Richiede che i dati siano gestiti e conservati in modo tale da garantirne la protezione, inclusa la possibilità di ripristinarli in caso di perdita accidentale.

2. ISO/IEC 27001

La norma ISO/IEC 27001 è uno standard internazionale per la gestione della sicurezza delle informazioni. Essa richiede che le organizzazioni implementino controlli per la protezione dei dati, inclusi piani di backup regolari e testati per garantire che i dati siano recuperabili in caso di perdita.

  • Annex A.12.3: Focalizza sull’integrità dei dati e la loro disponibilità, richiedendo il backup dei dati essenziali, inclusi test regolari sui processi di ripristino.

3. NIST SP 800-34 (National Institute of Standards and Technology)

Questa linea guida del NIST statunitense tratta della “Contingency Planning Guide for Information Technology Systems” e contiene raccomandazioni dettagliate su come eseguire il backup dei dati critici e ripristinarli in caso di disastro. Sebbene non obbligatoria, la guida è ampiamente utilizzata come standard di riferimento.

Processo di backup secondo il NIST:

Valutazione del rischio: Identificare i rischi associati alla perdita di dati, inclusi i disastri naturali, 
errori umani, guasti hardware e attacchi informatici.

Determinazione dei requisiti di backup: Valutare la criticità dei dati e definire obiettivi 
di Recovery Point Objective (RPO) e Recovery Time Objective (RTO), ovvero quanto "indietro" 
si può tollerare di perdere dati (RPO) e quanto velocemente i sistemi devono essere ripristinati (RTO).

Implementazione della strategia di backup: Definire il tipo di backup più adatto 
(completo, incrementale, differenziale), la frequenza, la localizzazione dei 
backup e le tecnologie da utilizzare.

Protezione dei backup: Assicurare che i backup siano adeguatamente protetti 
attraverso la crittografia e limitare gli accessi ai dati di backup.

Test di ripristino regolari: Verificare che i backup possano essere ripristinati 
efficacemente, testando periodicamente il processo di recupero.

 

4. HIPAA (Health Insurance Portability and Accountability Act – USA)

Negli Stati Uniti, la HIPAA richiede alle organizzazioni sanitarie di proteggere i dati sanitari sensibili. Questo include requisiti specifici per il backup e il ripristino dei dati per garantire la continuità operativa e la protezione della privacy in caso di perdita o compromissione dei dati.

  • §164.308(a)(7): Richiede l’implementazione di un piano di backup dei dati e di un piano di ripristino in caso di emergenza per garantire la disponibilità continua delle informazioni elettroniche protette.

5. Regolamenti e norme settoriali

In vari settori, come quello bancario, finanziario e assicurativo, esistono regolamenti specifici che impongono requisiti per il backup dei dati, specialmente per garantire la continuità operativa e la conformità alle normative sulla protezione delle informazioni sensibili.

6. Regole interne e policy aziendali

Oltre ai requisiti normativi, molte aziende creano le proprie policy di backup, basandosi su esigenze interne o raccomandazioni degli standard di sicurezza. Queste policy definiscono tempi, metodi, frequenza e responsabilità riguardo ai backup e al loro ripristino.

Buone pratiche per il backup

Anche se le normative non sempre specificano i dettagli di come eseguire i backup, esistono delle buone pratiche riconosciute:

  • Frequenza: Il backup deve essere eseguito regolarmente, in base alla criticità dei dati. Alcune normative richiedono che i dati sensibili vengano salvati quotidianamente.
  • Sicurezza dei backup: I dati devono essere criptati sia a riposo che durante il trasferimento. Questo è particolarmente importante per proteggere i dati sensibili in conformità con il GDPR e altre normative.
  • Ridondanza: I backup dovrebbero essere conservati in più di un luogo fisico o logico (ad es. cloud e on-premise).
  • Test di ripristino: I processi di backup dovrebbero essere regolarmente testati per garantire che i dati possano essere ripristinati correttamente.
  • Piani di emergenza e continuità: È consigliabile creare un piano di continuità operativa che includa i processi di backup e di ripristino per ridurre al minimo i tempi di inattività in caso di incidenti.

Conclusione

Sebbene non esista una singola legge che indichi come debba essere effettuato un backup, diverse normative, come il GDPR e gli standard ISO/IEC 27001, impongono requisiti che influenzano la strategia di backup di un’organizzazione. Ogni azienda deve sviluppare procedure di backup in linea con la propria industria, con i regolamenti applicabili e con le migliori pratiche internazionali, per proteggere i dati e garantire la continuità operativa.

Posted on

Updating Nakivo Appliance in environment with Qnap nas

Nakivo Environment

In this environment we have a Nakivo Appliance and a Qnap nas, used as Nakivo backup repository. We need to update the Nakivo appliance that currently is at 10.6 version.

Updating Nakivo using web console

Enter in your Nakivo web interface, navigate to “Seetings” – “Software Update”. The procedure proposes to you the 10.7 version. Proceed. You’ll reice a warning that “remote transporters will not be updated automatically”. After this procedure the Nakivo will be at 10.7 version and not other updates will be avalaible. Indeed the web console signals that your qnap transporter is “out of the date”. So you need to update it to use it. And here there is the problem: we’ll sew that, using nakivo qnap site , you’ll be able to install only the version 10.9 of qnap trasporter that is newer than the currently Nakivo appliance version. So you first need to install the 10.9 version on your Nakivo appliance, but you need to do it manually

Updating Nakivo manually

Using Nakivo upadte site you have to download the “Virtual Appliance”. You”ll download the file

NAKIVO_Backup_Replication_v10.9.0.76010_Updater.sh

Using the application Winscp connect to your Nakivo appliance via ssh. Upload the sh file in the folder /opt/nakivo/updates.

To enter via ssh in a nakivo appliance the default credential are :

  • username : root
  • password : QExS-6b%3D

Now you have to follow this instruction to update the application : Nakivo manual.

Updating Nakivo Transporter in Qnap

In our environment , the Qnap has a Nakivo Transporter App version 10.6.0, compatible with the starting version of our Nakivo appliance. It’s not possible to update this version automatically via qnap, you need to downnload from Nakivo site the new transporter and update it via Qnap web console.

In Nakivo site , you have to choose between the intel or arm transporter package. You’ll download a opkg file.

So, enter in qnap web console and install it manually :

Unable to install Qnap Transporter because the digital sign is invalid

If you are unabled to install the Nakivo Trasporter package because you recive an error that report that the digital sign is invalid , yoiu need to allow installation of applications without a valid digital signature. Click the Settings icon in the top-right corner of the App Center. On the General tab, check the option “Allow installation of applications without a valid digital signature”.

Issue with Nakivo web interface 10.9 in web browser

Even if Nakivo siuggests to use chrome or Firefox to use properly its web interface, we had problem using Chrome. We solved it using Microsoft Edge.

Links

Posted on

SQLSERVER – Backup on mapped drive

Scenario

You ar trying to backup a sqlserver db on mapped network drive. You have already mapped the drive in Windows and you can see that drive in Windows Explorer. You are not able to see the drive which is mapped when you open the backup procedure using SqlServer Managment studio.

Solution

First of all you not need the previous mapped network drive created by Explorer. You have to create this drive using SqlServer, and you’ll not be able to see it using Exploer.

Enable xp_cmdshell

You need to execute below to enable xp_cmdshell as its disabled by default due to security reasons. (Please turn off again once you done with the work)

Using SSMS execute thesse commands :

EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'xp_cmdshell',1
GO
RECONFIGURE
GO

After this you ‘ll have a positive reaction a this command that using SSMS you should use for testing previous operations :

EXEC XP_CMDSHELL 'Dir C:'

Map Network Drive

To map network drive you have to use the same command that you should use over Windows ysig command prompt :

'net use Z: \\networkShare\Test'

So, using SSMS you have to run the command

EXEC XP_CMDSHELL 'net use Z: \\networkShare\Test'

Now you should test this connection with the command

EXEC XP_CMDSHELL 'Dir Z:'

but, the most important goal, is tha you’ll be able to see teh drive Z during backup proceure over SSMS

Map Network Drive cmd – net use user password

The above command will work and completes successfully without asking the user to provide a username/password if the user has authorized access to this network share. If not, But the easy way is to use the “net use” command on the command prompt line explained above.

net use Z: \\networkShare\Test /u:domainname\username password

So, using SSMS you have to run the command

EXEC XP_CMDSHELL 'net use Z: \\networkShare\Test /u:domainname\username password'
Posted on

Velocità di un backup remoto

Per costruire un ambiente di backup si consiglia in letteratura di seguire la regola 3-2-1.

  • Fare 3 backup
  • Fare 2 backup su supporti diversi
  • Fare 1 backup in un altra sede rispetto ai dati di origine

Per eseguire la terza disposizione molto spesso pensiamo al Cloud; è un ottima soluzione ma i costi sono ancora abbastanza alti se parliamo di TB. Se invece dobbiamo salvare dei GB la soluzione è appetibile.

Per aziende che devono spostare TB di dati una soluzione può essere il backup in una sede remota, per esempio collegata con una vpn. I costi di salvataggio del dato saranno quindi assorbiti dai costi di acquisto di una unità NAS abbastanza capiente.

Cerchiamo di dettagliare una soluzione del genere.

Velocità del backup in vpn

La velocità del backup sarà determinata dalla velocita della connessione ad internet più lenta fra le 2 sedi. Supponiamo che le 2 sedi riescano a comunicare alla velocità di 300 Mb/s.

300 Mb/s = 300.000.000 b/s

300.000.000 b/s / 8 = 37.500.000 B/s = 37,5 MB/s

Per spostare 1GB di dati in una rete a 300 Mb/s impiegheremo 1.000 / 37,5 = 26,7 secondi

Per spostare 1GB di dati in una rete a 100 Mb/s impiegheremo 1.000 / 12,5 = 80 secondi

I software di backup hanno tutti la capacità di eseguire backup incrementali ma il primo backup che viene eseguito sarà, per forza di cose, molto lungo. Quindi va pianificato con attenzione.

Se vogliamo spostare una macchina virtuale da 20GB attraverso una rete a 300 Mb/s, impiegheremo circa 27 minuti. Impiegheremo 2 ore e 15 minuti per una macchina virtuale da 1TB.  I backup incrementali dei vari software presenti sul mercato, in condizioni “normali” di attività del server, consentono di arrivare per i backup successivi a tempi che equivalgono al 20% del primo backup.

Scelta del NAS di Backup

I dati della sede di origine vengono archiviati su Nas nella sede di destinazione. E’ chiaro che la scelta di un NAS dotato di una scheda ethernet a 10Gb/S non migliora un backup remoto di questo tipo visto che la velocita di trasferimento della vpn è minore di 1Gb/s.

I dischi del NAS potrebbero ulteriormente diminuire la velocità di copia ? Per rispondere diamo uno sguardo ad una tabella che cerca di dare un valore alle velocità di scrittura dei vari sistemi di dischi. Abbiamo prelevato i dati dal sito wikipedia per poi elaborarli.

Drive

(Type / RPM )

MB/s

(64KB block, random)

MB/s

(512KB block, random)

MB/s random

average

MB/s

(large block, sequential)

MB/s sequenzial

average

FC / 15 K 9.7 – 10.8 49.7 – 63.1 33,3 73.5 – 127.5 100,5
SAS / 15 K 11.2 – 12.3 58.9 – 68.9 37,8 91.5 – 126.3 108,9
FC / 10 K 8.3 – 9.2 40.9 – 53.1 27,9 58.1 – 107.2 82,65
SAS / 10 K 8.3 – 9.2 40.9 – 53.1 27,9 58.1 – 107.2 82,65
SAS/SATA / 7200 4.4 – 4.9 24.3 – 32.1 16,4 43.4 – 97.8 70,6
SATA / 5400 3.5 22.6 13,05 47,1 (estimate)
SSD 520 520

Normalmente i software di backup scrivono i dischi in maniera sequenziale, quindi, numeri alla mano, anche un hard disk sata 5400 potrebbe essere utile nel nostro scenario. Acquistare invece hard disk superiori ai 7200 rpm non porterebbe ad un miglioramento.

Posted on

How to check the execution of Microsoft Agent Backup

To check the outcome of Microsoft Azure Backup execution we can take advantage of the fact that, if the backup fails, some events are generated.

Prepare script to send email

Copy and paste the following code in a new file and modify it with your data (mail server, user, password, messages).

$SMTPServer = "YOUR SMTP SERVER"
$SMTPPort = "25"
$Username = "USERNAME TO ACCESS SERVER"
$Password = "PASSWORD"

$to = "Email recipient"
# $cc = "cc email recipient"
$subject = "Error Backup MyServer"
$body = "backup failed"
# $attachment = ""

$message = New-Object System.Net.Mail.MailMessage
$message.subject = $subject
$message.body = $body
$message.to.add($to)
# $message.cc.add($cc)
$message.from = $username
# $message.attachments.add($attachment)

$smtp = New-Object System.Net.Mail.SmtpClient($SMTPServer, $SMTPPort);
$smtp.EnableSSL = $true
$smtp.Credentials = New-Object System.Net.NetworkCredential($Username, $Password);
$smtp.send($message)
write-host "Mail Sent"

Save it as file with extension .ps1

Creating a new Task

  1. Open the Task Scheduler : Control Panel -> Administrative Tools -> Task Scheduler
  2. Right-click the “Task Scheduler Library” branch, and select the New Folder option.
  3. Type a name for the folder. For example, MyTasks.
  4. Expand the “Task Scheduler Library” branch, and select the MyTasks folder.
  5. Click the Action menu.
  6. Select the Create Task option.

Task to check Azure Backup

  1. In the Name field you can write something like “Check Micrososft Agent Backup”.
  2. Click the Triggers tab.
  3. Click the New button.
  4. Use the “Begin the task” drop-down menu to select “On a Event”
  5. Click custom option under the Settings section.

  1. Click the Edit Event Filter… button.
  2. Go the XML tab and at the bottom of the menu press the edit query manually button.
  3. Copy and paste the below XML and OK the changes.
<QueryList>
<Query Id="0" Path="CloudBackup">
<Select Path="CloudBackup">*[System[(Level=1 or Level=2) and (EventID=5 or EventID=10 or EventID=11 or EventID=12 or EventID=13 or EventID=14 or EventID=16 or EventID=18)]]</Select>
</Query>
</QueryList>
  1. Click the Actions tab.
  2. Click the New button.
  3. Browse on the previous powershel script
  4. Clicck OK to save the task

From now on, an email should be sent to you when the backup fails.

Posted on

Ghetto backup for all (part 1)

Why to use Ghetto ?

There are a lot of backup softwares for vmware virtual machine and some are free, but in a scenario it should not be possible to use one of these : for example, if you have vmware esx hosts with old versions (4.0,5.5).

Prepare connection to esx host  via SSH

Usually you get connection to esx host using vsphere client, but you have to use ghetto script directly inside esx operating system. So you need to operate using a prompt via ssh. Download, for example, putty : https://www.putty.org/

Install putty.

SSH port in esx host is number 22. To understand if this port is open, you could open a dos prompt and type

telnet your_esx_ip_address 22

you should recive some response.

Enable SSH on the ESX Host

By default SSH is disabled on an ESXi host.

  1. Open and login to the vSphere Client
  2. Click on the configuration tab and then on Security profile
  3. Click on Properties and Remote Tech Support (SSH)
  4. Click on Options and choose the startup policy.

ESX user for SSH

To connect to esx host via putty you need to create a user on esx. Open vsphere client.

  1. Log in to the vSphere Client as a root user.
  2. Click Users & Groups.
  3. Right-click on a blank area and click Add.
  4. Enter a username and password. Confirm your password.
  5. Select Grant shell access to this user.
  6. Select root group from the dropdown and click Add > OK.

 

How to upload script on esx

Ghetto script is a file and you will have to upload on esx server this file. To do this task we”l use for example WinSCP that is a free and open-source file transfer utility for Windows. It can be used to transfer files between a local and remote machine over SSH. You can download it from here : https://winscp.net/eng/download.php

Install it. Now you have all tools and we can start to work on Ghetto.

Ghetto script

First of all you need to download ghetto from github repository : https://github.com/lamw/ghettoVCB   

Unzip it. Open with an editor the file ghettoVCB.sh. You have to update only one line of script :

VM_BACKUP_VOLUME=/vmfs/volumes/mini-local-datastore-hdd/backups

That you have to substitute with the path of the datastore where you’ll save the backup of vm.

Two options to find the datastore path :

  1. Via vsphere client : you have to find the list of datastores. Using datastore’s name the path will be : /vmfs/volumes/DATASTORENAME
  2. Usng Putty connection : go in vmfs folder, volumes folder.

Prepare virtual machine list

If you ‘ll call ghetto script , you’ll backup all machines in your esx. Instead you can backup only some specific virtual machine. Create a new file, for example mylist.txt with the esactly name of each virtual machine to backup, in each line.

Upload Files to Esx

So you have two files (ghettoVCB.sh, mylist.txt) to upload in esx environment. To do this you can use WinSCP. When the Login dialog pops up click on New Site, enter the IP address in the hostname field, the username and password and then click Login.

WinSCP window is divided in two part : on the left side there is your computer, on the right side there is the esx environment. On esx, create a new folder and upload in it the two files.

Prepare ghetto script to execute

Double click on the PuTTY shortcut , enter the IP address of the ESX  and click Open. Enter the username and your password and you should now be connected.

To continue you need to have administrator (root) priviliges. Write

su -

and enter the password of root user.

Now you need to give execution privileges to .sh file. Navigate in the folder where you have put your files and write the command

chmod +x ghettoVCB.sh

Run the script

Write the command :

./ghettoVCB.sh -f mylist.txt -l output.txt

This command will backup all the virtual machines written in mylist.txt and will write the log of process in the file output.txt in the same folder.