Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introducing XenServer 2/2 Monforte Salvatore CCR – Virtualization Tutorial Catania 1-3 December 2010.

Similar presentations


Presentation on theme: "Introducing XenServer 2/2 Monforte Salvatore CCR – Virtualization Tutorial Catania 1-3 December 2010."— Presentation transcript:

1 Introducing XenServer 2/2 Monforte Salvatore CCR – Virtualization Tutorial Catania 1-3 December 2010

2 XenServer Backups Backups it might be very useful to backup your VMs running on a Citrix XenServer Host/Pool there are several ways to perform VMs backups ▫ at a very high-level there are basically two categories of backups  cold backups ▫ VMs should be offline before taking the backup  hot backups ▫ VMs can be backed up without incurring in any downtime In addition XenServer provides commands for backing-up/restore ▫ host configuration ▫ pool configuration xe pool-dump-database file-name= xe pool-restore-database file-name= --dry-run xe host-backup file-name= xe host-restore file-name=

3 XenServer Backups Cold VM Backups Ensure that the VM to be backed up is offline Run the command ▫ this backup also backs up all of the VM's data  when importing a VM, you can specify the storage mechanism to use for the backed up ▫ this process backs up all of the VM data  it can take some time to complete In addition it is possible to backup only VM metadata ▫ Running the command xe vm-export vm= file-name= xe vm-export vm= file-name= --metadata

4 XenServer Backups Full metadata backup and disaster recovery Full metadata backups are based on the concept of Portable Storage Repositories (Portable SRs) ▫ contain all of the information necessary to recreate all the Virtual Machines (VMs) with Virtual Disk Images (VDIs) stored on the XenServer hosts and resource pools SR after re-attaching the SR to a different host or pool Portable SRs work by creating a dedicated metadata VDI within the specified SR ▫ this metadata VDI is used to store  copies of the pool and host database  metadata describing each VM's configuration ▫ as a result the SR becomes fully self-contained, or portable, allowing it to be detached from one host and re-attached to another as a new SR.  once the SR is re-attached a restore process is used to recreate all of the VMs on the SR from the metadata VDI For disaster recovery the metadata backup can be scheduled to run regularly to ensure the metadata SR is updated periodically

5 XenServer Backups The text console on the XenServer host provides the Backup, Update and Restore menu ▫ you can use these menu items to perform 3 operations  Schedule a regular metadata backup to the default pool SR, either daily, weekly or monthly ▫ regularly rotate metadata backups and ensure that the latest metadata is present for that SR without any user intervention  Trigger an immediate metadata backup to the SR of your choice ▫ will create a backup VDI if necessary, attach it to the host and backup all the metadata to that SR  use this option if you have made some changes which you want to see reflected in the backup immediately  Perform a metadata restoration operation  prompt you to choose an SR to restore from ▫ restoring only VM records associated with that SR ▫ all the VM records found

6 XenServer Backups Create and move a portable SR using Local Console and XenCenter ▫ On the source host or pool, within the Local Console  select the Backup, Restore, and Update menu option  select the Backup Virtual Machine Metadata option  select the desired SR ▫ within XenCenter  shutdown all running VMs with VDIs on the SR to be moved  select the SR to be moved and detach it  select forget to remove the SR record from the source host or pool  select the destination host/pool  create and reattach the storage ▫ within the Local Console on the destination host  select the Backup, Restore, and Update menu option  select the Restore Virtual Machine Metadata option  select the newly re-attached SR

7 XenServer Backups Hot VM Backups Basically XenServer provides two methods for creating hot VM backups ▫ manual snapshots / exports  through XenCenter or CLI ▫ scripted snapshots / exports  through XenAPI or CLI Snapshot are templates containing storage information and VM configuration ▫ two types of VM snapshots are supported  regular ▫ crash consistent and can be performed on all VM types, including Linux VMs  quiesced ▫ take advantage of the Windows Volume Snapshot Service (VSS) for services that support it, so that a supported application can flush data to disk

8 XenServer Snapshots Hot VM Backups via Snapshot Basically XenServer provides two methods for creating hot VM backups ▫ manual snapshots / exports  through XenCenter or CLI ▫ scripted snapshots / exports  through XenAPI or CLI ▫ requires additional knowledge of XenAPI and CLI Snapshot contains storage information and VM configuration ▫ two types of VM snapshots are supported  regular ▫ crash consistent and can be performed on all VM types, including Linux VMs.  quiesced ▫ take advantage of the Windows Volume Snapshot Service (VSS) for services that support it, so that a supported application can flush data to disk

9 XenServer Snapshots There are two possible locations where we can execute our scripts ▫ on the administration workstation with XenCenter installed ▫ VB Script for the logic ▫ Scheduled Tasks for the automation  the workstation should be always on to execute scripts  a network connection to the storage is required ▫ on the XenServer host ▫ Shell or Python scripts for the logic ▫ Linux CRONs for automation  the XenServer is (in most cases) always on  network connection to the storage is already in place

10 XenServer Snapshots Creating Hot VM Backups via Snapshot using the CLI Create the Snapshot ▫ with quiesce ▫ regular Remove the template flag from the Snapshot Export the Snapshot to backup share Delete Snapshot from XenServer host to save space on the SR xe vm-snapshot-with-quiesce vm= new-name-label= xe vm-unistall uuid= force=true xe vm-snapshot vm= new-name-label= xe template-param-set is-a-template=false uuid= xe vm-export uuid= filename=.xva

11 XenServer Snapshots Backups / Snapshot automation Before getting crazy start coding have a look to what the Citrix Community provides ▫ the first interesting scripts is from Jeff Riechers  Visual Basic Script  published on the Citrix Community Forun ▫ http://forums.citrix.com/thread.jspa?threadID=250128&tstart=0  very good documented and is configurable with parameters ▫ second script comes from Andy Burton  shell script  can be downloaded at the following URL ▫ http://www.andy-burton.co.uk/blog  very well documented and configurable using a configuration file  there are a lot of enhancements to this script on the Citrix Community Forum ▫ third scripts from Mark (?)  shell script  can be downloaded at the following URL ▫ http://www.markround.com/archives/61-Xenserver-snapshot-and-template-based- backup-script.html  very well documented configurable using both configuration files and custom fields

12 XenServer Snapshots Understanding Snapshots Snapshot behavior and storage consumption is determined by the type of storage repository (SR) used ▫ Volume-based  iSCSI and Hardware HBA Fiber Channel and local disks ▫ File-based  NFS Snapshot on Volume-based Storage Repositories ▫ Consider a 20GB iSCSI storage repositories ▫ Create a Linux VM with one 5 GB disk  in the iSCSI SR the entire 5 GB of space required by the VDI is consumed at the time it is provisioned

13 XenServer Snapshots ▫ After the snapshot is performed the storage consumption is reported as follows ▫ After deleting the snapshot the storage consumption does not change

14 XenServer Snapshots 5GB A UUID: 01D4… 1.2 GB A baseB 5GB UUID: 01D4… active C 0 GB snapshot After VM creation, the VM has one VDI of 5 GB ▫ VDI is thick provisioned and is assigned a UUID After snapshot is created, the following steps occur ▫ VDI A contains data up to the point of the snapshot  this VDI is deflated to conserve space ▫ UUID remapping from A to B occurs ▫ VDI B becomes the active node ▫ VDI C is empty  except for VHD header information After the snapshot is deleted, the following steps occur ▫ VDI C is deleted ▫ VDI A does not change  continues to have data up to the point of the snapshot  even though the snapshot was technically deleted ▫ VDI B continues to be used for writes 1.2 GB A base B 5GB UUID: 01D4… active

15 XenServer Snapshots Snapshot on File-based Storage Repositories ▫ Consider a 20GB NFS storage repository ▫ Create a Linux VM with one 5 GB disk  in the NFS SR the 5 GB of space required by the VDI is thin provisioned

16 XenServer Snapshots ▫ After the snapshot is performed the storage consumption is reported as follows ▫ After deleting the snapshot the storage consumption returns back to what it was before the snapshot was taken

17 XenServer Snapshots 176 MB A UUID: 2E1F… 176 MB A base B UUID: 2E1F… active C 0 GB snapshot After VM creation, the VM has one VDI of 5 GB ▫ VDI is thin provisioned and is assigned a UUID  only the space required is actually allocated After snapshot is created, the following steps occur ▫ VDI A contains data up to the point of the snapshot ▫ VDI B and C are empty  except for VHD header information ▫ UUID remapping from A to B occurs After the snapshot is deleted, the following steps occur ▫ VDI C is deleted ▫ VDI A does not change  continues to have data up to the point of the snapshot  even though the snapshot was technically deleted ▫ VDI B continues to be used for writes  will grow over time 176 MB A base B 5GB UUID: 2E1F… active

18 XenServer SnapshotsA base C snapshot Coalescing scenarios XenServer includes the ability to collapse VDI chains ▫ eliminate redundant nodes that result from creation and deletion of snapshots This process is known as coalescing ▫ occurs as a background process Consider a VM having two snapshot ▫ VDI C and VDI E When snapshot C is deleted ▫ parent B is no longer required  will be coalesced into A B base D active snapshot E A base B D active snapshot E A+B base D active snapshot E

19 XenServer Snapshots If the remaining snapshot E is deleted ▫ VDI B and coalesced VDI A+B remains When snapshot G is subsequently taken ▫ parent D is coalesced into A+B  three VDIs will exist for the VM at this A+B base D active A+B base F active D base snapshot G A+B+D base F active snapshot G

20 XenServer SDKs SDKs XenServer includes a XML-RPC based API ▫ providing programmatic access to the extensive set of XenServer management features and tools XenServer API can be called from a remote system as well as local to the XenServer host ▫ remote calls are generally made securely over HTTPS There are five SDKs available, one for each of C, C#, Java, PowerShell, and Python ▫ provided under an open-source license  LGPL or GPL with the common linking exception  this allows use (unmodified) in both closed-and open-source applications ▫ http://community.citrix.com/display/xs/Download+SDKs There are also several example code samples also provided for download ▫ demonstrate creating a VM ▫ running VM power operations ▫ and watching for events

21 XenServer SDKs XAPI objects class diagram


Download ppt "Introducing XenServer 2/2 Monforte Salvatore CCR – Virtualization Tutorial Catania 1-3 December 2010."

Similar presentations


Ads by Google