Share via


Service Provider Foundation のギャラリー項目のインポート

 

対象: System Center 2012 R2 Orchestrator

このトピックでは、Windows Server 用 Windows Azure Pack での [VM クラウド] ギャラリーの使用方法について説明します。 ギャラリー項目は、標準の再利用可能な成果物として機能するバーチャル マシン ロールであり、ホスティング サービス プロバイダーはテナントにサービスを提供するために利用できます。Windows Azure Pack では、テナントがサブスクライブしているプランにギャラリー項目を追加できます。 バーチャル マシン ロールは、1 つのプロセスを使用するテナントがプロビジョニングできる、拡張可能なバーチャル マシンの層です。 バーチャル マシン ロールで作成できるワークロードの例として、単独のバーチャル マシン、Active Directory ドメイン コントローラー、SQL Server クラスター、インターネット インフォメーション サービス (IIS) Web ファームなどがあります。

ギャラリー リソースの取得については、「Downloading and Installing Windows Azure Pack Gallery Resource (Windows Azure Pack Gallery Resource のダウンロードとインストール)」をご覧ください。 バーチャル マシン ロールの作成については、「System Center 2012 R2 Virtual Machine Role Authoring Guide (System Center 2012 R2 バーチャル マシン ロール オーサリング ガイド)」をご覧ください。

Service Provider Foundation を使用すると、ダウンロードしたリソース パッケージからギャラリー項目を Virtual Machine Manager にインポートできます。 また、ギャラリー項目は SPFDB データベースで追跡されます。 この追跡によって、管理者用管理ポータル のWindows Azure Packでギャラリー項目をすぐに確認することができます。

また、Service Provider Foundation Admin Web サービスまたはコマンドレットを使用して、ギャラリー パッケージ、項目、または項目のアイコンを取得することもできます。 ポータルを開発するときにこの機能を利用して UI 要素と機能を作成することで、ギャラリー項目を選択する際の操作感を改善することができます。

次の例は、Windows PowerShell を使用して、パッケージからギャラリー項目をインポートし、その内容を使用してから、削除する方法を示しています。

PS C:\> # The first command gets the path to the resource package and stores it in the $Path variable.   
PS C:\> # The second command gets a System.IO.FileStream object of the package.   
PS C:\> # The third command imports the package.  
PS C:\> $Path = "c:\packages\create.resdefpkg"  
PS C:\> $FStream = New-Object IO.FileStream $Path, Open  
PS C:\> Import-SCSPFVMRoleGalleryItem -Package $FStream  
PS C:\>  
PS C:\> # Get an item from the gallery by specifying its name and store it in the $galItem variable.  
PS C:\> $galItem = Get-ScSpfVmRoleGalleryItem -Name 570569955cbfb62b374358b34467020750f65c  
PS C:\>   
PS C:\> # Get the icon object by specifying the required parameters with the variable.   
PS C:\> # The IconFileName parameter is explicitly specified in case the variable has a null value for the icon file name.  
PS C:\> $galItemIcon = Get-SCSPFVMRoleGalleryItemIcon -Name $galItem.Name -Publisher $galItem.Publisher -Version $galItem.Version -IconFilename "contoso.ico"  
PS C:\>  
PS C:\> # Get the package of the gallery and stores it in the $galPkg variable. This cmdlets returns an System.IO.MemoryStream object.  
PS C:\> $galPkg = Get-SCSPFVMRoleGalleryItemPackage -Name 570569955cbfb62b374358b34467020750f65c -Publisher Microsoft -Version 1.0.0.0  
PS C:\>   
PS C:\> # One use of the memory stream of the package is to save it to a file on your computer.  
PS C:\> $fs = New-Object IO.Filestream "c:\@tmp\gal.bin", Create  
PS C:\> $binwriter = New-Object IO.BinaryWriter $fs  
PS C:\> $binwriter.Write($galPkg.ContentStream.ToArray())  
PS C:\> $fs.Close()  
PS C:\> $binwriter.Close()  
PS C:\>  
PS C:\> # Import the package that was just saved, using the PackageFilePath parameter.  
PS C:\> Import-ScSpfVmRoleGalleryItem –PackageFilePath "C:\@tmp\gal.bin"  
  

Service Provider Foundation には、ギャラリー用に次のコマンドレットが用意されています。

  • Get-SCSPFVMRoleGalleryItem

  • Get-SCSPFVMRoleGalleryItemIcon

  • Get-SCSPFVMRoleGalleryItemPackage

  • Import-SCSpfVMRoleGalleryItem

  • Remove-SCSPFVMRoleGalleryItem

  • Set-SCSPFVMRoleGalleryItem

参照

Service Provider Foundation のポータル
バーチャル マシン ロールの作業の開始: チュートリアル ガイド
System Center 2012 R2 Virtual Machine Role Authoring Guide - Resource Definition Package (System Center 2012 R2 バーチャル マシン ロール オーサリング ガイド)
仮想マシン クラウド内でのギャラリー項目の使用