ShinobiRen Posted 3 hours ago Posted 3 hours ago (edited) Hello everyone! I wanted to setup a secondary server - one for testing to break things and one for a more stable NAS environment that I will wait for HexOS to support updates and etc. To do this I needed to get some things off of my test server - primarily my VMs that I had created. Here is how I setup replication and moved the VMs. Hope you find this useful! 1. Find the VM you would like to move. 2. TrueNAS should be able to make the connection to the other server but it sometimes (frequently) fails to do so, so I will dive into how to do it manually. 3. Setup the backup credentials on the server you are transferring from. In my case this is my 01 server. 1. Navigate to Credentials > Backup credentials on the left side: 2. In SSH Keypairs section click the Add button 3. Give your keypair a name and click the Generate Keypair button: 4. Copy your Public Key. You will need this on your new server. 4. Setup the keypair on your new server. 1. Navigate to your new server and Credentials > Users 2. Select the user you will be using to do your ZFS replication task and click Edit 3. In the Authentication section of the edit dialog for the user you should see "Authorized Keys". This is where you will paste your public key that you generated. 4. Scroll down and check the box that says "Allow all sudo commands" and "Allow all sudo commands with no password". 5. Time to setup the SSH link on your primary server. Navigate back to it. 5. On the primary server navigate back to Credentials > Backup Credentials and click Add on SSH Connections 6. In the new dialog give it a name, change the Setup Method to Manual, and fill out the rest of this information (including selecting the Private Key you generated): 7. Once you select your Private Key you can click the Discover Remote Host Key button. 8. Click Save. Now it is time to generate a replication task. 9. Navigate to Data Protection on the left side and click Add on Replication Task: 10. Fill out this information and click Next: 11. When you select your SSH credentials this dialog opens. Select "Use Sudo for ZFS Commands" or check the box with the arrow above. 12. If you have snapshots for VMs you can select "Recursive" to copy those snapshots over. 13. Keep your name that TrueNAS generates for you or rename it to something else and click Next. 14. In the When section I selected "Run Once". 15. Save it and the replication will start. If on the same network it is incredibly fast - Moved two VMs roughly 120 GB in less than 5 minutes. 16. Verify on your new server the zVOL disks you copied over are present and recreate your virtual machines as you would setting up a new VM, linking the VirtIO disks you just replicated. Edited 3 hours ago by ShinobiRen Image appended to the end of the instructions. I will figure this out eventually... 1 Quote
Sonic Posted 3 hours ago Posted 3 hours ago Thank you for this guide! @Dylan, can we add this one to the guides page? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.