Service Provider Foundation의 갤러리 항목 가져오기

 

적용 대상: System Center 2012 R2 Orchestrator

이 항목에서는 Windows Server용 Windows Azure 팩에서 VM 클라우드 갤러리 사용을 다룹니다. 갤러리 항목은 호스트 서비스 공급자가 테넌트에 서비스를 제공하는 데 사용할 수 있는 표준 및 재사용 가능 아티팩트로 작동하는 가상 컴퓨터 역할입니다.Windows Azure 팩에서 갤러리 항목을 테넌트에서 구독하는 계획에 추가할 수 있습니다. 가상 컴퓨터 역할은 단일 프로세스를 사용하여 테넌트에서 프로비전할 수 있는 가상 컴퓨터의 확장 가능한 계층을 나타냅니다. 가상 컴퓨터 역할에서 만들 수 있는 작업의 예로 단일 가상 컴퓨터, Active Directory 도메인 컨트롤러, SQL Server 클러스터 또는 IIS(인터넷 정보 서비스) 웹 팜을 들 수 있습니다.

갤러리 리소스를 가져오는 방법에 대한 자세한 내용은 Downloading and Installing Windows Azure Pack Gallery Resource(Windows Azure Pack 갤러리 리소스의 다운로드 및 설치)를 참조하십시오. 가상 컴퓨터 역할을 만드는 방법에 대한 자세한 내용은 System Center 2012 R2 Virtual Machine Role Authoring Guide(System Center 2012 R2 가상 컴퓨터 역할 작성 가이드)를 참조하십시오.

Service Provider Foundation을 통해 다운로드한 리소스 패키지에서 Virtual Machine Manager로 갤러리 항목을 가져올 수 있습니다. 또한 갤러리 항목은 SPFDB 데이터베이스에서 추적됩니다. SPFDB 데이터베이스를 통해 추적하여, 관리자용 관리 포털의 Windows Azure 팩에서 갤러리 항목을 즉시 표시할 수 있습니다.

또한 Service Provider Foundation 관리 웹 서비스 또는 cmdlet을 사용하여 갤러리 패키지, 항목 또는 항목의 아이콘을 가져올 수도 있습니다. 따라서 포털 개발자는 테넌트에 갤러리 항목을 선택할 수 있는 매력적인 환경을 제공하는 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에서는 다음과 같은 갤러리용 cmdlet을 제공합니다.

  • Get-SCSPFVMRoleGalleryItem

  • Get-SCSPFVMRoleGalleryItemIcon

  • Get-SCSPFVMRoleGalleryItemPackage

  • Import-SCSpfVMRoleGalleryItem

  • Remove-SCSPFVMRoleGalleryItem

  • Set-SCSPFVMRoleGalleryItem