Upgrading Windows Azure Pack: Web Sites

 

Applies To: Windows Azure Pack

How to upgrade to Windows Azure Pack Web Sites Version 2 Update 2

To upgrade Windows Azure Pack Web Sites to Version 2 Update 2, you can either upgrade using Microsoft Update or by running the Windows Azure Pack Web Sites version 2 update 2 installer that is available from Web Platform Installer. Details about the changes in this update are described in Microsoft knowledge base article 2932947.

Upgrade with Microsoft Update

If you are upgrading by using Microsoft Update, your system must be able to access the internet to pull down the installable components. If you are using WSUS to distribute the upgrade, you still need your Web Sites Controller role to have internet access. To perform the upgrade, use the standard Windows update console and select Update for Windows Azure Pack Version 2.

Notes

  • This is an optional update.

  • To apply the upgrade, the update must be applied on each Web Sites Controller role. In order for the update to be available on the Controller role, Microsoft Update must have been enabled during installation.

Upgrade using Web Platform Installer

Alternatively, it is possible to apply the update by running the Windows Azure Pack Web Sites v2 Update 2 installer through Web Platform Installer. This installer also has to be run on each Controller role. If the configuration portal that is a part of the normal installation experience pops up, simply close it. There is an occasional issue that will cause that to happen.

Note

This method of upgrading requires access to the internet from the Controller role.

Upgrade on systems that lack internet access

If you are applying the upgrade to an installation that does not have internet access, perform the following steps:

  1. On a computer with internet access, download the Web Platform Installer command line tool.

  2. Run the following powershell command:

    WebpiCmd.exe /offline /products:"HostingController,HostingFrontEndRole,HostingWebRole,HostingPublishingRole,HostingManagementServerRole,HostingAdministration,HostingFileServerRole,HostingWebPlatformInstaller" /Path:"$([System.Environment]::ExpandEnvironmentVariables("%SystemDrive%\Offline_Feeds"))" /XML:"https://go.microsoft.com/?LinkId=9845550" /Language:en
    
  3. Rename the folder named %systemdrive%\Offline_feeds\feeds\v001 to WebSites_v2.0-7.7.8.0

  4. Copy the WebSites_v2.0-7.7.8.0 directory to the Web Sites Controller servers so that it is in %systemdrive%\HostingOfflineFeed\feeds

  5. Before running the installer, you can confirm that the offline feed is accessible. Check that an XML file is returned when you access the following URL, where <controller> is the name of the web sites controller server:

    http://<controller>/HostingOfflineFeed/feeds/WebSites_v2.0-7.7.8.0/WebSites0.9.0.xml
    
  6. On a computer with internet access, download WebSitesFeed.msi from the Microsoft Download Center and copy the file to the Web Sites Controller servers.

  7. On each web sites controller server, use the following Windows PowerShell commands to update the registry. You do not need to replace {controller} because the correct value is expanded automatically.

    $offlineFeedUrl = 'http://{controller}/HostingOfflineFeed/feeds/WebSites_v2.0-7.7.8.0/WebSites0.9.0.xml'
    
    $hostingFrameworkRegKeyPath = "Registry::HKLM\SOFTWARE\Microsoft\IIS Extensions\Web Hosting Framework"
    
    Set-ItemProperty -path $hostingFrameworkRegKeyPath -name "MainFeedUrl" -value $offlineFeedUrl
    
  8. On each Web Sites Controller server, run the following command to complete the upgrade:

    msiexec /i websitesfeed.msi WEBSITES_FEED=None FEED_HASH=None FEED_FILE_NAME=None WEBSITES_UPGRADE_ACTIONS="UpgradeDatabase,InstallController,UpdateFeedConfiguration,UpgradeAllServers"
    

You can monitor the progress of the upgrade in the Event Viewer under Microsoft-Windows-WebSitesUpdate/Operational, in the management portal, or in the Information Services Manager (IIS) on the web site controller.

How to upgrade from V1 or V2 Preview version to Windows Azure Pack Web Sites V2

This section provides scripts and commands that you can use to upgrade a supported preview version of Windows Azure Pack: Web Sites to the R2 release version. For information on upgrading Windows Azure Pack itself, see Upgrade from the Preview version of Windows Azure Pack.

When upgrading Windows Azure Pack: Web Sites from a preview version, keep in mind the following:

  • You must start the upgrade from the Web Sites controller.

  • The Web Sites roles can be upgraded at the default rate of 5% of servers per server farm, or you can specify a different percentage.

  • If you are upgrading from the V2 preview to the R2 release, you must also execute a set of SQL commands against the hosting database.

  • For the upgrade from version 1 to version 2, update 1 to be successful, the permissions of the HostingAdmin database user must be changed to those of an owner of the resource metering database. The steps to do this are in the “Change HostingAdmin Permissions” section later in this document.

    Warning

    The Web Sites Controller will be fully functional only after the new Windows Azure Pack: Web Sites version is installed and the databases are upgraded. Until the database upgrade, the controller will be in an unusable state because the web farm service cannot be started.

How to check your current version and upgrade status

You can use PowerShell and/or Event Viewer to check your current version of Windows Azure Pack: Web Sites, and the status of your upgrade.

Using PowerShell

To see the version of Windows Azure Pack: Web Sites that is installed across your stamp, run the following PowerShell command on the Controller Role as an administrator.

Import-Module WebSites
Get-WebSitesServer | foreach{$_.PlatformVersion}

The following more detailed PowerShell command outputs the name of the machine, the platform version, and the status.

Get-WebSitesServer | %{"$($_.Name) : $($_.PlatformVersion) ($($_.Status))"}

Sample output:

CN-V2UP-ANT306 :  (Not ready)
MN-V2UP-ANT313 : 7.6.10690.14 (Ready)
LB1-V2UP-ANT307 : 7.6.10690.14 (Ready)
LB2-V2UP-ANT313 : 7.6.10690.14 (Ready)
W1-V2UP-ANT312 : 7.6.10690.14 (Ready)
W2-V2UP-ANT305 : 7.6.10690.14 (Ready)
S-V2UP-ANT313 : 7.6.10690.14 (Ready)
PB-V2UP-ANT306 : 7.6.10690.14 (Not ready)
FS-V2UP-ANT304 : 7.6.10690.14 (Ready)

Using Event Viewer

You can also track the state of the upgrade by looking at the WebSitesUpdate Operational log in the Event Viewer. In the left pane of the Event Viewer, expand Applications and Services Logs, Microsoft, Windows, WebSitesUpdate, and then select Operational.

Change HostingAdmin Permissions

For the upgrade from version 1 to version 2, update 1 to be successful, the permissions of the HostingAdmin database user must be changed to those of an owner of the resource metering database. This is required because the only user with full access to the resource metering database is “SA,” and the SA credentials are not known in advance.

To change the HostingAdmin Permissions

  1. In SQL Server Management Studio, in the left navigation pane, expand Security, and then expand Logins.

  2. Right-click Hosting_HostingAdmin, and then choose Properties.

  3. In the left pane, under Select a Page, choose User Mappings.

  4. Under Users mapped to this login, add ResourceMetering in the Database column.

  5. In the User column, add the HostingAdmin user name.

    Important

    The user name should be HostingAdmin, not “Hosting_HostingAdmin”.

  6. In the lower pane, under Database role membership for: ResourceMetering, change the role membership to db_owner, and then click OK.

These steps should give the HostingAdmin user sufficient permissions to allow a completely automated upgrade through the Web Sites Update Service.

Start the Upgrade

On the Web Sites controller, perform the following steps.

  1. At an elevated command prompt, optionally stop the web farm service. This step eliminates the need to restart the controller after installation:

    net stop webfarmservice
    
  2. Although the installing the new version will automatically uninstall the old version, you can manually uninstall the old version first if you want. To uninstall the previous version manually, go to Control Panel > Programs and Features, and uninstall Web Hosting Framework.

  3. Using the Web Platform Installer, install the new version of Windows Azure Pack: Web Sites. For more information, see Start the installation of Windows Azure Pack: Web Sites.

    You can upgrade the Windows Azure Pack: Web Sites roles at the default rate of 5% of servers per server farm, or in a controlled fashion.

To upgrade 5% of the servers per server farm at a time

On the controller, run the following PowerShell script to upgrade the database, set the feedUrl in the hostingConfiguration and start the upgrade on all roles. Change the database server name and password information as required by your environment.

"%ProgramFiles%\IIS\Microsoft Web Sites\Feed\WebSitesSetupHelper.ps1" -actions CompleteUpgrade -upgradeConnectionString "Server=DB-Websites;User Id=sa;Password=password"

Note

  • The -upgradeConnectionString parameter is required only to upgrade V1 to the R2 release (it is not required to upgrade V2 Preview to the R2 release).

  • The connection string must use sa credentials.

To upgrade Windows Azure Pack: Web Sites servers at a specified rate:

  1. Run the following command to upgrade the database and set the new feed URL in the hosting configuration:

    "%ProgramFiles%\IIS\Microsoft Web Sites\Feed\WebSitesSetupHelper.ps1" -actions CompleteUpgrade -skipRoleUpgrade
    
  2. Use the following PowerShell commands to control the rate at which the roles are upgraded. Set the value for WFFMaximumStoppedServersPercentage to the percentage of servers per server farm that you want to upgrade at a time. The default is 5%.

    Add-pssnapin WebHostingSnapin
    Set-WebSitesConfig -Type Global -WffMaxStoppedServersPercent <percentage>
    

    Example

    The following example upgrades 20% of the servers in each server farm at a time.

    Set-WebSitesConfig -Type Global -WffMaxStoppedServersPercent 20
    

Initiate the role upgrade for all Windows Azure Pack: Web Sites roles, or on a per-role basis

  1. To initiate the upgrade for all Web Sites roles, run the following PowerShell command:

    "%ProgramFiles%\IIS\Microsoft Web Sites\Feed\WebSitesSetupHelper.ps1" -actions 'UpgradeAllServers'
    
  2. To initiate the upgrade of Web Sites roles on a per-role basis, you can run each of these PowerShell commands separately:

    Start-Operation -OperatorName WFF -OperationName Upgrade @{"WebFarmName"="FrontEndServers"}
    
        Start-Operation -OperatorName WFF -OperationName Upgrade @{"WebFarmName"="FileServers"}
    
        Start-Operation -OperatorName WFF -OperationName Upgrade @{"WebFarmName"="ManagementServers"}
    
        Start-Operation -OperatorName WFF -OperationName Upgrade @{"WebFarmName"="PublisherServers"}
    
        Start-Operation -OperatorName WFF -OperationName Upgrade @{"WebFarmName"="WorkerServers"}
    

Upgrading from V2 Preview to the R2 release

When upgrading from V2 Preview to the R2 release (but not from V1 to the R2 release), you must also run the following SQL commands against the "Hosting" database. These commands enable support to update existing subscriptions and plans after the upgrade.

-- Get the ResourceId for the 'CpuTime' resource.
DECLARE @CpuTimeResourceId INT;
SELECT @CpuTimeResourceId = (SELECT TOP 1 ResourceId FROM runtime.QuotaResources WHERE ResourceName = N'CpuTime')

INSERT  INTO [runtime].[OwnerQuotas] 
                ([QuotaName],
                 [PolicyId],
                 [ResourceId],
                 [Limit],
                 [ExceededAction],
                 [TimeUnits],
                 [Period],
                 [ActionId])
SELECT 'CpuTimeBurst', POL.PolicyID, @CpuTimeResourceId, -1, 0, 1, 5, NULL 
FROM [admin].[subscriptions] SUB
INNER JOIN [runtime].[SitePolicies] POL
ON SUB.Name = POL.PlanName
WHERE NOT EXISTS (SELECT 1 FROM runtime.OwnerQuotas O WHERE O.PolicyId = POL.PolicyID AND QuotaName = N'CpuTimeBurst')

INSERT  INTO [runtime].[SiteQuotas] 
                ([QuotaName],
                 [PolicyId],
                 [ResourceId],
                 [Limit],
                 [ExceededAction],
                 [TimeUnits],
                 [Period],
                 [ActionId])
SELECT 'CpuTimeBurst', POL.PolicyID, @CpuTimeResourceId, -1, 0, 1, 5, NULL 
FROM [admin].[subscriptions] SUB
INNER JOIN [runtime].[SitePolicies] POL
ON SUB.Name = POL. PlanName
WHERE NOT EXISTS (SELECT 1 FROM runtime.SiteQuotas O WHERE O.PolicyId = POL.PolicyID AND QuotaName = N'CpuTimeBurst')

See Also

Upgrade from the Preview version of Windows Azure Pack
Deploy Windows Azure Pack: Web Sites