12
Version 2.0 June 26, 2013 Page 1 Unidesk Appliance Move Utility Summary Moving a Unidesk Cachepoint (CP) from one datastore to another using standard VMware tools is problematic because the layers created by the CP are non-persistent independent disks. If these are moved with a storage vMotion they will be transformed into normal disks attached to the CP and all the desktops using the CP will have the wrong path to the layer files. Also they will all be converted from Thin to Thick disks during the move. The Unidesk Appliance Move Utility provides a mechanism to perform any of the following tasks 1. Copy the CP Appliance and layer vmdk files within a CP to a new VMware datastore 2. Move the Boot Image Datastore to a New datastore – This can be performed by itself or along with a full move of the CP. 3. Copy the MA appliance to a new Datastore – Note this is of little value as this appliance can be Storage vMotioned. 4. Appliances and desktops can be synchronized to a backup or DR datastore. This is the reason the MA was included in the utility. If the “Synchronize” option is used, then your primary MA, MCP and CPs can be synchronized on a scheduled to a backup version and only modified layers will be copied as well as a full version of the appliances and boot layers. This can be used to backup the MCP with shorter backup times than our MCP Backup utility or to keep a primary and DR version of the MA, MCP and Secondary CPs.. During this process the CP virtual machine will be shut down prior to the copy and started up after the copy. This ensures that the appliance will be safely processed. If boot drives are included the desktops will also be shut down. For the MA you have a choice to shut down the MA prior to the copy or create a snapshot for the backup. If you choose to not shutdown the appliance before the copy, the appliance copy will be left in a “Crash Consistent” state which means that it is the same as if you powered off a server with the power button. This is because a snapshot is taken, then the VM’s files are copied directly from the source but the snapshot is not copied. Requirements and Limitations In order to use this utility you require: A VMware vCenter Administrator Account The backup and destination datastores must be accessible from at least one host defined in vCenter Windows 7 Client or Windows 2008 R2 Server to run the utility VMware PowerCLI 5 installed Mail Relay to receive warning and status email messages What’s New in Version 3.0 The functionality to move secondary CPs and their Desktops was added in this release.

Unidesk Appliance Move Utilityvirtualdesktopmanagement.net/scripts\Unidesk MCP Move Documenta… · Version 2.0 June 26, 2013 Page 1 Unidesk Appliance Move Utility Summary Moving

Embed Size (px)

Citation preview

Page 1: Unidesk Appliance Move Utilityvirtualdesktopmanagement.net/scripts\Unidesk MCP Move Documenta… · Version 2.0 June 26, 2013 Page 1 Unidesk Appliance Move Utility Summary Moving

Version 2.0 June 26, 2013 Page 1

Unidesk Appliance Move Utility

Summary

Moving a Unidesk Cachepoint (CP) from one datastore to another using standard VMware tools is problematic because the layers created by the CP are non-persistent independent disks. If these are moved with a storage vMotion they will be transformed into normal disks attached to the CP and all the desktops using the CP will have the wrong path to the layer files. Also they will all be converted from Thin to Thick disks during the move.

The Unidesk Appliance Move Utility provides a mechanism to perform any of the following tasks

1. Copy the CP Appliance and layer vmdk files within a CP to a new VMware datastore

2. Move the Boot Image Datastore to a New datastore – This can be performed by itself or along with a full move of the CP.

3. Copy the MA appliance to a new Datastore – Note this is of little value as this appliance can be Storage vMotioned.

4. Appliances and desktops can be synchronized to a backup or DR datastore. This is the reason the MA was included in the utility.

If the “Synchronize” option is used, then your primary MA, MCP and CPs can be synchronized on a scheduled to a backup version and only modified layers will be copied as well as a full version of the appliances and boot layers. This can be used to backup the MCP with shorter backup times than our MCP Backup utility or to keep a primary and DR version of the MA, MCP and Secondary CPs..

During this process the CP virtual machine will be shut down prior to the copy and started up after the copy. This ensures that the appliance will be safely processed. If boot drives are included the desktops will also be shut down. For the MA you have a choice to shut down the MA prior to the copy or create a snapshot for the backup. If you choose to not shutdown the appliance before the copy, the appliance copy will be left in a “Crash Consistent” state which means that it is the same as if you powered off a server with the power button. This is because a snapshot is taken, then the VM’s files are copied directly from the source but the snapshot is not copied.

Requirements and Limitations

In order to use this utility you require:

• A VMware vCenter Administrator Account

• The backup and destination datastores must be accessible from at least one host defined in vCenter

• Windows 7 Client or Windows 2008 R2 Server to run the utility

• VMware PowerCLI 5 installed

• Mail Relay to receive warning and status email messages

What’s New in Version 3.0

The functionality to move secondary CPs and their Desktops was added in this release.

Page 2: Unidesk Appliance Move Utilityvirtualdesktopmanagement.net/scripts\Unidesk MCP Move Documenta… · Version 2.0 June 26, 2013 Page 1 Unidesk Appliance Move Utility Summary Moving

Version 3.0 January 7, 2014 Page 2

What’s New in Version 2.5

In this version we changed the way we copy vmdk files making the utility work against vCenter rather than against a particular host. This has several benefits:

1. Now it does not matter which host the appliances are on and they do not need to be on the same host

2. The copy will work between two hosts with local datastores as long as they are both in the same vCenter

3. We also look up the source datastore and folder rather than requiring it be entered.

One drawback to the new way of copying files is that you can no longer use this version of the utility to copy thick vmdk files back to thin if you moved them with the VIC browser and they were expanded. You can still use the 2.1 version to shrink the files when moved.

How it works

The utility has an HTA application acting as the front end interface to several PowerShell/PowerCLI scripts. The application calls the scripts passing configuration information and the scripts carry out the backups on vCenter.

What is the Process?

This utility can be used to copy a CP appliance virtual machine and the shared CP layers which include OS layers and Application layers as well as the UEP and Boot disks. You can also copy the Management Appliance virtual machine.

The basic processing of the utility is as follow:

1. Copy the Shared Layers

2. Migrate Desktop Boot Drives for all desktops

a. Shutdown Desktops

b. Remove All Hard Disks except the boot disk

c. Storage vMotion the Desktops to the Target Datastore

d. Reattach All the Hard Disk from the appropriate location

i. Note if only moving boot drives the layer disk have not moved. If relocating the CP the layer disks are on the new datastore

e. Desktop will remain shut down until an admin modifies the Unidesk Configuration and starts them again.

3. Copy the CP Appliance

4. Copy the MA Appliance

If the synchronize configuration is used the boot drive files are copied rather than using storage vMotion to move them. Files are copied using the same format they start in.

Page 3: Unidesk Appliance Move Utilityvirtualdesktopmanagement.net/scripts\Unidesk MCP Move Documenta… · Version 2.0 June 26, 2013 Page 1 Unidesk Appliance Move Utility Summary Moving

Version 3.0 January 7, 2014 Page 3

Installing and Setting up the Utility

The first thing you must do to use the utility is to download and install the VMware PowerCLI software onto your backup console machine. This link will take you to the download page at the time this document was written:

http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/powercli?rct=j&q=vmware%2520powercli&source=web&cd=1&ved=0CC8QFjAA&url=http://www.vmware.com/go/PowerCLI&ei=CkKQT6yUM_Kd6AGvj-GlBA&usg=AFQjCNHixkgPGjBKVx5ZnJKrGXx0ba-y_g

Installation of the utility is very easy. Create a folder in a path with no spaces for example c:\MoveCP. Unfortunately spaces make it hard to include in a cmd file if you want to schedule a task to run the backup regularly. Then unpack the source zip file into this directory. Before unpacking check the properties of the zip file to see if they may be blocked as shown on the right. If they are click unblock. This will unblock all of the files as long as you unblock the zip before you extract the files.

Then Open the executable and you will see the following screen.

The table at the top is used to configure the settings required to run the utility. The information is split into sections as follows. Note the plus signs toggle the section between hidden and visible.

Section 0 Utility Usage

The utility can be used to move the MA and a CP to a new datastore or to continuously synchronize the MA and a CP between two datastores. Choose the appropriate option.

Page 4: Unidesk Appliance Move Utilityvirtualdesktopmanagement.net/scripts\Unidesk MCP Move Documenta… · Version 2.0 June 26, 2013 Page 1 Unidesk Appliance Move Utility Summary Moving

Version 3.0 January 7, 2014 Page 4

Section 1 Connection Information

Enter vCenter Server FQDN and the root password and click Save Credentials. This will create a file in the source directory called cred.xml as shown here. The password is encrypted based on the logged in user and the desktop and cannot be moved to another machine or used by another login. Therefore if you choose to run the synchronization as a scheduled task you must be logged on as the user you will define to run the scheduled task on the machine that you will run the scheduled task when you create the cred file.

Then select the vCenter Datacenter you are using for Unidesk and Get VMs and Datastores.

Section 2 Included in Move/Sync

Here you define what you want to move. The options include

• The MA Appliance

• A CP Appliance and its shared layers

• A CP’s Desktop Boot Files

• Only the Boot Files without anything else. This lets you move boot files to an alternate datastore from the CP layers.

You can also define whether or not you want to shut down the MA before the move or use a snapshot. If this is a one-time copy we recommend shutting down the MA.

Note if the MA is shutdown during this process this can interrupt other management tasks the MA performs such as desktop backups.

Page 5: Unidesk Appliance Move Utilityvirtualdesktopmanagement.net/scripts\Unidesk MCP Move Documenta… · Version 2.0 June 26, 2013 Page 1 Unidesk Appliance Move Utility Summary Moving

Version 3.0 January 7, 2014 Page 5

Section 3 Appliance Information

Here you enter the Information for the CP and MA appliances.

Section 4 Run in Test Mode Only

If you check this box the utility will be run through but no changes will be ot the datastores. Appliances and desktops will be shut down and re-started (if synchronizing). This provides a way to test what will happen without doing it.

Saving the Configuration

When the configuration is complete save by pressing the Save Configuration button after item 3. This will update the and create a text file in the source directory called config.txt and this configuration will be loaded whenever you open the utility.

Section 5 Scheduled task Information

This section allows you to create a scheduled task on the machine you are running the utility on. It is very important to choose appropriate times for the synchronization. This utility will shut down the MCP when it runs and can be configured to shut down the MA. If these appliances are performing rebuild activities when they are shut down there could be unintended consequences. Try to schedule the task to run when you are not performing other administrative tasks with the MA or MCP.

Choose whether to run the task daily or weekly, if weekly select the day of the week. Define the time to start the task and the account to run the task under. Remember that you must create the cred.xml file using the same account on the same desktop that will run the task or it will not be able to decrypt the password to connect to the host.

If you use a domain account use Domain\account if local use Desktop Name\account.

Page 6: Unidesk Appliance Move Utilityvirtualdesktopmanagement.net/scripts\Unidesk MCP Move Documenta… · Version 2.0 June 26, 2013 Page 1 Unidesk Appliance Move Utility Summary Moving

Version 3.0 January 7, 2014 Page 6

If you want to have a different schedule than daily or weekly, create the task then go into the Task Scheduler and change the schedule.

To create the task press Create Task.

Section 5 Email Configuration

This section is used to configure mail relay settings and a warning email. If mail is configured, the utility will send a warning message when starting the backup process. Based on item E below the utility will wait “x” minutes before starting the backup. This will allow the administrators to cancel the backup if they determine that shutting down the MCP and optionally the MA will cause issues with current activity. The value for “x” can be 0,5,10,20, or 30 minutes. The default value is 10 minutes. If this section is configured the application will also mail the backup log following the backup.

To configure and use this functionality enter the appropriate mail relay and mail address information. Relays have different requirements. If the relay is “open”, then the “From Address” can be any desired text string; it does not have to be a real email address, though it can be. If the relay requires authentication, check the “Use Auth” and if you want to use ssl, check the ”Use SSL” box in D and enter the account and password. Typically these will be the Active Directory Account and Password.

In either case, enter the “To Address” information which can be a single address or multiple addresses delimited using a comma.

Modify F and G as appropriate. In the body be sure to modify the wait time to match what is chosen in E. It is also advisable to add which machine the backup is running on. The message body is html. Therefore normal html tags can be used for bold (<b></b>) and line breaks (</br>) etc. When saved any CRLF entries will be replace by a </br>.

When the settings are completed press the “Save Config” then Test the email. This will save the configuration to a text file and send a test email. Ensure the test email is successful. If a password is used it is saved in encrypted form based on the logged in user. Therefore the settings must be made and saved using the account that will run the backups just like section 1.

Page 7: Unidesk Appliance Move Utilityvirtualdesktopmanagement.net/scripts\Unidesk MCP Move Documenta… · Version 2.0 June 26, 2013 Page 1 Unidesk Appliance Move Utility Summary Moving

Version 3.0 January 7, 2014 Page 7

Working with the Move Appliance Utility

At the bottom of the utility page there is a button labeled “Run Copy”. If you are using the utility to move to a new datastore just press this to run the utility. This can also be used to synchronize on demand if using the Synchronize option.

The following is an example of a log file.

The log files are never removed automatically so they will grow in the source directory. Keep them or remove them as desired.

The Log will show all the files and folders added or removed from the target datastore as well as the size of the source and target files. The size is split into appliances and layers.

If the email relay is configured logs will be emailed to the address list after each synch. If any errors are logged during the process this will be noted in the status email and the errors shown in the log file.

Stopping a Running Job

A running job can be stopped by either closing the PowerShell CMD window or stopping the scheduled task depending on whether the utility was started interactively or as a task. Remember the copy commands are running on the vCenter server and when you stop the utility the last task started will run until it finishes on there. If desired the task can be cancelled by accessing vCenter using the VIC.

One more note if the job is running as a scheduled task it creates a flag file in the script directory that says Synch_Running.txt. If this file exists you cannot start an interactive copy. If you cancel the job you must manually delete this file.

Page 8: Unidesk Appliance Move Utilityvirtualdesktopmanagement.net/scripts\Unidesk MCP Move Documenta… · Version 2.0 June 26, 2013 Page 1 Unidesk Appliance Move Utility Summary Moving

Version 3.0 January 7, 2014 Page 8

MA Snapshots

If you do not check to shut down the MA appliance before the backup is taken the script will create a snapshot of the appliance before copying the disk files. If you look at the snapshot manager after the snapshot has been taken it will look similar to this. If you see a snapshot when no synchs are running you should troubleshoot why it would still be there and delete it using the VIC.

Detailed Direction on Using the Utility

These directions are for moving a CP and optionally an MA to another datastore in the same vCenter.

1. Configure and Run the Move Appliance Utility

2. Remove the old MA/and or MCP from inventory if they are still there.

3. Add the New Machines to inventory

a. Note if you move desktops to a new vCenter you will need to add all the desktops back into inventory. I

hope to create a script to make this easier.

4. Start the MA

5. Fix the network interface (if required – only if you cannot ping the interface)

6. Reboot MA

7. Edit MA properties in Unidesk to allow new host and new datastore for Unidesk

8. Synchronize Infrastructure

9. Edit CP Properties in Unidesk to define proper storage if the Boot Drive Location has changed

10. Start CP

11. If required Edit the NIC interfaces

12. Reinstall Install Machines

Here we will define each step in more detail:

1. Configure the Move Appliance Utility to define the credentials, sources and target datastores as outlined above.

a. Click Save Configuration to save all settings

2. Then perform the “Run Copy”. This will copy all of the MA, CP and layer files, and Desktop Files to the new datastore.

3. Remove the old appliances from Inventory.

4. Then Add the new appliances to Inventory by Browsing to their vmx file using the VIC Datastore Browser, right clicking and selecting add to inventory. Use the same name within vCenter you had before.

5. Power on the MA. You will be prompted to say whether this system has been moved or copied. Choose moved.

6. If required (if you can’t ping the appliance). Edit the Ethernet rules file the MA using the vCenter Console. You will know this is required if the NICs on the appliance does not start.

Page 9: Unidesk Appliance Move Utilityvirtualdesktopmanagement.net/scripts\Unidesk MCP Move Documenta… · Version 2.0 June 26, 2013 Page 1 Unidesk Appliance Move Utility Summary Moving

Version 3.0 January 7, 2014 Page 9

a. vi /etc/udev/rules.d/70-persistent-net.rules

b. Delete the first block entry and

change the eth1 to eth0 in the second

block

c. The resulting file will look like the

figure here

7. Reboot the MA; let the MA fully start up.

8. Modify the Management Appliance Properties to allow the new datastore for the new host and remove the datastore for the old host if it will no longer be used.

9. Log onto the UDMC and synchronize Infrastructure to re-acquire the VM-ID for the Master CP which will have changed because we added the VM back to inventory.

a. Synchronize Infrastructure is accessed from the “Management Appliances” Action Menu. When you run the utility it matches up Unidesk MM’s and CP’s to their VM-ID’s. Note if you do not remove the original appliance VM’s from inventory the synchronization will fail.

b. After it analyzes the information click next to see the following screen. It should find the MCP, select the check box to remap.

10. Logon to the UDMC and modify the Master CP Properties to enable the new datastore for the new host.

Page 10: Unidesk Appliance Move Utilityvirtualdesktopmanagement.net/scripts\Unidesk MCP Move Documenta… · Version 2.0 June 26, 2013 Page 1 Unidesk Appliance Move Utility Summary Moving

Version 3.0 January 7, 2014 Page 10

11. Power on the CP. You will be prompted to say whether this system has been moved or copied. Choose moved.

12. If required Edit the eth0/1 interface as in step 8 for the CP

13. Remove and Reinstall Install Machines if necessary

Now the recovery should be complete.

Installation Machines

After recovery you should delete and recreate your installation machines.

Page 11: Unidesk Appliance Move Utilityvirtualdesktopmanagement.net/scripts\Unidesk MCP Move Documenta… · Version 2.0 June 26, 2013 Page 1 Unidesk Appliance Move Utility Summary Moving

Version 3.0 January 7, 2014 Page 11

Moving to a New vCenter

Moving to a new vCenter is much more complicated especially as it is often performed in conjunction with changing the IP address of the appliances. It is even more complicated if you want to move desktops with a CP.

The general process is as follows:

1. Remove any installation machines or desktops from Source MCP 2. Shut down your appliances gracefully 3. Attach/create the new datastore(s) to at least one host in the source vCenter 4. Run the move to copy the ma and mcp to the new datastore 5. Reconfigure and run the move again to move any other CPs 6. Disconnect the datastore(s) from the old vcenter/hosts 7. Add the datastore to the new vcenter for each host 8. Appliance Names

a. It works much easier to keep the appliance names the same b. If they must change for example when moving from a lab to production some database manipulation

may eb required as well as changes to the appliances themselves. c. A and PTR records must be added in DNS for New Appliance Names if they are changing

9. Add the MA VMX file to inventory use the new Name in vCenter 10. Add MCP vmx file into inventory with new Name in vCenter 11. Add any other CPs to inventory 12. If also adding desktops you will need to create a powercli script to add all the desktops to inventory. (I hope to

create this soon). 13. Change the Appliance’s vLan 14. Start the MA and change the IP address using the console setup command by logging in as “administrator” with

a password Unidesk1 (Note if that does not work try your UDMC administrator password) 15. Open the rpath interface to the MA using http://MA IP Address:8004 Account “administrator” with a password

Unidesk1 (Note if that does not work try your UDMC administrator password) 16. Select set BLWS host and change to the new MA IP Address 17. Select configuration>configure networking and change hostname and DNS settings and IP settings 18. Save 19. Reboot the MA 20. Start the MCP and change the IP address using the console setup command by logging in as “administrator”

with a password Unidesk1 (Note if that does not work try your UDMC administrator password) 21. Open the rpath interface to the MCP using http://MCP IP Address:8004 Account “administrator” with a password

Unidesk1 (Note if that does not work try your UDMC administrator password) 22. Select set BLWS host and change to the new MA IP Address 23. Select configuration>configure networking and change hostname and DNS settings and IP settings 24. Save 25. Reboot the MCP 26. Do the same for any other CPs 27. Configure the permissions and role for the Unidesk user in vCenter

a. Can be Administrator at the root of the vCenter or can follow more specific acl directions in deployment guide.

28. Open the UDMC 29. Goto System 30. Select the MA in the table then choose Set Up Infrastructure in the Action Menu 31. Enter the information to attach to the new vCenter 32. Edit the MA properties and select all appropriate Datacenter, hosts and storage 33. Edit MCP and CP properties and select the correct hosts and storage. If using DRS select all hosts in the

cluster with the correct storage. 34. Synchronize Infrastructure. should find the MCP, CPs and Desktops and offer to remap. If it does not, we need

to edit the CacheAppliance table in MAData to set the MAC address and/or the VM name if the VM was ever

Page 12: Unidesk Appliance Move Utilityvirtualdesktopmanagement.net/scripts\Unidesk MCP Move Documenta… · Version 2.0 June 26, 2013 Page 1 Unidesk Appliance Move Utility Summary Moving

Version 3.0 January 7, 2014 Page 12

renamed. We always search for the original VM name in Sync Infrastructure. So if Sync Infrastructure does not offer to remap, open a support case.

35. Restart the MCP and any other CPs 36. Import the Cachepoint template form the installation media using OVA file 37. Goto SYSTEM>Settings and configuration and add the template 38. Create New Installation Machines 39. Test adding a version to a layer 40. Create a New Secondary CP 41. Install the UniVIA software on one or more connection severs and configure View in System>Settings and

Configuration 42. Test creating a new Desktop