SPF에서 갤러리 항목 가져오기

중요

이 버전의 SPF(서비스 공급자 파운데이션)는 지원이 종료되었습니다. SPF 2022로 업그레이드하는 것이 좋습니다.

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

System Center - SPF(서비스 공급자 파운데이션)에서 다운로드한 리소스 패키지에서 갤러리 항목을 System Center - VMM(Virtual Machine Manager)으로 가져올 수 있습니다. 갤러리 항목은 SPFDB 데이터베이스에서 추적됩니다. 그러면 Microsoft Azure Pack 관리자가 관리 포털에서 갤러리 항목을 즉시 볼 수 있습니다.

SPF는 갤러리에 대해 다음 cmdlet을 제공합니다.

  • Get-SCSPFVMRoleGalleryItem

  • Get-SCSPFVMRoleGalleryItemIcon

  • Get-SCSPFVMRoleGalleryItemPackage

  • Import-SCSpfVMRoleGalleryItem

  • Remove-SCSPFVMRoleGalleryItem

  • Set-SCSPFVMRoleGalleryItem

SPF 관리 웹 서비스 또는 cmdlet을 사용하여 갤러리 패키지, 항목 또는 항목 아이콘을 가져올 수 있습니다. 포털 개발자는 UI 요소와 기능을 만들어 테넌트에게 갤러리 항목을 선택하는 데 매력적인 환경을 제공할 수 있습니다.

다음 예제에서는 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"