Monday, September 23, 2013

microsoft system center 2012 sp1 – used experience 3 vmm template

1.todo

添加、修改、删除套餐模板(参数为cpu,内存,硬盘等)

Add, modify, delete package template (parameter cpu, memory, hard drives, etc.)

2.appnix

New-SCApplicationProfile

The New-SCApplicationProfile cmdlet creates an application profile. Application profiles define the applications that will be installed during virtual machine deployment and servicing.

Add-SCOperatingSystem   

The Add-SCOperatingSystem cmdlet adds an operating system to an application profile object. Setting the operating system for an application profile determines which operating systems the profile is compatibile with. If no operating system is set, by default the profile is compatible with all operating systems.

Copy-SCVirtualHardDisk

The Copy-SCVirtualHarkDisk cmdlet copies a VMware virtual hard disk file (a .vmdk file) to a Windows-based virtual hard disk file (a .vhd file) and converts the virtual hard disk for use in a System Center Virtual Machine Manager (VMM) environment. The disk's contents are preserved by this copy operation.

VMware virtual hard disks, stored in .vmdk files, contain the virtual machine's guest operating system, applications, and data.

New-SCVMTemplate

The New-SCVMTemplate cmdlet creates a virtual machine template that administrators or self-service users can use to create virtual machines managed by System Center Virtual Machine Manager (VMM). A template stores hardware configuration and guest operating system information so that a specific template can be used repeatedly to create new virtual machines. The New-SCVMTemplate cmdlet stores the new template object in the VMM library.

You can create a template based on an existing virtual hard disk, an existing template, or from a virtual machine currently deployed on a virtual machine host. If you specify no parameters, VMM creates a default template object.

New-SCHardwareProfile

The New-SCHardwareProfile cmdlet creates a hardware profile for use in System Center Virtual Machine Manager (VMM) that stores hardware configuration information. You can create a standalone hardware profile or customize a template or virtual machine to include hardware profile settings. New-SCHardwareProfile stores the new hardware profile object in the VMM library.

Set-SCVMTemplate

Changes one or more properties of a virtual machine template used in a System Center Virtual Machine Manager (VMM) environment.

Properties that you can change include settings for the name of the template, its description, owner, organization name, time zone, operating system, and product key; BIOS boot order; CPU number and characteristics; the amount memory on the host that is assigned to a virtual machine; the amount of bandwidth on the host's network available to a virtual machine; whether a virtual machine created with this template will be highly available (i.e., deployed on a host that is part of a host cluster); values for domain or workgroup as well as domain credentials; a point quota that specifies how many new virtual machines self-service users can create; custom fields; and other options.

Changes that you make to a template affect only the template. Changes do not affect any existing virtual machines that were previously created by using this template.

3.implement – code and result

3.1 add one new application profile (添加应用程序配置)

code:

$AppProfile = New-SCApplicationProfile -Name "SvcWebAppProfile01" -Owner "cloud\administrator"

result:


image image




3.2 add one operation system (添加操作系统配置)


code:

$AppProfile = Get-SCApplicationProfile -Name "SvcWebAppProfile01"
$OS = Get-SCOperatingSystem -VMMServer "SCVMM.cloud.com" | where {$_.Name -eq "64-bit edition of Windows Server 2008 R2 Enterprise"}
Add-SCOperatingSystem -ApplicationProfile $AppProfile -OperatingSystem $OS



Result,and above "SCVMM.cloud.com" is from bellow:

image 

3.3 create hardware profile (创建硬件配置)


code:

$HWProfile = New-SCHardwareProfile -Name "NewHWProfile01" -CPUCount 1 -MemoryMB 512 -CPUMax 100 -Owner "cloud\administrator" -HighlyAvailable $True
result:
image image 

3.4 create vm template (添加虚拟机模板)


code:

$OS = Get-SCOperatingSystem -VMMServer "SCVMM.cloud.com" | where {$_.Name -eq "64-bit Edition of Windows Server 2008 R2 Datacenter"}
$VHD = Get-SCVirtualHardDisk -VMMServer "SCVMM.cloud.com" | where { $_.Name -eq "empty-small.vhd" -and $_.LibraryServer.Name -eq "SCVMM.cloud.com" }
$HWProfile = Get-SCHardwareProfile | where { $_.Name -eq "NewHWProfile01" }
New-SCVMTemplate -Name "VMTemplate01" -VirtualHardDisk $VHD -OperatingSystem $OS –NoCustomization -HardwareProfile $HWProfile



result:

image image 

3.5 remove vm template (删除虚拟机模板)

$Template = Get-SCVMTemplate -VMMServer "SCVMM.cloud.com" | where { $_.Name -eq "VMTemplate01" }
Remove-SCVMTemplate -VMTemplate $Template





4.ask – answer


Creating Linux VM Templates with System Center 2012 SP1 – Virtual Machine Manager

No comments: