Symptoms
If you need to upgrade or move an Azure-based SoftNAS instance, many of the steps will be familiar. Much like standard SoftNAS instances or virtual machines, there is no direct upgrade path for instances below version 3.4.9. If your version falls below this threshold, you will need to migrate your instance to a new VM. The steps below will help you do so:
Purpose
This article covers the steps required to migrate an Azure instance from one VM to another.
Resolution
The first step to migrating your Azure SoftNAS instance is to create the new host VM. The new host VM should mirror the settings of the original as closely as possible, save the version (as examples, select the same size of VM, provide the same network settings, etc.) Note the location of the certificate for your existing instance as it will be re-used. Click the folder icon by the certificate name to browse to the save location.
To create a new .pem file, if required, use the following command:
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout /etc/salt/azure.pem -out /etc/salt/azure.pem
To create a new .cer file, use the following command:
openssl x509 -inform pem -in /etc/salt/azure.pem -outform der -out /etc/salt/azure.cer
Set your new VM to the same virtual network, as well.
Important: Do NOT select the Ubuntu configuration extension.
Once the new host is created, the process is the same as any other SoftNAS VM migration. See Migrate SoftNAS on AWS from VPC to VPC within a Region for step by step instructions on how to migrate settings such as S3 and EBS disk information (if applicable), SAMBA and iSCSI settings, etc.
The quick and dirty version of the instructions are as follows:
1. Log in to the older VM, by copying the DNS name from Azure to your browser, then entering your softnas credentials as usual on the SoftNAS login screen.
2. Once logged into the SoftNAS UI, open Volumes and LUNs (from the Storage Administration pane), record the volume and pool name.
3. Open Storage Pools, and record relevant pool configuration information
4. Open Disk Devices, and record disk specific settings.
5. If your instance makes use of CIFS, open CIFS shares, and select Edit Config File. Copy the etc/samba/smb.conf
file for use on the new instance.
6. If using NFS, ssh into the azure instance, and use:
cat /etc/exports
This will provide information on your current NFS settings you can use to configure your NFS export on the new box. The information will look something like this:
/[pool_name]/[volume_name] *(async, no_subtree_check, no_root_squash, insecure, rw, nohide)
(remember, the above is just a sample, and the settings of your NFS export may be different)
7. Once settings have been recorded, you are ready to detach the disk.
Once ready to migrate your Azure instance, click Virtual Machines, select Disks, and note the name of the disk and the location URL of the disks associated with the original VM (those that do not say Linux).
8. Once you have noted the URLs, switch to Instances, and select the VM. Click Detach Disk.
9. A popup will appear, in which you can select the disk you wish to detach. If migrating more than one disk, you will have to repeat this process for each disk to be migrated. Click the checkmark to detach the disk selected.
10. Once the disk(s) are detached, open the new SoftNAS instance, via the same method described above (copy and paste the DNS to browser, then log in).
Return to Azure, and select the new instance, under Instances. Click Attach Disk.
11. Scroll up or down to find and select the disk from the previous instance. Click the check mark to proceed.
12. Return to the SoftNAS UI. If you click on Disk Devices, you will see the disk added to the instance.
13. As stated there is no direct upgrade path for VMs older than 3.3, and this includes ZFS. For this reason, an import from within the GUI is not the best path. So let us move to the command shell, where we can finish the process by upgrading ZFS, without affecting the data.
First, ssh into the azure instance.
ssh -i azure.pem
[softnas instance DNS name]
Type yes to confirm, if prompted.
14. To obtain the above disk information via the shell run the following commands:mount
lsblk -l
df -h
Run the following command to export pools:
zpool export -f <Each Pool Name or Names>
To verify that your pool or pools are added, use the command:
zfs list
To be sure they are online, and up to date, use:
zpool status [pool name]
With the above command you will also note that there is an alert, stating that ZFS is not up to date.
This is because ZFS is not up to date, as it is tied to the previous instance version.
15. To update ZFS, enter the command:
zpool upgrade [pool name]
You will see something like the following.
You can now also verify that your pool or pools are found and configured within the SoftNAS UI. Click Volumes and LUNS, to see the volume, and the pool it is associated with.
16. You can enter CIFS information from within the GUI, by going to CIFS Shares, then selecting Edit Config Files, and pasting the earlier copied smb.config file.
To do this via the command line, use:
scp
/etc/samba/smb.conf
softnas-instance-ip:/etc/samba/smb.conf
For NFS, use:
nano etc/exports
and copy in the saved NFS configuration settings from earlier.
/[pool_name]/[volume_name] *(async, no_subtree_check, no_root_squash, insecure, rw, nohide)
Restart the NFS service:
service nfs restart
Finally, if iSCSI is in use, the following can be used:
scp
/etc/target/saveconfig.json
softnas-instance-ip:/etc/target/saveconfig.json
Restart the iSCSI service:
sudo
service
fcoe-target restart
Your Azure instance is now fully migrated and configured.
Additional Information
See Also:
- Migrate SoftNAS on AWS from VPC to VPC within a Region
- Migrate SoftNAS on VMware vSphere
- MigrateSoftNAS on AWS to another Region
- How to Migrate from an AWS Marketplace-based instance to a BYOL licensing model instance