Jump to content


Photo

Move VM from local storage to NFS

Started by Alessandro Corbelli , 11 October 2017 - 08:45 AM
13 replies to this topic

Alessandro Corbelli Members

Alessandro Corbelli
  • 137 posts

Posted 11 October 2017 - 08:45 AM

Is possible to move a running VM from local storage to NFS ?

Is downtime needed or migration would be online ?

 

Which format is used to store images on NFS and how can I "import" the VM on another host, connected to the same NFS server, if current server should fail ?



Alan Lantz Members

Alan Lantz
  • 7,399 posts

Posted 11 October 2017 - 01:29 PM

That depends on your version of XenServer, I think version 6.2 and above can do storage migrations. XenServer uses the vhd format for storing vdi's.  Be sure you have a backup of your VM just in case. Moving from local to NFS is simple. Depending on your XenServer version there could be important hotfixes that really should be applied before you do a storage migration.

 

For a disaster situation having two servers in the same pool or preferably three servers so you could enable HA would be best. Use XSConsole to schedule a metadata backup. If you want to use another host if current server fails you can install XenServer and reattach to the NFS server and then import your metadata backup and be back in business.

 

--Alan--



Tobias Kreidl CTP Member

Tobias Kreidl
  • 18,831 posts

Posted 11 October 2017 - 04:41 PM

The file format and storage will be the same. The only difference is that when on NFS, it will automatically be thinly provisioned.

If you move it back to local storage, it will revert to thick provisioning. Importing/exporting files in either direction is transparent.

You can also just move the VDI in newer versions of XenServer, so need to even move the VM. And, yes, I believe XS 6.2 is when storage Xenmotion was introduced. What version of XS are you running?

 

-=Tobias



Alessandro Corbelli Members

Alessandro Corbelli
  • 137 posts

Posted 11 October 2017 - 05:20 PM

The file format and storage will be the same. 

 

File and format can't be the same, as i'm using LVM, thus there isn't any "file"



Alan Lantz Members

Alan Lantz
  • 7,399 posts

Posted 11 October 2017 - 06:01 PM

With LVM you have Volume Groups that contain Physical Volumes that then contain Logical Volumes. I assure you within those logical volumes you can contain file systems and then files. 

 

-Alan--



Tobias Kreidl CTP Member

Tobias Kreidl
  • 18,831 posts

Posted 11 October 2017 - 06:09 PM

I meant as far as the exported VM file format is concerned. Of course, LVM is block based and NFS is file based. Sorry for not being more specific. My intention was to say that the VM can be moved transparently between these different SRs. The provisioning (thick vs. thin) will of course be different, depending on how the provisioning on the SR is structured.

 

-=Tobias



Alessandro Corbelli Members

Alessandro Corbelli
  • 137 posts

Posted 11 October 2017 - 06:12 PM

With LVM you have Volume Groups that contain Physical Volumes that then contain Logical Volumes. I assure you within those logical volumes you can contain file systems and then files. 

 

-Alan--

 

Sure, but I was referring to file-format used on NFS server, not FS inside each LV.



Alan Lantz Members

Alan Lantz
  • 7,399 posts

Posted 12 October 2017 - 06:03 PM

As far as I know the the vhd format on NFS SR's and the vhd's on LVM SR's are the same. 

 

--Alan--



Tobias Kreidl CTP Member

Tobias Kreidl
  • 18,831 posts

Posted 12 October 2017 - 09:34 PM

Yes, but actually the LVM layer is -- believe or or not -- optional when using NFS on XenServer. You can, in fact, because of this bypass the need to use an SR altogether. However, normally, each VDI is a separate VHD and treated as such regardless of the type of SR, and in the case of NFS, there is the native underlying file system. A VDI is actually a file under NFS at the same time as being a VHD.

 

-=Tobias



Alan Lantz Members
  • #10

Alan Lantz
  • 7,399 posts

Posted 13 October 2017 - 01:53 PM

If you bypass the SR altogether how does locking work for a pool ? 

 

--Alan--



Tobias Kreidl CTP Member
  • #11

Tobias Kreidl
  • 18,831 posts

Posted 13 October 2017 - 02:18 PM

Each file is dealt with individually, so it doesn't matter. There's only one connection per VM and the file locking takes care of it. XenMotion also works fine, even across pools as long as other pools also have access to that NFS share, as no data actually get moved, just the VM and its memory. Curious, isn't it? :)

 

-=Tobias



Alan Lantz Members
  • #12

Alan Lantz
  • 7,399 posts

Posted 13 October 2017 - 03:25 PM

Very curious. So its possible to eliminate the need for SR's, at least with NFS. It should be possible then with iSCSI. 

 

--Alan--



Tobias Kreidl CTP Member
  • #13

Tobias Kreidl
  • 18,831 posts

Posted 13 October 2017 - 04:37 PM

Yes, in fact, I did that with iSCSI over six years ago. We needed at the time around 12 separate VDIs and that was not supported, so I just created direct iSCSI connections from individual VMs. Also, iSCSI performance was not all that great via an SR.

 

The network traffic still flows through XenServer, but doesn't use an SR at all and maps directly to the storage device. XenMotion works with it, as well.  See:  https://discussions.citrix.com/topic/289937-some-benchmarks-for-a-xenserver-using-a-pooled-sr-and-assigned-vdi-vs-using-open-iscsi-for-a-direct-vm-connection-to-storage-on-an-md3600i-iscsi-device/

 

-=Tobias



Alan Lantz Members
  • #14

Alan Lantz
  • 7,399 posts

Posted 13 October 2017 - 04:57 PM

sorry, we kinda got off topic.

 

--Alan--