PTC Software
Clone Windchill

This is a follow-up post on the Presentation given by Shawn Lothrop, Boston Engineering's IT Director, on June 4th, 2012 at Planet PTC on Cloning Windchill in Minutes.  The Presentation and administration scripts can be downloaded from the links below.  All sample files and scripts used in the presentation demo are included in the BEC Windchill Cloning Toolkit.

Clone Windchill in Minutes Presentation: Download

BEC Windchill Cloning Toolkit V1: Download

Steps to Clone Windchill with Virtualization and Reverse Proxy

1. Create Windchill Appliance

Create the Virtual Machines, VMs, that will make up your Windchill system and store the set of VMs in your virtualization infrastructure. A monolithic setup will have only one VM, while a multi server system will have a VM for each separate Windchill component.  The VM(s) can be created by converting physical systems, clone existing VM(s), or installing a fresh Windchill environment. The VM(s) should be configured as described below.

In order to gain the full benefits of cloning Windchill in a virtualized environment, it is highly recommend that a unique database VM is used in your Windchill Appliance.  Attempting to leverage a shared instance of Oracle or SQL Server will reduce, or eliminate, the benefits of virtualization.

i) Dedicated VM or Windchill Application VM: Install Proxy Apache

Install a second Apache service on your Windchill application server or on a new VM.  If two Apache services are installed on the same VM be sure the Windchill Apache service is listening to a non-default port such as 8880.  To setup the new Apache service as a Windchill Reverse Proxy, update the sample windchill_proxy.conf file by replacing "windchill.mydomain.com" with the Windchill application hostname and include the new configuration file in your Reverse Proxy Apache httpd.conf config file. Lastly, comment out any Loadmodule statements for the following modules in any other Apache config files. The default PTC Apache service loads proxy_connect_module, which must be commented out.

  • proxy_module
  • proxy_connect_module
  • proxy_http_module

ii) Windchill Application VM: Configure Windchill "System Banner Alert Message"

Setting up the Windchill System Banner Alert Message will allow the Cloned Windchill systems to be easily identified by end users. To setup a Windchill banner execute the following:

  1. Copy the begin_custom.jspf file to <WT_HOME>/codebase/netmarkets/jsp/util/begin_custom.jspf
  2. Copy example banner file to <WT_HOME>/codebase/netmarkets/jsp/util/banner.txt. For Windchill 10 use banner-wc10-example.txt. For Windchill 9.X use banner-wc9-example.txt.
  3. Restart Tomcat on Windchill 9.X, or Windchill on Windchill 10.X.

Additional details on setting up a Windchill banner are located in the Windchill Customization Guides.

Windchill 9 Example Banner:

Windchill 9.X Example Banner

Windchill 10 Example Banner:

Windchill 10 Example Banner

 

iii) Windchill Application VM: Purge Log files and Caches

Purge the Log files for all Windchill components, and if your running Windchill 9.X purge your Tomcat and InfoEngine caches.

iv) All VMs: Remove Dependence on DNS

Define all systems in the hosts file on each VM. The hosts file should point each hostname used in your Windchill configuration (eg ldap, replication server, CAD workers, database, email etc.) at an IP.  To be safe, point all hosts in your Windchill Appliance hosts file(s) at a loopback IP in the 127.0.0.1/24 range to prevent any system from inadvertently attempting to connect to an external resource.

The example hosts files below describe a Windchill system that has one Application Server (windchillhost.local), a database server (windchill-db.local), one CAD Worker (windchill-cadworker.local), and leverages a corporate email gateway (email.mydomain.com).  The Windchill Appliance will consist of two VMs, one for the application server and one for the database server.  The CAD Worker will not be included as a VM in the Windchill Appliance, nor will email be used.

Application Server Hosts File for a server with a hostname of windchillhost.local and a Windchill URL of windchill.mydomain.com:
127.0.0.1 localhost.localdomain localhost  windchillhost.local windchill.mydomain.com
127.0.0.2 windchill-db.local
127.0.0.3 windchill-cadworker.local
127.0.0.4 email.mydomain.com

Database Server Hosts File for a server with a hostname of windchill-db.local:
127.0.0.1 localhost.localdomain localhost windchill-db.local
127.0.0.3 windchill-cadwoker.local
127.0.0.4 email.mydomain.com
127.0.0.5 windchillhost.local windchill.domain.com

The host file in the VM(s) that make up your Windchill Appliance will be updated with real IP addresses during deployment.  Any component not being cloned, such as the CAD Worker in the example above, will remain pointing at a loopback interface.

v) All VMs: Turn off Services

Set all Windchill services and the network connection to be manually started on boot.

vi) All VMs: Copy Administration Automation Scripts

Copy any administration automation scripts into your VMs. A set of example automation scripts is available in the BEC Windchill Cloning Toolkit .  To use the example scripts you must update variables under the "Local Vars" section for your specific Windchill system.

  • HostnameChange.sh - Linux Bash script to change the hostname and IP address.
    • Updates hosts file with new entry for hostname on 127.0.0.1.
    • Updates network file with new hostname to ensure change is applied on reboot.
    • Changes hostname for all future user sessions.
  • WindchillChangeURL.sh - Linux Bash script to change the URL of Windchill using a Reverse Proxy Windchill setup.
    • Updates hosts file with entry for new hostname to IP on eth0 or em1.
    • Updates reverse proxy apache service with new Server Name.
    • Updates Windchill System Banner with new hostname.
    • Updates site.xconf and propagtes new Windchill properties to support new hostname.
  • WindchillChangeURL.bat - Windows BAT script to change the URL of Windchill using a Reverse Proxy Windchill setup.
    • Updates site.xconf and propagtes new Windchill properties to support new hostname.
    • End User must update the Windows hosts file by hand with entry for new hostname to public IP mapping.

vii) All VMs: Hostname, Windows SID, and Other machine specific settings

The VM(s) in the Windchill Appliance access all Windchill systems via the hosts file, therefore, the hostnames, Windows SID, and most other machine specific settings can remain the same.  The only machine specific settings that must change are the MAC and IP address of the Network interface.  Almost all VM environments automatically control the MAC address to ensure uniqueness, and the IP address of each VM will be set during the deployment step.

Some IT departments require Windows VM templates to be prepared for cloning by striping out all machine specific settings such as the SID.  If your environment has such a requirement the Windows Sysprep tool can be used to prepare a system before being stored in the Virtual Environment. Some Virtual Environments, such as VMware, can be setup to run Sysprep on deployment of a new VM.

viii) Store VM(s) in Virtual Environment

Once all of the VM(s) that make up your Windchill Virtual Appliance have been created you can store the VM(s) via one or more of the following storage locations for future use:

  • Templates - If your Virtual Machine environment supports Templates the Windchill Virtual Appliance VM(s) can be stored as VM Templates.
  • Standard VMs -  Your VM(s) can remain as standard VM(s) listed in your VM environment management console in an off state.
  • Standalone Files - Your VM(s) can be stored on any network shared drive as standalone files. Each VM will consist of one or more configuration file(s) and disk file(s).

2) Clone Your Appliance VMs

Using your Virtual environment and the Windchill Virtual Appliance you created in Step 1, clone your Windchill Appliance VM(s).  The method used to clone your Windchill Appliance VM(s) will depend on the storage method(s) selected in Step 1.

  • Templates - VMs will be deployed using the Virtual Environment's Template deployment Wizard.
  • Standard VMs - VMs can be cloned using the Virtual Environment's VM Clone Wizard.
  • Standalone Files - VMs will to be setup by hand including copying the Appliance VM disks.

After each VM has been cloned boot the VM and configure the following. A sample Bash script, HostnameChange.sh, is supplied showing how steps i and ii can be automated.  Depending on your infrastructure step iii can also be automated.

i) Configure and start the network interface

If the Virtual Environment didn't auto configure a new network interface (MAC, IP, ect) during the cloning process, then you'll need to configure the interface by hand.

ii) Optionally change the server hostname

Since the servers are using hosts files rather than DNS changing the the server hostname is not a requirement.

iii) Update the Hosts file as needed

When you update your hosts file be careful to not remove any required entries for Windchill services such as LDAP, infoEngine, database, etc.  Point any uneeded services at a loopback IP in the 127.0.0.0/24 range such as replication servers, CAD workers, index server, etc. Also, be sure to take into account  potential 3rd party software dependencies in the hosts file, such as Oracle's listener configuration.

3) Restore Desired Windchill Dataset

Restore an appropriate Windchill Dataset from your Windchill backup archive.   If possible script the restore procedure for the Windchill Dataset (ie SQL, LDAP, and File Vault) and allow the person cloning, and/or administering the Windchill clone to execute all of the restore steps.

Unlike traditional rehosting methods, a Reverse Proxy URL change allows the data in a cloned Windchill system to be refreshed at any point in time without having to rerun a rehosting/rename routine.  The Reverse Proxy layer separates the Windchill URL from the internal Windchill Hostname.

4) Update Windchill URL

The Windchill URL is updated by running the WindchillChangeURL.sh or WindchillChangeURL.bat scripts.  These scripts configure Windchill to use the Reverse Proxy and can be run as many times as needed to change the Windchill URL.  After each Windchill URL updated the hosts file on each client or corporate DNS will need to be updated to allow name resolution from each client.

5) Start Windchill!

Your Windchill system has been cloned!  You can now leverage the flexibility of virtualization to reduce your development, migration testing, and training costs.