Showing posts with label System Center 2012 R2. Show all posts
Showing posts with label System Center 2012 R2. Show all posts

Wednesday, September 10, 2014

How Azure Pack is using Service Provider Foundation

How Azure Pack is using Service Provider Foundation

A while ago, I wrote several posts about the different APIs in Azure Pack.
As you may be aware of, Azure Pack consists of what we often refer to as “Service Management API”.
The API is similar to the one we will (not literally) find in Microsoft Azure, where the portal interacts with the APIs, that again aggregate all the wide diversity of resource providers available for us to consume.

A short summary

The Azure Pack Management Portal offers a familiar, self-service interface that every subscriber (tenant) uses to provision and manage services such as the web site offerings and the virtual machine with its virtual network capabilities.
We have portals for the admin (service provider) and the tenants.

Underlying the Management Portal is an OData Rest application programming interface (API) known as the Service Management API.
This API provides access to the underlying services and enables automation and replacement of the existing management portal.

Some of my API posts:



API summary:

Administrator API
REST APIs that are only available to Service Management for administrators. Default this Admin API is using port 30004, so the URI requests should reflect that.

Tenant API
REST APIs that are available for both administrators and tenants. Default the tenant API is using port 30005.

Public tenant API
Public REST APIs that support end-user subscription management for services presented by the service management API. Default the port is set to 30006.

Let us get back on track

When we are working with the VM Cloud Resource Provider in WAP, we are touching many many APIs on our journey, and one of the important ones (well, all of them are important for this to work) is the Service Provider Foundation (SPF).

SPF is provided with System Center 2012 R2 – Orchestrator (no, you don’t have to install Orchestrator, but the SPF setup is located in the Orchestrator setup/media).
SPF exposes an extensible OData web service that interacts with VMM. This enables service providers to design and implement multi-tenant self-service portals that integrate IaaS capabilities available in System Center 2012 R2 and Windows Server 2012 R2 – Hyper-V.

SPF contains several web services that has two locations to set credentials. On the server that has the SPF installed we use the application domain pool in IIS and the respective group in Computer Management. These groups (SPF_Admin, SPF_VMM, SPF_Usage and SPF_Provider) must contain a local credential (not a domain credential) that is also member of the Administrators group on the SPF server.

The SPF_VMM user must be added as an administrator to VMM in order to invoke actions from the WAP portal.

The Service Provider Foundation Web Services:


The admin web service is used to create and manage tenants, user roles, servers (like Remote Console), stamps (VMM), and other administrative objects.


The VMM web service invokes the VMM server to perform requested operations.
Examples of operations could be:

-          Creating virtual machines
-          Creating virtual networks
-          Creating user role definitions
-          Create cloud services and other fabric

Communication is bidirectional, so that actions triggered by a portal that’s using SPF (like WAP) as well as actions happening directly in VMM will be reflected on both sides.

An example:

You do something in VMM that affect one or more tenants, like adding a new VM to the tenant’s subscription. This will pop up in the tenant portal of WAP.

Another example is when a tenant makes changes to a virtual network in the portal, the jobs are triggered in VMM, aggregated by SPF and shows immediately.

Usage Web Service

SPF has also a Usage Web Service that can only be used by WAP, and uses data from Operations Manager’s data warehouse, which is integrated with VMM in order to collect information of the virtual machine metrics. You must use the spfcmdlets to register SCOM with SPF.

Provider Web Service

Resource providers for delivering infrastructure as a service (IaaS) uses this web service that provides a Microsoft ASP.NET web API. This one uses also the VMM and Admin web services but is not an Open Data (OData) service.


Registering SPF endpoint with Windows Azure Pack

As an administrator, you log on to the management portal and register the Service Provider Foundation endpoint. This will register a connection between the Service Management API and SPF.
Since SPF provides a programmatic interface to the stamps (VMM management servers), it enables service providers and enterprises to design and implement multi-tenant self-service portals that leverage IaaS capabilities provided by System Center and Windows Server.



After you have registered the SPF endpoint with the Service Management API:

·         All stamps that you have created directly in SPF will be listed in the management portal for administrators

·         All clouds created within the VMM stamp(s) will appear in the management portal for administrators

·         You can register stamps directly using the management portal for administrators

·         You can remove/change the association between stamp and service provider foundation


Tuesday, August 12, 2014

Applied UR3 for VMM? Update your VMM DHCP Server Extension now!

Update your SCVMM DHCP Server Extension now!

From the KB:

“When using System Center 2012 R2 Virtual Machine Manager (VMM 2012 R2), you may discover that some virtual machines that are deployed on Hyper-V Network Virtualization networks with dynamic IP address allocation may not get an IP address for a few minutes after a reboot of the VM. Eventually the VM gets the IP address and otherwise functions normally.

The behavior can occur if the host has an older version of the VMM DHCP server extension. In order to verify this, find the version of “Microsoft System Center Virtual Machine Manager DHCP Server (x64)” installed on the host by running the following Powershell command:

Get-WmiObject –Class win32_product –filter ‘Name = “Microsoft System Center Virtual Machine Manager DHCP Server (x64)”’

The resolution is to first uninstall the old version of the DHCP extension manually, and then install the updated version from VMM installation folder\SwExtn\DHCPExtn.msi

Default path is: C:\Program Files\Microsoft System Center 2012 R2\Virtual Machine Manager\SwExtn\DHCPExtn.msi

Once this is done, the VMs should no longer experience a delay in acquiring an IP address after a reboot.



Background:

Windows Server 2012 R2 Hyper-V introduced several enhancements related to NVGRE.
One of these things are “Dynamic IP address learning”.

What is Dynamic IP address learning?

Feedback from customers told Microsoft that it was important to enable highly available services to run in a VM network. To support that, dynamic IP address learning was brought to the table.
In other words, services such as DHCP, DNS and AD is supported in a NVGRE based network on Hyper-V.
First for broadcast or multicast packets in a VM network, we will use a PA multicast IP address if configured. However, the typical data center operator does not enable multicast in their environments. As a result, when a PA multicast address is not available we use intelligent PA unicast replication. What this means is that we unicast packets only to PA addresses that are configured for the particular virtual subnet the packet is on. In addition, we only send one unicast packet per host no matter how many relevant VMs are on the host. Finally, once a host learns a new IP address it notifies SCVMM. At this point, the learned IP address becomes part of the centralized policy that SCVMM pushes out. This allows for both rapid dissemination of HNV routing policy and limits the network overhead for disseminating this HNV routing policy.”

Second, what is the SCVMM DHCP Extension?

In order to leverage NVGRE, you would have to manage your hosts entirely with powershell, if you didn't have VMM in place.

When VMM is in place (and really should be in place, when using NVGRE), VMM act as the complete management layer, also for the NVGRE part. Since NVGRE basically is a policy driven technology, VMM need to keep track of every IP address used with NVGRE. During deployment of virtual machines connected to a VM Network with NVGRE (often referred to as Customer Addresses), VMM is able to configure static IP addresses on to these VMs, using the agent you are mentioning. This was introduced in VMM 2012 SP1, and is present in the R2 Release. 
Therefore, to summarize, it is a Hyper-V Switch Extension that is required on all Windows Server with Hyper-V to have DHCP to work correctly.

Great. But can I deploy the updated agents to all my Hyper-V hosts in a single operation?

From your VMM server, you can run the following script (please let it match your computer names in the fabric before you run it):

$setup = "\\vmm01\c$\Program Files\Microsoft System Center 2012 R2\Virtual Machine Manager\SwExtn\DHCPExtn.msi"

Invoke-Command -ComputerName hv03, hv04, hv01, hv02, hvfm01, hvfm02, hvgw01, hvgw02 -Command { $setup }



Thursday, November 28, 2013

Updated Whitepaper for Hybrid Cloud with NVGRE (WSSC 2012)

Updated Whitepaper for Hybrid Cloud with NVGRE

We have finally updated the Whitepaper for Hybrid Cloud with NVGRE (WSSC 2012 R2) and you can now download it from http://gallery.technet.microsoft.com/Hybrid-Cloud-with-NVGRE-aa6e1e9a

What we have done:

·         Added some new content around best practices
·         Updated to 2012 R2 RTM/GA
·         Added HA Service Template for gateway VMs
·         Good old bug fixing
·         Troubleshooting

With this foundation, I can ensure that we are already working on something new in the context of cloud computing that will take advantage of NVGRE and the fabric setup we have.

If you have any feedback, questions etc, please use the Q&A at the TechNet site

Monday, November 11, 2013

How to create a GEN2 VM with SCVMM 2012 R2

Hopefully, you are a completely aware of the support of GEN2 VMs in Hyper-V in Windows Server 2012 R2.
The virtual machine generation determines the virtual hardware and functionality that is presented to the virtual machine.

Generation 1 VMs is the legacy VMs that we have been using over the last years, that provides the same virtual hardware to the virtual machine as in previous versions of Hyper-V.

Generation 2 VMs  provides a lot of new functionality on a virtual machine, like:

-          Boot from a SCSI virtual hard disk
A well-known topic about the architecture of Hyper-V is that the boot partition always had to be associated with an IDE controller in the virtual hardware profile. This was because it would bypass the integration service requirements, so that you could boot ‘any’ guest OS on Hyper-V. The performance was identical as to SCSI controller associated disk when integration services was present, but it was simply a bypass. This gave us some challenges regarding new features we got in 2008 R2, like hot-add/remove of virtual hard disk that could only be performed on VHD’s associated with the SCSI controller. In other words, only data-partitions could be added/removed on the fly. Since a GEN2 VM now can boot from a SCSI-controller, we can also add/remove and resize these disks associated, even if it’s the boot partition. Please note that VHDX is a requirement in order to use GEN2 VMs.

-          Secure Boot (this one is enabled by default)
Secure boot is enabled by default for GEN2 VMs and is a feature that helps prevent unauthorized firmware, operating systems, or UEFI drivers from running at boot time

-          Boot from a SCSI virtual DVD
Instead of using an IDE virtual DVD, we can now use SCSI Virtual DVD

-          PXE boot by using a standard network adapter (this is for real!)
If you wanted to boot a VM and to perform a remote installation of the guest operating system using PXE boot, you had to use a legacy virtual network adapter in the virtual hardware profile – in order to bypass the integration services (since they were not present at boot time). GEN2 VMs support PXE boot by using a standard virtual network adapter (aka synthetic device) so there is no need to install a legacy network adapter, which has been removed from GEN2 VMs.

-          UEFI firmware support
The Generation 2 VM has a much more simplified virtual hardware model and supports Unified Extensible Firmware interface (UEFI) firmware instead of BIOS-based firmware. This means that most of the legacy devices are removed from GEN2 VMs.

These are the guest operating systems that are supported as GEN 2 VMs:

-          Windows Server 2012
-          Windows Server 2012 R2
-          64-bit versions of Windows 8
-          64-bit versions of Windows 8.1

By reading this, I can assume that you can see the benefits of using GEN2 VMs.

In addition, SCVMM 2012 R2 support GEN2 VMs and we can create, deploy (newly VMs or/and based on templates) through powershell and the GUI.

Please note: Services in VMM in System Center 2012 R2 do not support generation 2 virtual machines. When you create a service template in VMM, if you have created virtual machine templates (VM templates) that specify generation 2 virtual machines, you cannot add those templates to the service template. You can only add virtual machine templates that specify generation 1 virtual machines. Also, within a service template, in the virtual machine (tier) properties sheet, properties for a generation 1 virtual machine appear, but properties that are unique to generation 2 virtual machines do not appear.

Since SCVMM is fully aware of your datacenter infrastructure, it will leverage intelligent placement during VM deployment. This means that SCVMM will identify which hosts that support GEN2 VMs prior to deployment (give you a star rating) and help you to avoid faulty placement of GEN2 VMs.


How to create a GEN2 VM with SCVMM 2012 R2

1.       Logon to your SCVMM server and navigate to ‘VMs and Services’
2.       Click ‘Create Virtual Machine -- > Create Virtual Machine’ from the ribbon menu

3.       Select ‘Create a new Virtual Machine with a blank hard disk’ and click next. This is important, as you can’t use any template with GEN1 as your source

4.       On the ‘Specify virtual machine identity’ page, assign the VM a name and also specify the generation of the virtual machine. Click on the drop down list and select Generation 2

5.       On the ‘Configure hardware for the virtual machine…’ page, add an ISO image to the DVD drive, and eventually adjust any of the other hw settings to meet your requirements. Please note the absence of the legacy hardware that we had in generation 1 VMs

6.       On the ‘select destination’ page, please specify the cloud or the host group where the VM should be deployed

7.       Intelligent placement will work out its magic and detect the best suited host to run the virtual machine. Click next 3 times and finish to start the deployment

You should now have successfully deployed a GEN2 VM with SCVMM 2012 R2

The next logical steps would be as follows:

1.       Install and customize the guest operating system within the VM
2.       Shut down the VM
3.       Remove the ISO attached to the VM

4.       Create a VM template with SCVMM 2012 R2 and place it in your library

Tuesday, October 22, 2013

Windows Azure Gallery Items - getting started with Domain Controllers


The feed of Windows Azure Pack Gallery Resources and SCVMM Service Templates which are compatible with the RTM releases is now LIVE at:


This release includes more than 40 deployable templates including:
·         SharePoint 2013
·         SharePoint Foundation 2010
·         Microsoft SQL Server 2013
·         IIS
·         Domain Controller
·         Windows Server 2012 R2 HA Network Gateway
·         Windows Server 2012 R2
·         Windows Server 2012
·         BlogEngine.NET
·         Database Servers
o   MySQL Server (Windows and Linux)
o   Oracle Self Service Kit
·         Linux applications including
o   CentOS6 LAMP
o   Drupla
o   Joomla
o   WordPress CentOS6
·         Samples to enhance authoring
o   Custom Script
o   Custom Script with Environment Variables
o   Linux Generic
o   Service Template Example Kit
·         and more

For information on how to use this feed and import items in the Windows Azure Pack you can use the following resources
·         Downloading and Installing Windows Azure Pack Gallery Resource

Please pay attention to the gallery items that you can use with Windows Azure Pack.
These items, (blogged about them here http://kristiannese.blogspot.no/2013/08/getting-started-with-gallery-items-in.html ) is quite neat to use in a IaaS scenario.

Instead of just offering standard virtual machines (you know, those sysprep’d VMs with nothing but the OS installed) we can climb up a bunch of levels and focus on applications instead.
The hard part is to understand the difference between Service Templates (native in SCVMM) and gallery items (native in Windows Azure Pack).

Service Templates is by design, meant for the enterprise/private cloud where you need to know (at some level) specific things about the infrastructure. At least you must have access to other networks that tenants usually don’t have, and in some cases, some shared storage either presented through iSCSI or virtual FC (yup, shared VHDX may solve some of the issues here).

Gallery items on the other side, is designed and optimized for the Windows Azure Pack, where tenants – as well as internal users may deploy virtual machine roles (virtual machines with additional services or/and applications). We saw the early beginning of this in preview, where we could rapidly deploy Windows Servers enabled with IIS, where some settings were exposed already prior to the setup, for the tenant to configure.

In this blog post, I would like to highlight how the domain controller template through Windows Azure Pack is working.

First, I assume you have downloaded the bits to some place on your SCVMM server, next we will import the items in SCVMM (nope, no GUI for this) through Powershell and add them to Windows Azure Pack.

1)      On SCVMM, open the Powershell module and type the following:

$libraryShare = Get-SCLibraryShare | Where-Object {$_.Name -eq 'MSSCVMMLibrary'}
$resextpkg = $Env:SystemDrive + "\Gallery Resources\DomainController_WS2012_VMRole_Pkg\DomainControllerWindows2012.resextpkg"
Import-CloudResourceExtension –ResourceExtensionPath $resextpkg -SharePath $libsharepath -AllowUnencryptedTransfer



2)      Next, we must associate a VHDX with this cloud resource

$myVHD = Get-SCVirtualHardDisk | where {$_.Name –eq 'gallerydisk.vhdx'}
$WS2012Datacenter = Get-SCOperatingSystem | where { $_.name –eq '64-bit edition of Windows Server 2012 R2 Datacenter' }
Set-scvirtualharddisk –virtualharddisk $myVHD –OperatingSystem $WS2012Datacenter


3)      The Familyname and Release properties of the virtual hard disk must be set in order for the Windows Azure Pack portal to display the virtual hard disk as an available disk for this Gallery Resource. These values are shown in the portal drop-down list.
Familyname property values should indicate the contents of the virtual hard disk, including the Windows Server release and edition. The Readme file of the Gallery Resource should include appropriate Familyname values.
Release property values must conform to the Windows Azure versioning scheme of n.n.n.n. Examples include 1.0.0.0 and 1.0.0.1.
You can set this property using either the Virtual Machine Manager Administrator console or using Windows PowerShell.


4)      The last step in Powershell, is to perform the last tag

$myVHD = Get-SCVirtualHardDisk | where {$_.Name –eq 'gallerydisk.vhdx'}
$tags = $myVHD.Tag
if ( $tags -cnotcontains "WindowsServer2012R2" ) { $tags += @("WindowsServer2012R2") }
Set-scvirtualharddisk –virtualharddisk $myVHD –Tag $tags


Now, logon to your Windows Azure Pack Service Management portal, and perform the following tasks

1.  Open the Service Admin Portal.
2.  Navigate to the VM Clouds workspace.
3.  Click the Gallery tab.
4.  Click Import.
5.  Select and import the Resource Definition Package file for the gallery item. This will be the file with the extension resdefpkg.
6.  The gallery item should now be listed on the Gallery tab.

Finally, associate the gallery item with one of your ‘plans’ created in Windows Azure Pack.

1.  On the Gallery tab, select the version of the gallery item that you just imported.
2.  Click the arrow next to the gallery item name.
3.  Verify the details of the gallery item.
4.  Navigate back and click Make Public.
5.  Select the Plans workspace in the Service Admin Portal.
6.  Select the plan to which you want to add this gallery item.
7.  Select the Virtual Machine Clouds service.
8.  Scroll to the Gallery section.
9.  Click Add Gallery Items.
10.   Select the gallery items that you imported, and then click Save.
11.   The Virtual Machine Role is now available to the tenant as part of the selected plan.
The tenants can now logon to their tenant side, navigate to VMs, and create new.
They will have the option of using ‘Virtual Machine Roles’, and the DC item will appear with the following configuration options, shown below on the screenshots.
(This will indeed install a virtual machine with the forest/domain you specify)








Now, how cool is that?

Tuesday, October 15, 2013

Expert 2 Expert Conference in Rome



First of all, I really hope to see you durng the E2E conference in Rome early in November.
I will be holding the keynote together with Michael.

The keynote (first part) will focus on what’s new in Windows Server 2012 R2, delivered by Michael, where I will eventually will come In to talk about the innovation in the Cloud OS with Hyper-V, System Center and last but not least – the Windows Azure Pack.

This will be a great conference with a lot of the best experts from the industry.

Here are some statistics:

1)      We got 18 countries visiting. Germany, Austria, Swiss, UK, Ireland, Netherlands, Belgium, France, Sweden, Norway, Jersey, USA, Denmark, Italy, Croatia, Spain, Malta, Israel
2)      We have 18 Microsoft MVP’s, 15 Citrix CTP’s and 6 vExperts. We cover all of the technologies!
3)      We have 110 people registered so far and from those are (figures are approximate):
a.       28% Dutch
b.      15% German
c.       15% Norwegian
d.      11% UK
e.      10% USA
4)      This is our 20th event and we are 10 years young this year J
5)      For Rome we have 28 sessions, 1 Master Class, 3 days :)
6)      Last time we had MVP Community Lead, this time we will have Citrix CTP community lead Perrine Crampton!

To summarize, this should be a great conference for those of you who are interested in virtualization and cloud computing, with a focus on the primary technology in the market.


I hope to see you all there. 

Tuesday, September 24, 2013

Live cloning in SCVMM 2012 R2

Live cloning in SCVMM 2012 R2

One of the new nice features in Windows Server 2012 R2 – Hyper-V, is that the hypervisor supports live cloning (live export/import) of virtual machines running on this platform.
The VM can either be online, stopped or in saved state.

Please note: although this is supported, you should be careful with this feature, as it is seldom smart to power on two machines with the exact same identity on the same network.

When is this useful?

Imagine you have a virtual machine accessed by a bunch of users. One of these users are complaining about something that you would like to troubleshoot. However, taking this VM offline or denying access to the other users would most likely result in unhappy users or/and customers.

By having the ability to live clone this VM, you can do this without affecting the running virtual machine, and get an identical copy containing the issue, resolve it, and apply these changes to the live VM.

To summarize: this little – but important feature very important in a service provider cloud, as well as for the ISV’s and the enterprises where there is development and testing.
It will save organizations a huge amount of time and lead to more rapid testing and troubleshooting.

1)      Find a VM in the VMM console that is running on a Hyper-V 2012 R2 host.
2)      Right click on the VM, Create, Clone.
3)      Run through the wizard and give the VM name (this is not the %computername% a name that differs from the Live VM and complete the wizard.


Once this is done, you can monitor the processs in VMM and see that the VM is actually live exported, and imported to the destination host.



Happy testing!

Monday, September 9, 2013

White paper - Hybrid Cloud with NVGRE (WSSC 2012 R2)

A very interesting weekend is over, and we are happy to announce the release of our white paper that covers implementation and configuration of network virtualization with Windows Server 2012 R2 Hyper-V, and System Center 2012 R2 - Virtual Machine Manager.


Download the white paper here

A couple of weeks ago, I was discussing network virtualization with a fellow MVP, Flemming Riis.
We decided quickly that we needed to embrace this technology and help the community to adopt it.
Generally speaking, NVGRE should be simple to implement, but when we add all the possible configuration options with VMM into the mix, we need to know what we are doing.
Let us be clear: if you consider to implement NVGRE, you should consider VMM to be mandatory. Period.

Flemming provided us with his own lab, running blades, SAN's and everything we needed to make this as realistic as possible.

Stanislav Zhelyazkov and Daniel Neumann had the role as technical reviewers and provided us with deep insight and helpful stuff that we either didn't know of, or had missed. Thank you guys.

Please note that this white paper is in its first release.
Once we reach RTM, additional content will be added.

- Site-2-Site VPN

- Self-service and tenants with Windows Azure Pack

If you have any comments or questions related to the white paper, please leave a comment.

thx.

-kn


Wednesday, August 14, 2013

Getting started with Gallery Items in Windows Azure Pack (WAP)

I’ve been diving into Windows Azure Pack lately, to explore some of the cloud characteristics this solution will bring to your organization together with System Center 2012 R2 (SCVMM, Orchestrator and SPF).

Recently, Microsoft announced some cool stuff on their codeplex (community) site.
During TechEd, you may have seen the presentation by Eric Winner and Marc Umeno on the subject, and where they talked about gallery items in Windows Azure Pack.

What is gallery items?
Gallery items in Windows Azure Pack is a set of predefined services that you can offer to your tenants.
Interesting is the relation to service templates in VMM with the design, but currently they are very different.
A service template in VMM can be authored with both PowerShell and the console, and is still the most flexible and powerful solution. However, service templates isn’t exposed to the tenant API/portal in Windows Azure Pack.
Hence, we get gallery items.
The story has been clear by now. This R2 release is a result of huge investments in Windows Azure and Microsoft are first building for the cloud (Azure) and then for bits you are able to purchase and run on your own. Gallery items is basically “service templates” that is built to serve a service, like web server, application server and any other server role/application.
If you have little or none experience with Windows Azure, please continue to read where I will try to explain in a bit more detail.

Windows Azure when first released, was all about Platform as a Service. This service model (referring to the definition of cloud computing) is basically based to provide developers with a scalable framework, where they can write their code, upload the code and packages to Azure, where Microsoft’s high-tech datacenters is able to execute the application in an architecture where everything is loosely coupled.
Personally, this is perhaps the most interesting service model as it ‘forces’ you to modernize you applications to fit into this model. If you are looking for a place to run highly scalable internet application, Windows Azure was a very good option back in 2008-2010.
We now got some new services in Windows Azure, and we can leverage the more traditional Infrastructure as a Service – service model. This gives us virtual compute, virtual networks, virtual storage and virtual machines that we can manage as they were running on-premise.
As Infrastructure as a Service was introduced back in 2011, we saw some changes to the Platform as a Service mode, or to be more precisely, we got something called ‘Cloud Services’.
Cloud Services was either a worker role, web role or a virtual machine role.
Together with traditional virtual machines, we now had options when creating applications and services for the public cloud.

Back to Windows Azure Pack.
In Windows Azure Pack, we can create traditional virtual machines (infrastructure as a service) together with virtual networks. All of this are running on Windows Server 2012 R2 (Hyper-V) and System Center 2012 R2 (SCVMM, Orchestrator with SPF).
New in this release, is support for both Service Bus and Virtual Machine Roles. Both of these are related to platform as a service, and we are now focusing on Virtual Machine Roles.
The gallery items are the building blocks for your virtual machine roles.
Let’s explore this and see how we can get things running in our cloud (either private cloud or service provider cloud).
Download gallery items from Codeplex

A few sample gallery items are now available in the Web Platform Installer now:

2) Click the "options" link at the bottom of the WebPI UI.
3) In the custom feed field, enter the following URL: http://www.microsoft.com/web/webpi/partners/servicemodels.xml.
4) Click "Add Field" and dismiss the dialog.
  
Please note that only the three Windows Server 2012 * resources are related to gallery items. Both Service Template Example Kit and Sharepoint 2013 Service Template are only suited for service templates in SCVMM.

Once downloaded, we can navigate to the folder we placed it into and see the items. Included with every resource, we have a readme file.


Note: there are some important steps missing in the readme file to get this working, so pay attention to the instructions later when importing and customizing the resources in the SCVMM library.

How to import and use Windows Server 2012 R2 Web Server Gallery Resource

In order to publish the gallery resources as a gallery item, you must
Import the resource extension package into System Center Virtual Machine Manager.
Ensure the virtual hard disks in SCVMM are properly prepared and have all the necessary properties set.
Import the resource definition package as a gallery item.
Make the gallery item public.
Add the gallery item to a plan.
1)      Import the recourse extension package into System Center Virtual Machine Manager

Using Powershell, you must import the resource extension package into the virtual machine manager library.
Sample Windows Powershell:
            $libsharepath = <you must set the library sharepath from your environment>
Example: $libsharepath = “\\vmmserver\library\”
            $resextpkg = $Env:SystemDrive + “\GalleryResources\WS2012WebServer-VMRole-Pkg\WS2012WebServer.resextpkg”
Import-CloudResourceExtension –ResourceExtensionPath $resextpkg  –SharePath $libsharepath -AllowUnencryptedTransfer

The import can only be done using Powershell.

To verify the import, run the get-CloudResourceExtension Powershell command and locate the newly imported extension.

      Get-CloudResourceExtension
2)      Prepare the virtual hard disk
Since you have landed on this blog, I already assume you are familiar with sysprep and how to take action on this, either manually or by using SCVMM.
You must provide a virtual hard disk from which the virtual machine role will be created. If you already have a vhdx file in your library, go ahead and use this.

Note: to actual get this working, you must have two disks in your library. One disk containing the operating system, and one disk for the data partition. You only have to prepare the partition used for the operating system in this guide. The disk for data partition will be explained in a bit.

Since the resource extension will only work with Windows Server 2012 /R2, use one of the following operating system values on your Windows Server 2012/R2 hard disk:

64-bit edition of Windows Server 2012 Datacenter
64-bit edition of Windows Server 2012 Standard
64-bit edition of Windows Server 2012 Essentials
Windows Server 2012 R2 Datacenter Preview
Windows Server 2012 R2 Standard Preview
Windows Server 2012 R2 Essentials Preview
Sample Powershell

$myVHD = <you must set to the virtual hard disk in your environment>
Example: $MyVHD = get-SCVirtualHardDisk –id “your virtual hard disk ID”

$WS2012R2Datacenter = Get-SCOperatingSystem | where { $_.name –eq “Windows Server 2012 R2 Datacenter Preview” }

Set-scvirtualharddisk –virtualharddisk $myVHD –OperatingSystem $WS2012R2Datacenter

The Operating System value can be set using Powershell or the virtual machine manage administrator console.

3)      Familyname and Release

These properties must be set in order for the Windows Azure Pack portal to display the virtual hard disk as an available disk for this gallery resource. The Familyname and Release properties are shown in the portal drop-down list, so set them to values that will make sense to your user.

Familyname property values should indicate the contents of the virtual hard disk, including the Windows Server release and edition.  For this gallery resource, you should consider the following Familyname values.
Windows Server 2012 Datacenter
Windows Server 2012 Standard
Windows Server 2012 Essentials
Windows Server 2012 R2 Datacenter Preview
Windows Server 2012 R2 Standard Preview
Windows Server 2012 R2 Essentials Preview

Release property values must conform to the Windows Azure versioning scheme of n.n.n.n
1.0.0.0
1.0.0.1
etc

Sample Powershell

$myVHD = <you must get the virtual hard disk in your environment>

Set-SCVirtualHardDisk –VirtualHardDisk $myVHD –FamilyName “Windows Server 2012 R2 Datacenter Preview” –Release “1.0.0.0”

Familyname and Release values can be set using Powershell or the virtual machine manage administrator console.
Note: repeat these steps on your virtual hard disk for the data partition. The important thing to note here is that you must not define any operating system on this disk, as the portal then will consider it to contain the operating system and hence not list it in the data partition field in the portal.

4)      Tags

The Windows Server 2012 gallery resource depends on a virtual hard disk with the following tags
WindowsServer2012
.NET3.5
NOTE: this .NET3.5 tag indicates that you have pre-installed .NET3.5 in your sysprepped VHD.

Sample Powershell

$myVHD = <you must set to the virtual hard disk in your environment>

$tags = $myVHD.Tag

if ( $tags -cnotcontains "WindowsServer2012" ) { $tags += @("WindowsServer2012") }
if ( $tags -cnotcontains ".NET3.5" ) { $tags += @(".NET3.5") }

Set-SCVirtualHardDisk –virtualharddisk $myVHD –Tag $tags

The tag property can only be set using Powershell. 


5)      Windows Azure Pack Service Administrator Portal

Once the resource extension and virtual hard disk are all correctly set in SCVMM, you can import the resource definition package using the Service Administrator Portal in the Windows Azure Pack.
Open the Service Admin Portal.
Navigate to the VM Clouds workspace.
Click the Gallery tab.
Click Import.
Select and import the WebServer(IIS).resdefpkg file in the unzipped location.  The default unzip location is “c:\GalleryResources\WS2012WebServer-VMRole-Pkg\”
Note that the gallery item now is listed on the Gallery tab.
Now that the packages for the Virtual Machine Role have been installed, you can publish the gallery item to make it available to tenants.

To make the Virtual Machine Role available to the tenant, you need to add it to a plan. In this procedure, you publish the Virtual Machine Role that you installed.

On the Gallery tab, select the version of the gallery item that you just imported.
Click the arrow next to the gallery item name.
Explore the details of the gallery item.
Navigate back and click Make Public.
Select the Plans workspace in the Service Admin Portal.
Select the plan to which you want to add this gallery item.
Select the Virtual Machine Clouds service.
Scroll to the Gallery section.
Click Add Gallery Items.
Select the gallery items that you imported, and then click Save.

Brilliant, we are almost done.
The last thing to do, is to create a new tenant, or logon with an already existing tenant to this portal.
The tenant must then subscribe to a plan that is offering these gallery items.

Here’s some screen shots on how to deploy a gallery item into a cloud defined in SCVMM, presented by Windows Azure Pack:

6)      Deploying Virtual Machine Roles in Windows Azure Pack

In the portal, click new à Virtual Machine Role à From Gallery.
This will bring up the available gallery items.


In the ‘Create Virtual Machine Role from ...’ screen, please select the proper item. In my case, I have both a web server and a stand-alone Windows Server 2012 R2 resource. I will select my Web Server and proceed.


Assign the virtual machine role with a name (during this process, Windows Azure Pack will check with SCVMM if the name is available or already taken).
Select the right version and the right hosting plan. If the gallery item is not available in a hosting plan, you are unable to proceed.


The next step will require some input from the tenant.
You can define the following:


Size
Choose the size of the instance. Extra small, small, Medium, Large, Extra large.

Operating system disk
The disk you prepared with powershell should be available here

Data disk
The other disk (containing no operating system, remember?) is listed here

IP Address allocation method
Dynamic or static is the option here

IP Address type
IPv4 or IPv6

Logical Network
The networks you have made available both in the cloud in SCVMM and in the plan is available here. I would strongly suggest you to leverage network virtualization in this case, and provide the tenants to create their own virtual networks prior to this, and deploy the virtual machine role to this network.

New user name
Specify the username

New Password
Assign a password to the user

Confirm
Confirm your password

Virtual Machine Name Pattern
Default, you will se ‘Computer###’ where the hashes refers to incremental numbers.

Workgroup
Name of the workgroup this virtual machine role should be a part of

Time Zone
Choose the proper time zone for your virtual machine role

Initial Instance Count
How many virtual machines will you deploy at first? This is where you define it

Minimum Instance Count
What’s the minimum instances of the virtual machine role

Maximum Instance Count
Decide how many instances this virtual machine role can scale out to.

Click next to proceed

In this screen, you can assign website name and application pool together with your preferred TCP port.
This is because we are deploying a web server virtual machine role. Once you are done, click finish to start the deployment

Note: if your cloud in SCVMM has any capability profiles associated, the deployment will fail.
You must uncheck any capability profiles since gallery items doesn’t have this property.

In the portal, we can now see that the virtual machine role is being provisioned.


Since I am the SCVMM admin as well, I can check in the Jobs view in the console, that some cool stuff are actually taking place in my environment.


Once the deployment has succeeded, you can manage it further in the tenant portal.
This screen shots illustrates that I am able to scale my instances for this virtual machine role.



Hopefully this was useful to get you started with gallery items in Windows Azure Pack.