New-SCVirtualMachine
New-SCVirtualMachine
Creates a virtual machine to be managed by VMM.
Syntax
Parameter Set: NewStoredVmFromHardwareProfile
New-SCVirtualMachine [-Name] <String> -LibraryServer <LibraryServer> -SharePath <String> [-CPUCount <Byte]> ] [-CPUCyclesLimitPercent <UInt16]> ] [-CPUCyclesReservePercent <UInt16]> ] [-CPULimitForMigration <Boolean> ] [-CPULimitFunctionality <Boolean> ] [-CPUPerVirtualNumaNodeMaximum <Byte]> ] [-CPURelativeWeight <Int32]> ] [-CPUType <ProcessorType> ] [-DelayStartSeconds <Int32]> ] [-Description <String> ] [-DynamicMemoryBufferPercentage <Int32]> ] [-DynamicMemoryEnabled <Boolean]> ] [-DynamicMemoryMaximumMB <Int32]> ] [-DynamicMemoryMinimumMB <Int32]> ] [-Generation <Int32> ] [-HardwareProfile <HardwareProfile> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-LinuxAdministratorSSHKey <SSHKey> ] [-LinuxAdministratorSSHKeyString <String> ] [-LinuxDomainName <String> ] [-MemoryMB <Int32]> ] [-MemoryPerVirtualNumaNodeMaximumMB <Int32]> ] [-MemoryWeight <Int32]> ] [-MonitorMaximumCount <Int32]> ] [-MonitorMaximumResolution <String> ] [-NumaIsolationRequired <Boolean]> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-OperatingSystem <OperatingSystem> ] [-Owner <String> ] [-PROTipID <Guid]> ] [-ReturnImmediately] [-RunAsynchronously] [-SkipInstallVirtualizationGuestServices] [-StartAction <VMStartAction> {NeverAutoTurnOnVM | AlwaysAutoTurnOnVM | TurnOnVMIfRunningWhenVSStopped} ] [-StopAction <VMStopAction> {SaveVM | TurnOffVM | ShutdownGuestOS} ] [-UseDiffDiskOptimization] [-UseLocalVirtualHardDisk] [-UserRole <UserRole> ] [-VirtualNumaNodesPerSocketMaximum <Byte]> ] [-VirtualVideoAdapterEnabled <Boolean]> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]
Parameter Set: NewStoredVmFromVirtualDisk
New-SCVirtualMachine [-Name] <String> -LibraryServer <LibraryServer> -SharePath <String> -VirtualHardDisk <StandaloneVirtualHardDisk> [-CPUCount <Byte]> ] [-CPUCyclesLimitPercent <UInt16]> ] [-CPUCyclesReservePercent <UInt16]> ] [-CPULimitForMigration <Boolean> ] [-CPULimitFunctionality <Boolean> ] [-CPUPerVirtualNumaNodeMaximum <Byte]> ] [-CPURelativeWeight <Int32]> ] [-CPUType <ProcessorType> ] [-DelayStartSeconds <Int32]> ] [-Description <String> ] [-DynamicMemoryBufferPercentage <Int32]> ] [-DynamicMemoryEnabled <Boolean]> ] [-DynamicMemoryMaximumMB <Int32]> ] [-DynamicMemoryMinimumMB <Int32]> ] [-Generation <Int32> ] [-HardwareProfile <HardwareProfile> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-LinuxAdministratorSSHKey <SSHKey> ] [-LinuxAdministratorSSHKeyString <String> ] [-LinuxDomainName <String> ] [-MemoryMB <Int32]> ] [-MemoryPerVirtualNumaNodeMaximumMB <Int32]> ] [-MemoryWeight <Int32]> ] [-MonitorMaximumCount <Int32]> ] [-MonitorMaximumResolution <String> ] [-NumaIsolationRequired <Boolean]> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-OperatingSystem <OperatingSystem> ] [-Owner <String> ] [-PROTipID <Guid]> ] [-ReturnImmediately] [-RunAsynchronously] [-SkipInstallVirtualizationGuestServices] [-StartAction <VMStartAction> {NeverAutoTurnOnVM | AlwaysAutoTurnOnVM | TurnOnVMIfRunningWhenVSStopped} ] [-StopAction <VMStopAction> {SaveVM | TurnOffVM | ShutdownGuestOS} ] [-UseDiffDiskOptimization] [-UseLocalVirtualHardDisk] [-UserRole <UserRole> ] [-VirtualNumaNodesPerSocketMaximum <Byte]> ] [-VirtualVideoAdapterEnabled <Boolean]> ] [ <CommonParameters>]
Parameter Set: NewStoredVmFromVm
New-SCVirtualMachine [-Name] <String> -LibraryServer <LibraryServer> -SharePath <String> -VM <VM> [-CPUCount <Byte]> ] [-CPUCyclesLimitPercent <UInt16]> ] [-CPUCyclesReservePercent <UInt16]> ] [-CPULimitForMigration <Boolean> ] [-CPULimitFunctionality <Boolean> ] [-CPUPerVirtualNumaNodeMaximum <Byte]> ] [-CPURelativeWeight <Int32]> ] [-CPUType <ProcessorType> ] [-DelayStartSeconds <Int32]> ] [-Description <String> ] [-DynamicMemoryBufferPercentage <Int32]> ] [-DynamicMemoryEnabled <Boolean]> ] [-DynamicMemoryMaximumMB <Int32]> ] [-DynamicMemoryMinimumMB <Int32]> ] [-HardwareProfile <HardwareProfile> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-LinuxAdministratorSSHKey <SSHKey> ] [-LinuxAdministratorSSHKeyString <String> ] [-LinuxDomainName <String> ] [-MemoryMB <Int32]> ] [-MemoryPerVirtualNumaNodeMaximumMB <Int32]> ] [-MemoryWeight <Int32]> ] [-MonitorMaximumCount <Int32]> ] [-MonitorMaximumResolution <String> ] [-NumaIsolationRequired <Boolean]> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-OperatingSystem <OperatingSystem> ] [-Owner <String> ] [-PROTipID <Guid]> ] [-ReturnImmediately] [-RunAsynchronously] [-SkipInstallVirtualizationGuestServices] [-StartAction <VMStartAction> {NeverAutoTurnOnVM | AlwaysAutoTurnOnVM | TurnOnVMIfRunningWhenVSStopped} ] [-StopAction <VMStopAction> {SaveVM | TurnOffVM | ShutdownGuestOS} ] [-UseDiffDiskOptimization] [-UseLocalVirtualHardDisk] [-UserRole <UserRole> ] [-VirtualNumaNodesPerSocketMaximum <Byte]> ] [-VirtualVideoAdapterEnabled <Boolean]> ] [ <CommonParameters>]
Parameter Set: NewVmFromComputerTierScaleOut
New-SCVirtualMachine [-Name] <String> -ComputerTier <ComputerTier> [-ComputerName <String> ] [-CPUCount <Byte]> ] [-CPUCyclesLimitPercent <UInt16]> ] [-CPUCyclesReservePercent <UInt16]> ] [-CPULimitForMigration <Boolean> ] [-CPULimitFunctionality <Boolean> ] [-CPUPerVirtualNumaNodeMaximum <Byte]> ] [-CPURelativeWeight <Int32]> ] [-CPUType <ProcessorType> ] [-DelayStartSeconds <Int32]> ] [-Description <String> ] [-DynamicMemoryBufferPercentage <Int32]> ] [-DynamicMemoryEnabled <Boolean]> ] [-DynamicMemoryMaximumMB <Int32]> ] [-DynamicMemoryMinimumMB <Int32]> ] [-HardwareProfile <HardwareProfile> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-LinuxAdministratorSSHKey <SSHKey> ] [-LinuxAdministratorSSHKeyString <String> ] [-LinuxDomainName <String> ] [-MemoryMB <Int32]> ] [-MemoryPerVirtualNumaNodeMaximumMB <Int32]> ] [-MemoryWeight <Int32]> ] [-MonitorMaximumCount <Int32]> ] [-MonitorMaximumResolution <String> ] [-NumaIsolationRequired <Boolean]> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-OperatingSystem <OperatingSystem> ] [-Owner <String> ] [-PROTipID <Guid]> ] [-ReturnImmediately] [-RunAsynchronously] [-SkipInstallVirtualizationGuestServices] [-StartAction <VMStartAction> {NeverAutoTurnOnVM | AlwaysAutoTurnOnVM | TurnOnVMIfRunningWhenVSStopped} ] [-StopAction <VMStopAction> {SaveVM | TurnOffVM | ShutdownGuestOS} ] [-UseDiffDiskOptimization] [-UseLocalVirtualHardDisk] [-UserRole <UserRole> ] [-VirtualNumaNodesPerSocketMaximum <Byte]> ] [-VirtualVideoAdapterEnabled <Boolean]> ] [ <CommonParameters>]
Parameter Set: NewVmFromHWProfile
New-SCVirtualMachine [-Name] <String> -Path <String> -VMHost <Host> [-BlockDynamicOptimization <Boolean]> ] [-CPUCount <Byte]> ] [-CPUCyclesLimitPercent <UInt16]> ] [-CPUCyclesReservePercent <UInt16]> ] [-CPULimitForMigration <Boolean> ] [-CPULimitFunctionality <Boolean> ] [-CPUPerVirtualNumaNodeMaximum <Byte]> ] [-CPURelativeWeight <Int32]> ] [-CPUType <ProcessorType> ] [-DelayStartSeconds <Int32]> ] [-Description <String> ] [-DRProtectionRequired <Boolean]> ] [-DynamicMemoryBufferPercentage <Int32]> ] [-DynamicMemoryEnabled <Boolean]> ] [-DynamicMemoryMaximumMB <Int32]> ] [-DynamicMemoryMinimumMB <Int32]> ] [-Generation <Int32> ] [-HardwareProfile <HardwareProfile> ] [-HighlyAvailable <Boolean]> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-LinuxAdministratorSSHKey <SSHKey> ] [-LinuxAdministratorSSHKeyString <String> ] [-LinuxDomainName <String> ] [-MemoryMB <Int32]> ] [-MemoryPerVirtualNumaNodeMaximumMB <Int32]> ] [-MemoryWeight <Int32]> ] [-MonitorMaximumCount <Int32]> ] [-MonitorMaximumResolution <String> ] [-NumaIsolationRequired <Boolean]> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-OperatingSystem <OperatingSystem> ] [-Owner <String> ] [-ProtectionProvider <Nullable [Microsoft.VirtualManager.Utils.ProtectionProvider]> ] [-PROTipID <Guid]> ] [-RecoveryPointObjective <Int32]> ] [-ReplicationGroup <Microsoft.SystemCenter.VirtualMachineManager.ReplicationGroup> ] [-ReturnImmediately] [-RunAsynchronously] [-SkipInstallVirtualizationGuestServices] [-StartAction <VMStartAction> {NeverAutoTurnOnVM | AlwaysAutoTurnOnVM | TurnOnVMIfRunningWhenVSStopped} ] [-StartVM] [-StopAction <VMStopAction> {SaveVM | TurnOffVM | ShutdownGuestOS} ] [-UseDiffDiskOptimization] [-UseLocalVirtualHardDisk] [-UserRole <UserRole> ] [-VirtualNumaNodesPerSocketMaximum <Byte]> ] [-VirtualVideoAdapterEnabled <Boolean]> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]
Parameter Set: NewVmFromTemplate
New-SCVirtualMachine [-Name] <String> -Path <String> -VMHost <Host> -VMTemplate <Template> [-AnswerFile <Script> ] [-BlockDynamicOptimization <Boolean]> ] [-ComputerName <String> ] [-CPUCount <Byte]> ] [-CPUCyclesLimitPercent <UInt16]> ] [-CPUCyclesReservePercent <UInt16]> ] [-CPULimitForMigration <Boolean> ] [-CPULimitFunctionality <Boolean> ] [-CPUPerVirtualNumaNodeMaximum <Byte]> ] [-CPURelativeWeight <Int32]> ] [-CPUType <ProcessorType> ] [-DelayStartSeconds <Int32]> ] [-Description <String> ] [-Domain <String> ] [-DomainJoinCredential <VMMCredential> ] [-DRProtectionRequired <Boolean]> ] [-DynamicMemoryBufferPercentage <Int32]> ] [-DynamicMemoryEnabled <Boolean]> ] [-DynamicMemoryMaximumMB <Int32]> ] [-DynamicMemoryMinimumMB <Int32]> ] [-FullName <String> ] [-GuestOSProfile <GuestOSProfile> ] [-GuiRunOnceCommands <String[]> ] [-HardwareProfile <HardwareProfile> ] [-HighlyAvailable <Boolean]> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-LinuxAdministratorSSHKey <SSHKey> ] [-LinuxAdministratorSSHKeyString <String> ] [-LinuxDomainName <String> ] [-LocalAdministratorCredential <VMMCredential> ] [-MemoryMB <Int32]> ] [-MemoryPerVirtualNumaNodeMaximumMB <Int32]> ] [-MemoryWeight <Int32]> ] [-MergeAnswerFile <Boolean> ] [-MonitorMaximumCount <Int32]> ] [-MonitorMaximumResolution <String> ] [-NumaIsolationRequired <Boolean]> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-OperatingSystem <OperatingSystem> ] [-OrganizationName <String> ] [-Owner <String> ] [-ProductKey <String> ] [-ProtectionProvider <Nullable [Microsoft.VirtualManager.Utils.ProtectionProvider]> ] [-PROTipID <Guid]> ] [-RecoveryPointObjective <Int32]> ] [-ReplicationGroup <Microsoft.SystemCenter.VirtualMachineManager.ReplicationGroup> ] [-ReturnImmediately] [-RunAsynchronously] [-SkipInstallVirtualizationGuestServices] [-StartAction <VMStartAction> {NeverAutoTurnOnVM | AlwaysAutoTurnOnVM | TurnOnVMIfRunningWhenVSStopped} ] [-StartVM] [-StopAction <VMStopAction> {SaveVM | TurnOffVM | ShutdownGuestOS} ] [-TimeZone <Int32]> ] [-UseDiffDiskOptimization] [-UseLocalVirtualHardDisk] [-UserRole <UserRole> ] [-VirtualNumaNodesPerSocketMaximum <Byte]> ] [-VirtualVideoAdapterEnabled <Boolean]> ] [-Workgroup <String> ] [ <CommonParameters>]
Parameter Set: NewVmFromVirtualDisk
New-SCVirtualMachine [-Name] <String> -Path <String> -VirtualHardDisk <StandaloneVirtualHardDisk> -VMHost <Host> [-BlockDynamicOptimization <Boolean]> ] [-CPUCount <Byte]> ] [-CPUCyclesLimitPercent <UInt16]> ] [-CPUCyclesReservePercent <UInt16]> ] [-CPULimitForMigration <Boolean> ] [-CPULimitFunctionality <Boolean> ] [-CPUPerVirtualNumaNodeMaximum <Byte]> ] [-CPURelativeWeight <Int32]> ] [-CPUType <ProcessorType> ] [-DelayStartSeconds <Int32]> ] [-Description <String> ] [-DRProtectionRequired <Boolean]> ] [-DynamicMemoryBufferPercentage <Int32]> ] [-DynamicMemoryEnabled <Boolean]> ] [-DynamicMemoryMaximumMB <Int32]> ] [-DynamicMemoryMinimumMB <Int32]> ] [-Generation <Int32> ] [-HardwareProfile <HardwareProfile> ] [-HighlyAvailable <Boolean]> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-LinuxAdministratorSSHKey <SSHKey> ] [-LinuxAdministratorSSHKeyString <String> ] [-LinuxDomainName <String> ] [-MemoryMB <Int32]> ] [-MemoryPerVirtualNumaNodeMaximumMB <Int32]> ] [-MemoryWeight <Int32]> ] [-MonitorMaximumCount <Int32]> ] [-MonitorMaximumResolution <String> ] [-NumaIsolationRequired <Boolean]> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-OperatingSystem <OperatingSystem> ] [-Owner <String> ] [-ProtectionProvider <Nullable [Microsoft.VirtualManager.Utils.ProtectionProvider]> ] [-PROTipID <Guid]> ] [-RecoveryPointObjective <Int32]> ] [-ReplicationGroup <Microsoft.SystemCenter.VirtualMachineManager.ReplicationGroup> ] [-ReturnImmediately] [-RunAsynchronously] [-SkipInstallVirtualizationGuestServices] [-StartAction <VMStartAction> {NeverAutoTurnOnVM | AlwaysAutoTurnOnVM | TurnOnVMIfRunningWhenVSStopped} ] [-StartVM] [-StopAction <VMStopAction> {SaveVM | TurnOffVM | ShutdownGuestOS} ] [-UseDiffDiskOptimization] [-UseLocalVirtualHardDisk] [-UserRole <UserRole> ] [-VirtualNumaNodesPerSocketMaximum <Byte]> ] [-VirtualVideoAdapterEnabled <Boolean]> ] [ <CommonParameters>]
Parameter Set: NewVmFromVm
New-SCVirtualMachine [-Name] <String> -Path <String> -VM <VM> -VMHost <Host> [-CPUCount <Byte]> ] [-CPUCyclesLimitPercent <UInt16]> ] [-CPUCyclesReservePercent <UInt16]> ] [-CPULimitForMigration <Boolean> ] [-CPULimitFunctionality <Boolean> ] [-CPUPerVirtualNumaNodeMaximum <Byte]> ] [-CPURelativeWeight <Int32]> ] [-CPUType <ProcessorType> ] [-DelayStartSeconds <Int32]> ] [-Description <String> ] [-DynamicMemoryBufferPercentage <Int32]> ] [-DynamicMemoryEnabled <Boolean]> ] [-DynamicMemoryMaximumMB <Int32]> ] [-DynamicMemoryMinimumMB <Int32]> ] [-HardwareProfile <HardwareProfile> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-LinuxAdministratorSSHKey <SSHKey> ] [-LinuxAdministratorSSHKeyString <String> ] [-LinuxDomainName <String> ] [-MemoryMB <Int32]> ] [-MemoryPerVirtualNumaNodeMaximumMB <Int32]> ] [-MemoryWeight <Int32]> ] [-MonitorMaximumCount <Int32]> ] [-MonitorMaximumResolution <String> ] [-NumaIsolationRequired <Boolean]> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-OperatingSystem <OperatingSystem> ] [-Owner <String> ] [-PROTipID <Guid]> ] [-ReturnImmediately] [-RunAsynchronously] [-SkipInstallVirtualizationGuestServices] [-StartAction <VMStartAction> {NeverAutoTurnOnVM | AlwaysAutoTurnOnVM | TurnOnVMIfRunningWhenVSStopped} ] [-StartVM] [-StopAction <VMStopAction> {SaveVM | TurnOffVM | ShutdownGuestOS} ] [-UseDiffDiskOptimization] [-UseLocalVirtualHardDisk] [-UserRole <UserRole> ] [-VirtualNumaNodesPerSocketMaximum <Byte]> ] [-VirtualVideoAdapterEnabled <Boolean]> ] [ <CommonParameters>]
Parameter Set: NewVmFromVmCloud
New-SCVirtualMachine [-Name] <String> -Cloud <Cloud> -VM <VM> [-CapabilityProfile <CapabilityProfile> ] [-CPUCount <Byte]> ] [-CPUCyclesLimitPercent <UInt16]> ] [-CPUCyclesReservePercent <UInt16]> ] [-CPULimitForMigration <Boolean> ] [-CPULimitFunctionality <Boolean> ] [-CPUPerVirtualNumaNodeMaximum <Byte]> ] [-CPURelativeWeight <Int32]> ] [-CPUType <ProcessorType> ] [-DelayStartSeconds <Int32]> ] [-Description <String> ] [-DynamicMemoryBufferPercentage <Int32]> ] [-DynamicMemoryEnabled <Boolean]> ] [-DynamicMemoryMaximumMB <Int32]> ] [-DynamicMemoryMinimumMB <Int32]> ] [-HardwareProfile <HardwareProfile> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-LinuxAdministratorSSHKey <SSHKey> ] [-LinuxAdministratorSSHKeyString <String> ] [-LinuxDomainName <String> ] [-MemoryMB <Int32]> ] [-MemoryPerVirtualNumaNodeMaximumMB <Int32]> ] [-MemoryWeight <Int32]> ] [-MonitorMaximumCount <Int32]> ] [-MonitorMaximumResolution <String> ] [-NumaIsolationRequired <Boolean]> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-OperatingSystem <OperatingSystem> ] [-Owner <String> ] [-PROTipID <Guid]> ] [-ReturnImmediately] [-RunAsynchronously] [-SelfServiceRole <SelfServiceUserRole> ] [-SkipInstallVirtualizationGuestServices] [-StartAction <VMStartAction> {NeverAutoTurnOnVM | AlwaysAutoTurnOnVM | TurnOnVMIfRunningWhenVSStopped} ] [-StartVM] [-StopAction <VMStopAction> {SaveVM | TurnOffVM | ShutdownGuestOS} ] [-StoreToLibrary] [-UseDiffDiskOptimization] [-UseLocalVirtualHardDisk] [-UserRole <UserRole> ] [-VirtualNumaNodesPerSocketMaximum <Byte]> ] [-VirtualVideoAdapterEnabled <Boolean]> ] [ <CommonParameters>]
Parameter Set: NewVmFromVmConfig
New-SCVirtualMachine [-Name] <String> -VMConfiguration <BaseVMConfiguration> [-AnswerFile <Script> ] [-BlockDynamicOptimization <Boolean]> ] [-CapabilityProfile <CapabilityProfile> ] [-Cloud <Cloud> ] [-ComputerName <String> ] [-CPUCount <Byte]> ] [-CPUCyclesLimitPercent <UInt16]> ] [-CPUCyclesReservePercent <UInt16]> ] [-CPULimitForMigration <Boolean> ] [-CPULimitFunctionality <Boolean> ] [-CPUPerVirtualNumaNodeMaximum <Byte]> ] [-CPURelativeWeight <Int32]> ] [-CPUType <ProcessorType> ] [-DelayStartSeconds <Int32]> ] [-Description <String> ] [-Domain <String> ] [-DomainJoinCredential <VMMCredential> ] [-DynamicMemoryBufferPercentage <Int32]> ] [-DynamicMemoryEnabled <Boolean]> ] [-DynamicMemoryMaximumMB <Int32]> ] [-DynamicMemoryMinimumMB <Int32]> ] [-FullName <String> ] [-GuestOSProfile <GuestOSProfile> ] [-GuiRunOnceCommands <String[]> ] [-HardwareProfile <HardwareProfile> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-LinuxAdministratorSSHKey <SSHKey> ] [-LinuxAdministratorSSHKeyString <String> ] [-LinuxDomainName <String> ] [-LocalAdministratorCredential <VMMCredential> ] [-MemoryMB <Int32]> ] [-MemoryPerVirtualNumaNodeMaximumMB <Int32]> ] [-MemoryWeight <Int32]> ] [-MergeAnswerFile <Boolean> ] [-MonitorMaximumCount <Int32]> ] [-MonitorMaximumResolution <String> ] [-NumaIsolationRequired <Boolean]> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-OperatingSystem <OperatingSystem> ] [-OrganizationName <String> ] [-Owner <String> ] [-ProductKey <String> ] [-PROTipID <Guid]> ] [-ReturnImmediately] [-RunAsynchronously] [-SelfServiceRole <SelfServiceUserRole> ] [-SkipInstallVirtualizationGuestServices] [-StartAction <VMStartAction> {NeverAutoTurnOnVM | AlwaysAutoTurnOnVM | TurnOnVMIfRunningWhenVSStopped} ] [-StartVM] [-StopAction <VMStopAction> {SaveVM | TurnOffVM | ShutdownGuestOS} ] [-StoreToLibrary] [-TimeZone <Int32]> ] [-UseDiffDiskOptimization] [-UseLocalVirtualHardDisk] [-UserRole <UserRole> ] [-VirtualNumaNodesPerSocketMaximum <Byte]> ] [-VirtualVideoAdapterEnabled <Boolean]> ] [-Workgroup <String> ] [ <CommonParameters>]
Parameter Set: NewVmFromVmConfigScaleOut
New-SCVirtualMachine [-Name] <String> -VMConfigurationScaleOut <BaseVMConfiguration> [-CPUCount <Byte]> ] [-CPUCyclesLimitPercent <UInt16]> ] [-CPUCyclesReservePercent <UInt16]> ] [-CPULimitForMigration <Boolean> ] [-CPULimitFunctionality <Boolean> ] [-CPUPerVirtualNumaNodeMaximum <Byte]> ] [-CPURelativeWeight <Int32]> ] [-CPUType <ProcessorType> ] [-DelayStartSeconds <Int32]> ] [-Description <String> ] [-DynamicMemoryBufferPercentage <Int32]> ] [-DynamicMemoryEnabled <Boolean]> ] [-DynamicMemoryMaximumMB <Int32]> ] [-DynamicMemoryMinimumMB <Int32]> ] [-HardwareProfile <HardwareProfile> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-LinuxAdministratorSSHKey <SSHKey> ] [-LinuxAdministratorSSHKeyString <String> ] [-LinuxDomainName <String> ] [-MemoryMB <Int32]> ] [-MemoryPerVirtualNumaNodeMaximumMB <Int32]> ] [-MemoryWeight <Int32]> ] [-MonitorMaximumCount <Int32]> ] [-MonitorMaximumResolution <String> ] [-NumaIsolationRequired <Boolean]> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-OperatingSystem <OperatingSystem> ] [-Owner <String> ] [-PROTipID <Guid]> ] [-ReturnImmediately] [-RunAsynchronously] [-SkipInstallVirtualizationGuestServices] [-StartAction <VMStartAction> {NeverAutoTurnOnVM | AlwaysAutoTurnOnVM | TurnOnVMIfRunningWhenVSStopped} ] [-StopAction <VMStopAction> {SaveVM | TurnOffVM | ShutdownGuestOS} ] [-UseDiffDiskOptimization] [-UseLocalVirtualHardDisk] [-UserRole <UserRole> ] [-VirtualNumaNodesPerSocketMaximum <Byte]> ] [-VirtualVideoAdapterEnabled <Boolean]> ] [ <CommonParameters>]
Detailed Description
The New-SCVirtualMachine cmdlet creates a virtual machine to be managed by Virtual Machine Manager (VMM). You can create a virtual machine from an existing stopped virtual machine deployed on a host, from an existing virtual machine stored in the VMM library, from a virtual machine template, from an existing virtual hard disk that already contains an operating system, or from a blank virtual hard disk. For example, you can create a new virtual machine from an existing hard disk that contains a third-party operating system, such as Linux.
New in System Center 2012 Service Pack 1 (SP1), you can create a virtual machine by using a differencing disk. For more information about differencing disks, see New-SCVirtualDiskDrive.
When you deploy a new virtual machine to a Hyper-V host, you can specify a location for the virtual machine files, or use the default path of <C>:\ProgramData\Microsoft\Windows\Hyper-V.
When you deploy a new virtual machine on a VMware ESX host or Citrix XenServer host, there is no default path to store the virtual machine files, so you must specify the path when you create the virtual machine.
As an alternative to using New-SCVirtualMachine, you can also use the following cmdlets to create a new virtual machine:
-- New-SCP2V. Creates a new virtual machine from an existing physical machine. This is a P2V conversion. For more information, type Get-Help New-SCP2V -detailed
.
-- New-SCV2V. Creates a new virtual machine from an existing virtual machine, such as a virtual machine created in VMWare. This is a V2V conversion. For more information, type Get-Help New-SCV2V -detailed
.
Parameters
-AnswerFile<Script>
Specifies a script object stored in the VMM library to use as an answer file. The name of the answer file script depends on the operating system that you want to install on a virtual machine:
-- Sysprep.inf. Windows XP, Windows Server 2000, or Windows Server 2003.
-- Unattend.xml. Windows Vista, Windows 7, or Windows Server 2008.
Aliases |
SysPrepFile |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-BlockDynamicOptimization<Boolean]>
Indicates whether dynamic optimization is blocked for a virtual machine.
Aliases |
ExcludeFromPRO |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-CapabilityProfile<CapabilityProfile>
Specifies a capability profile object.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Cloud<Cloud>
Specifies a private cloud object.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ComputerName<String>
Specifies the name of a computer that VMM can uniquely identify on your network. Valid formats are:
-- FQDN
-- IPv4 or IPv6 address
-- NetBIOS name
NOTE: See the examples for a specific cmdlet to determine how that cmdlet specifies the computer name.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ComputerTier<ComputerTier>
Specifies a computer tier object.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-CPUCount<Byte]>
Specifies the number of CPUs on a virtual machine, on a hardware profile, or on a template. See the examples for a specific cmdlet to determine how that cmdlet uses this parameter.
-- Hyper-V. Up to four CPUs per virtual machine, depending on guest operating system.
-- VMware ESX. Up to four CPUs per virtual machine for any supported guest operating system, except for a virtual machine that runs Windows NT 4.0, which supports one CPU.
-- Citrix XenServer. Up to eight CPUs per virtual machine, depending on guest operating system.
Aliases |
ProcessorCount |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-CPUCyclesLimitPercent<UInt16]>
Specifies the limit of CPU cycles in percent.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-CPUCyclesReservePercent<UInt16]>
Specifies the reserve CPU cycles in percent.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-CPULimitForMigration<Boolean>
Indicates whether to limit, when set to $True, processor features for the specified virtual machine in order to enable migration to a physical computer that has a different version of the same processor as the source computer. VMM does not support migrating virtual machines between physical computers that have processors from different manufacturers.
Aliases |
LimitCPUForMigration |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-CPULimitFunctionality<Boolean>
Indicates whether to run an older operating system, such as Windows NT 4.0, on a virtual machine deployed on a Hyper-V host or on a VMware ESX host by providing limited CPU functionality for the virtual machine.
Aliases |
LimitCPUFunctionality |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-CPUPerVirtualNumaNodeMaximum<Byte]>
Specifies the maximum number of CPUs allowed for each virtual NUMA node.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-CPURelativeWeight<Int32]>
Specifies the amount of CPU resources on a host that this virtual machine can use relative to other virtual machines on the same host. A virtual machine with a higher setting is allocated more CPU resources than a virtual machine with a lower setting. The range of relative values for each type of host are:
Hyper-V: 1 to 10000
VMware ESX: 2000 = High
1500 = Above Normal
1000 = Normal (default)
750 = Below Normal
500 = Low
1 to 1000000 = Custom
The VMware term for these values is shares.
Citrix XenServer: 1 to 65536, normal is 256
NOTE: See the examples for a specific cmdlet to determine how that cmdlet uses this parameter.
Aliases |
RelativeWeight |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-CPUType<ProcessorType>
Specifies the type of CPU for a virtual machine. To retrieve a list of all CPU types that are available for use in virtual machines in a VMM environment, type Get-SCCPUType
.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-DelayStartSeconds<Int32]>
Specifies the number of seconds to wait after the virtualization service starts before automatically starting a virtual machine. This delay is used to stagger the startup time of multiple virtual machines to help reduce the demand on the physical computer resources. A typical setting is 30 to 60 seconds.
The maximum configurable delay is:
Hyper-V: 1000000000 seconds (277777 hours)
VMware ESX: 65535 seconds (18 hours)
Citrix XenServer: Does not apply to XenServer virtual machines.
Aliases |
DelayStart |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Description<String>
States a description for the specified object.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Domain<String>
Specifies a fully qualified domain name (FQDN) for an Active Directory domain.
Example format: -Domain "Domain01.Corp.Contoso.com"
Aliases |
JoinDomain |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-DomainJoinCredential<VMMCredential>
Specifies the user name and password of an account with permission to join a computer to the domain. A limited rights account should be used for joining computers (either physical or virtual) to the domain.
Example format for a Windows PowerShell credential:
$DomainJoinCredential = Get-Credential -Domain "ThisDomain.Corp.Contoso.com" -DomainJoinCredential $DomainJoinCredential
Example format for a Run As account:
$DomainJoinCredential = Get-SCRunAsAccount -Name "RunAsAcct01" -Domain "ThisDomain.Corp.Contoso.com" -DomainJoinCredential $DomainJoinCredential
NOTE: You can use the DomainJoinCredential parameter to specify credentials on a VMHostProfile for joining a physical host computer to the domain, or to specify credentials on a new or existing template, on a new or existing guest operating system profile, or on a new virtual machine for joining a virtual machine to the domain.
Aliases |
JoinDomainCredential |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-DRProtectionRequired<Boolean]>
This parameter is reserved for future use.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-DynamicMemoryBufferPercentage<Int32]>
Specifies the percentage of memory above a virtual machine current memory allocation that the host should try to reserve as a buffer. The default value is 20.
Example format: -DynamicMemoryBufferPercentage 20
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-DynamicMemoryEnabled<Boolean]>
Enables, when set to $True, dynamic memory for virtual machines. You can enable dynamic memory directly on a virtual machine, or on a template or hardware profile that will be used to create virtual machines. The default value is $False.
REQUIRED: You can enable dynamic memory for a virtual machine only if that virtual machine is deployed on a host running Windows Server 2008 SP1 or later or if the virtual machine is stored in a library in a stopped state. Hardware changes to a stored virtual machine can only be made if the virtual machine does not have snapshots. Enabling dynamic memory on a virtual machine stored in a library will limit placement of that machine to hosts running Windows Server 2008 SP1 or later.
Example format: -DynamicMemoryEnabled $True
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-DynamicMemoryMaximumMB<Int32]>
Specifies the maximum amount of memory that can be allocated to a virtual machine if dynamic memory is enabled. The default value is 65536.
REQUIRED: You can enable dynamic memory for a virtual machine only if that virtual machine is deployed on a host running Windows Server 2008 R2 SP1 or later or if the virtual machine is stored in a library in a stopped state. Hardware changes to a stored virtual machine can only be made if the virtual machine does not have snapshots. Enabling dynamic memory on a virtual machine stored in a library will limit placement of that machine to hosts running Windows Server 2008 R2 SP1 or later.
Example format: -DynamicMemoryMaximumMB 1024
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-DynamicMemoryMinimumMB<Int32]>
Specifies the minimum amount of memory that can be allocated to a virtual machine if dynamic memory is enabled. The default value is 65536.
REQUIRED: You can enable dynamic memory for a virtual machine only if that virtual machine is deployed on a host running Windows Server 2008 R2 SP1 or later or if the virtual machine is stored in a library in a stopped state. Hardware changes to a stored virtual machine can only be made if the virtual machine does not have snapshots. Enabling dynamic memory on a virtual machine stored in a library will limit placement of that machine to hosts running Windows Server 2008 R2 SP1 or later.
Example format: -DynamicMemoryMinimumMB 1024
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-FullName<String>
Specifies the name of the person in whose name a virtual machine is registered.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Generation<Int32>
Indicates the generation of virtual machine that is created.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-GuestOSProfile<GuestOSProfile>
Specifies a guest operating system profile object.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-GuiRunOnceCommands<String[]>
Specifies one or more commands to add to the [GuiRunOnce] section of an unattended answer file such as Unattend.xml. Use single quotes around each string enclosed in double quotes.
Example format:
-GuiRunOnceCommands '"C:\APF\APFPostSysPrepCopy.cmd PARAMS1"', '"C:\APF\APFPostSysPrepCopy.cmd PARAMS1"'
For information about how Windows PowerShell uses quotes, type Get-Help about_Quoting_Rules
.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-HardwareProfile<HardwareProfile>
Specifies a hardware profile object.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-HighlyAvailable<Boolean]>
Indicates whether a virtual machine is placed on a Hyper-V host that is part of a host cluster. Configure this setting on a virtual machine, or on a template or hardware profile that you use to create virtual machines.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-JobGroup<Guid]>
Specifies an identifier for a series of commands that will run as a set just before the final command that includes the same job group identifier runs.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-JobVariable<String>
Specifies that job progress is tracked and stored in the variable named by this parameter.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-LibraryServer<LibraryServer>
Specifies a VMM library server object.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-LinuxAdministratorSSHKey<SSHKey>
Specifies the public key file for a Linux SSH Key.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-LinuxAdministratorSSHKeyString<String>
Specifies, as a string, a Linux administrator SSH key.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-LinuxDomainName<String>
Specifies a fully qualified domain name (FQDN) to be used in conjunction with Linux operating system specialization.
Example format: -LinuxDomainName "Domain01.Corp.Contoso.com"
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-LocalAdministratorCredential<VMMCredential>
Specifies the user name and password for the Local Administrator account (or Linux root account in the case of a Linux compatible Guest Operating System profile).
Specifying credentials on a new or existing template, on a new or existing guest operating system profile, or on a new virtual machine overrides any existing Administrator password.
Aliases |
AdminPasswordCredential |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-MemoryMB<Int32]>
Specifies, in megabytes (MB), the amount of random access memory (RAM) on the host that is allocated to a virtual machine. The default value is 512 MB. For a virtual machine on which dynamic memory is enabled on a host running Windows Server 2008 R2 SP1 or later, use MemoryMB to specify the startup memory value. The maximum host memory assignable to a virtual machine is:
-- Hyper-V: Up to 65536 MB RAM per virtual machine.
-- VMware ESX Server 3.0.x: Up to 16384 MB RAM per virtual machine.
-- VMware ESX Server 3.5.x: Up to 65532 MB RAM per virtual machine.
-- Citrix XenServer: Up to 32265 MB RAM per virtual machine.
Example format: -MemoryMB 1024
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-MemoryPerVirtualNumaNodeMaximumMB<Int32]>
Specifies the maximum amount of memory, in MB, that each virtual NUMA node is allowed.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-MemoryWeight<Int32]>
Indicates the priority in allocating memory to a virtual machine, relative to other virtual machines on the same host. A virtual machine with a higher setting is allocated more memory resources than a virtual machine with a lower setting. For a host running Windows Server 2008 R2 SP1 or later:
5000 = Normal
10000 = High
0 = Low
1 to 10000 = Custom
NOTE: See the examples for a specific cmdlet to determine how that cmdlet uses this parameter.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-MergeAnswerFile<Boolean>
Indicates whether this cmdlet merges the specified answer file with the specified guest operating system settings. The default value is $True. This parameter is used by the VMM console. You do not need to use this parameter at the command prompt.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-MonitorMaximumCount<Int32]>
Specifies the maximum number of monitors supported by a virtual video adapter.
Example format: -MonitorMaximumCount 3
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-MonitorMaximumResolution<String>
Specifies, as a string, the value that represents the maximum possible monitor resolution of a virtual video adapter. Valid values are:
-- 1024x768
-- 1280x1024
-- 1600x1200
-- 1920x1200
The default value is 1280x1024.
Example format: -MonitorMaximumResolution "1600x1200"
Aliases |
MonitorResolutionMaximum |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Name<String>
Specifies the name of a VMM object.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-NumaIsolationRequired<Boolean]>
Indicates whether NUMA isolation is required.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-OnBehalfOfUser<System.String>
-- Sysprep.inf. Windows XP, Windows Server 2000, or Windows Server 2003.
-- Unattend.xml. Windows Vista, Windows 7, or Windows Server 2008.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-OnBehalfOfUserRole<Microsoft.SystemCenter.VirtualMachineManager.UserRole>
-- Sysprep.inf. Windows XP, Windows Server 2000, or Windows Server 2003.
-- Unattend.xml. Windows Vista, Windows 7, or Windows Server 2008.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-OperatingSystem<OperatingSystem>
Specifies the type of operating system for a virtual machine. To list the names of all available operating systems in VMM, type Get-SCOperatingSystem
.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-OrganizationName<String>
Specifies the name of the organization for the person in whose name a virtual machine is registered.
Aliases |
OrgName |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Owner<String>
Specifies the owner of a VMM object in the form of a valid domain user account.
Example format: -Owner "Contoso\ReneeLo"
Example format: -Owner "ReneeLo@Contoso"
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Path<String>
Specifies the destination path for the operation.
Example formats:
Local: -Path "F:\"
UNC: -Path "\\Library\Templates"
Volume GUID: -Path "\\?\Volume{4703c1ea-8ae7-11db-b473-00123f7603e3}\"
VMware ESX: -Path "[storage1]\MyVMwareFolderForVMs\MyVM.vmx"
Citrix XenServer: -Path "Local storage[99b6212f-b63d-c676-25f9-d6c460992de7]"
Wildcards are supported for Get- cmdlets and when you specify the UNC path.
Example format:
UNC: -Path "\\VMHostServer\MyVMs\*VM*"
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ProductKey<String>
Specifies a product key. The product key is a 25-digit number that identifies the product license. A product key can be used to register VMM or an operating system to be installed on a virtual machine or host.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ProtectionProvider<Nullable [Microsoft.VirtualManager.Utils.ProtectionProvider]>
-- Sysprep.inf. Windows XP, Windows Server 2000, or Windows Server 2003.
-- Unattend.xml. Windows Vista, Windows 7, or Windows Server 2008.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-PROTipID<Guid]>
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-RecoveryPointObjective<Int32]>
Specifies the maximum period for which it is tolerable to lose data from an IT service due to a major incident.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ReplicationGroup<Microsoft.SystemCenter.VirtualMachineManager.ReplicationGroup>
-- Sysprep.inf. Windows XP, Windows Server 2000, or Windows Server 2003.
-- Unattend.xml. Windows Vista, Windows 7, or Windows Server 2008.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ReturnImmediately
Indicates that control is returned to the calling process immediately, before the job is created.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-RunAsynchronously
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-SelfServiceRole<SelfServiceUserRole>
Specifies the self-service role with permission to access the virtual machine.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-SharePath<String>
Specifies a path to a valid library share on an existing library server that uses a Universal Naming Convention (UNC) path.
Example format: -SharePath "\\LibServer01\LibShare"
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-SkipInstallVirtualizationGuestServices
Indicates that this cmdlet skips the installation of virtualization guest services on a virtual machine. By default, this parameter is set to $False and VMM installs the appropriate virtualization guest service automatically. For a virtual machine on a Hyper-V host, the virtualization guest service is called Integration Components (VMGuest.iso). For a virtual machine on a XenServer host, the virtualization guest service is called Citrix Tools for Virtual Machines (xs-tools.iso). Virtual machines on a VMware ESX host do not use a virtualization guest service.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-StartAction<VMStartAction>
Specifies the behavior of a virtual machine when the virtualization service (Hyper-V, VMware, or XenServer) starts. Valid values are:
-- AlwaysAutoTurnOnVM
-- NeverAutoTurnOnVM
-- TurnOnVMIfRunningWhenVSStopped
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-StartVM
Indicates that the virtual machine starts when it arrives at the destination host.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-StopAction<VMStopAction>
Specifies the behavior of the virtual machine when the Hyper-V, VMware, or XenServer virtualization service stops. Valid values are:
-- SaveVM
-- TurnOffVM
-- ShutdownGuestOS
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-StoreToLibrary
Indicates that the virtual machine should be stored in the VMM library.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-TimeZone<Int32]>
Specifies a number (an index) that identifies a geographical region that shares the same standard time. For a list of time zone indexes, see Microsoft Time Zone Index Values (https://go.microsoft.com/fwlink/?LinkId=120935) on the Microsoft Developer Network. If no time zone is specified, the default time zone used for a virtual machine is the same time zone setting that is on the virtual machine host.
Example format to specify the GMT Standard Time zone: -TimeZone 085
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-UseDiffDiskOptimization
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-UseLocalVirtualHardDisk
Verifies that the VHD file (or files) to be used to create the virtual machine exist and are stored on the destination host.
Aliases |
UseLocalVirtualHardDisks |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-UserRole<UserRole>
Specifies a user role object.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-VirtualHardDisk<StandaloneVirtualHardDisk>
Specifies a virtual hard disk object.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-VirtualNumaNodesPerSocketMaximum<Byte]>
Specifies the maximum number of NUMA nodes allowed for each socket.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-VirtualVideoAdapterEnabled<Boolean]>
Indicates whether to enable the Microsoft Synthetic 3D Virtual Video Adapter for virtual machines. You can enable the Virtual Video Adapter directly on a virtual machine, or on a template or hardware profile that you use to create virtual machines.
REQUIRED: You can enable the Microsoft Synthetic 3D Virtual Video Adapter for a virtual machine only if that virtual machine is deployed on a host running Windows Server 2008 R2 SP1 (with the Remote Desktop Services role and Remote Desktop Virtual Graphics role service installed) or later or if the virtual machine is stored in a library in a stopped state (hardware changes to a stored virtual machine can only be made if the virtual machine does not have snapshots). Enabling the Microsoft Synthetic 3D Virtual Video Adapter on a virtual machine stored in a library will limit placement of that machine to hosts running Windows Server 2008 R2 SP1 (with the Remote Desktop Services role and Remote Desktop Virtual Graphics role service installed) or later.
Example format: -VirtualVideoAdapterEnabled $True
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-VM<VM>
Specifies a virtual machine object.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-VMConfiguration<BaseVMConfiguration>
Specifies a virtual machine configuration object.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-VMConfigurationScaleOut<BaseVMConfiguration>
Specifies a virtual machine configuration object used when scaling out a service.
Aliases |
ScaleOutVMConfiguration |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-VMHost<Host>
Specifies a virtual machine host object. VMM supports Hyper-V hosts, VMware ESX hosts, and Citrix XenServer hosts.
For more information about each type of host, type Get-Help Add-SCVMHost -detailed
. See the examples for a specific cmdlet to determine how that cmdlet uses this parameter.
Aliases |
Host |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-VMMServer<ServerConnection>
Specifies a VMM server object.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-VMTemplate<Template>
Specifies a VMM template object used to create virtual machines.
Aliases |
Template |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-Workgroup<String>
Specifies on a new or existing template, on a new or existing guest operating system profile, or on a new virtual machine the name of the workgroup to which you want to join a virtual machine. You can use this parameter to override the existing value on a template or on a guest operating system profile.
Aliases |
JoinWorkgroup |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
- VirtualMachine
Notes
- This cmdlet requires a VMM virtual hard disk object, virtual machine template object, or virtual machine object, which can be retrieved by using the Get-SCVirtualHardDisk, Get-SCVMTemplate, or Get-SCVirtualMachine cmdlets, respectively.
Examples
Example 1: Create a virtual machine from a virtual hard disk and deploy it on a host
The first command gets the virtual hard disk object named Blank Disk - Large from the VMM library, and then stores the object in the $VHD variable.
The second command gets the host object named VMHost01, and then stores the object in the $VMHost object.
The last command creates a virtual machine named VM01 from the virtual hard disk stored in $VHD, in this case, Blank Disk - Large, and deploys the new virtual machine in C:\VirtualMachinePath on VMHost01. The RunAsynchronously parameter returns control to the shell immediately, before the command completes.
PS C:\> $VHD = Get-SCVirtualHardDisk -Name "Blank Disk - Large"
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01.Contoso.com"
PS C:\> New-SCVirtualMachine -Name "VM01" -VirtualHardDisk $VHD -VMHost $VMHost -Path "C:\VirtualMachinePath" -RunAsynchronously
Example 2: Create a virtual machine from a virtual machine template and deploy it on a host
The first command gets the virtual machine template object named WindowsServer2008R2, and then stores the object in the $VMTemplate variable.
The second command gets the host object named VMHost02, and then stores the object in the $VMHost variable.
The last command creates a new virtual machine from the virtual machine template stored in $VMTemplate, names the virtual machine VM02, and deploys the virtual machine on host VMHost02, storing its files at C:\VirtualMachinePath. When the virtual machine is created, the following properties are customized: the computer name for the virtual machine, the name of the person to whom the virtual machine is registered, the organization name, and the product key. Substitute your product key for the Xs in this example. Using the RunAsynchronously parameter returns control to the shell immediately, before the job completes.
PS C:\> $VMTemplate = Get-SCVMTemplate -VMMServer "VMMServer01.Contoso.com" | where {$_.Name -eq "WindowsServer2008R2"}
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost02.Contoso.com"
PS C:\> New-SCVirtualMachine -VMTemplate $VMTemplate -Name "VM02" -VMHost $VMHost -Path "C:\VirtualMachinePath" -RunAsynchronously -ComputerName "Server01" -FullName "Renee Lo" -OrgName "Contoso" -ProductKey "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
Example Example 3: Create a virtual machine by cloning an existing virtual machine.
The first command gets the virtual machine object named VM03, and then stores the object in the $VM variable.
The second command gets the host object named VMHost03, and then stores the object in the $VMHost variable.
The last command checks whether virtual machine VM01 is in a powered-off state. If the virtual machine is powered off, the command creates a virtual machine named VM03 from VM01, and then deploys the new virtual machine on VMHost03 in C:\VirtualMachinePath. The RunAsynchronously parameter returns control to the shell immediately, before the command completes.
PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01.Contoso.com"
PS C:\> if($VM.Status -eq "PowerOff"){New-SCVirtualMachine -Name "VM03" -VM $VM -VMHost $VMHost -Path "C:\VirtualMachinePath" -RunAsynchronously}
Example Example 4.: Create a virtual machine from a virtual machine stored in the library.:
The first command gets the host object named VMHost04, and then stores the object in the $VMHost variable.
The second command gets the virtual machine object named StoredVM01, which is located at the specified path on library server LibServer01, and then stores the virtual machine object in the $VM variable.
The last command creates a new virtual machine named VM04 from StoredVM01, provides the new virtual machine with 1024 MB of memory, and deploys it at the specified path. The command also provides a description and owner, and specifies that the start action for the virtual machine is set to never turn on automatically and that the stop action is to save the virtual machine. Using the RunAsynchronously parameter returns control to the shell immediately, before the command completes.
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost04"
PS C:\> $VM = Get-SCVirtualMachine -Name "StoredVM01" | where {$_.LibraryServer.Name -eq "LibServer01.Contoso.com"} | where {$_.Location -eq "\\LibServer01.Consoso.com\MSSCVMMLibrary\StoredVM01"}
PS C:\> New-SCVirtualMachine -VM $VM -Name "VM04" -Description "New VM from VM stored in Library" -Owner "Contoso\ReneeLo" -VMHost $VMHost -Path "C:\VirtualMachinePath" -RunAsynchronously -StartAction NeverAutoTurnOnVM -StopAction SaveVM -MemoryMB 1024
Example Example 5.: Create a highly available virtual machine.:
The first command creates a new GUID string, and then stores it in$JobGuid. This GUID is a job group ID that functions as an identifier that groups subsequent commands that include this identifier into a single job group.
The second command stores the string HAVM01 in $VMName, and is used to name the new virtual machine.
The third command creates a virtual network adapter with a dynamic MAC address and with VLAN disabled. Because the command uses the JobGroup parameter, the network adapter is not created until just before the New-SCVirtualMachine cmdlet in the last command runs.
The fourth command creates an IDE virtual DVD drive connected to the second channel and the first slot. Because the command uses the JobGroup parameter, the virtual DVD drive is not created until just before the New-SCVirtualMachine cmdlet in the last command runs.
The fifth command creates a hardware profile and specifies values for the profile name, owner, CPU count, memory, and bootorder. The command disables NumLock as well as limited CPU functionality, which is not needed because this is virtual machine will not have an older operating system, and designates that the virtual machine created by using this hardware profile will be highly available. Because the command uses the JobGroup parameter, the hardware profile is not created until just before the New-SCVirtualMachine cmdlet in the last command runs.
The sixth command creates an IDE virtual disk drive with a storage capacity of 4 GB on the first channel and first slot. Because the command uses the JobGroup parameter, the new virtual disk drive is not created until just before the New-SCVirtualMachine cmdlet in the last command runs.
The seventh command gets a virtual machine host object by name VMMHANode02, and then stores the object in $VMHost. This host is one node of a host cluster that is managed by VMM.
The eighth command gets the hardware profile object named HWProfile02, which was created in the fifth command, and then stores the object in the $HardwareProfile variable.
The ninth command gets an operating system object by name, and then stores the object in $OperatingSystem.
The last command uses the New-SCVirtualMachine cmdlet and the JobGroup parameter to create a new highly available virtual machine named HAVM01 by using the objects created and obtained in the preceding commands. The command also uses the Path parameter to specify the location where the virtual machine is stored, which must be a cluster-migratable LUN. Additionally, the command specifies that the virtual machine is not started automatically when the host starts and that the virtual machine is put into a saved state when the virtualization service stops. Using the RunAsynchronously parameter returns control to the command shell immediately, before the command completes.
PS C:\> $JobGuid = [System.Guid]::NewGuid().ToString()
PS C:\> $VMName = "HAVM01"
PS C:\> New-SCVirtualNetworkAdapter -JobGroup $JobGuid -PhysicalAddressType Dynamic -VLANEnabled $False
PS C:\> New-SCVirtualDVDDrive -JobGroup $JobGuid -Bus 1 -LUN 0
PS C:\> New-SCHardwareProfile -Owner "Contoso\ReneeLo" -Name "HWProfile02" -CPUCount 1 -MemoryMB 512 -HighlyAvailable $True -NumLock $False -BootOrder "CD", "IdeHardDrive", "PxeBoot", "Floppy" -LimitCPUFunctionality $False -JobGroup $JobGuid
PS C:\> New-SCVirtualDiskDrive -IDE -Bus 0 -LUN 0 -JobGroup $JobGuid -Size 40960 -Dynamic -Filename "HAVM01_disk_1.vhd"
PS C:\> $VMHost = Get-SCVMHost | where {$_.Name -eq "VMMHANode02.Contoso.com"}
PS C:\> $HardwareProfile = Get-SCHardwareProfile | where {$_.Name -eq "HWProfile02"}
PS C:\> $OperatingSystem = Get-SCOperatingSystem | where {$_.Name -eq "64-bit edition of Windows Server 2008 R2 Datacenter"}
PS C:\> New-SCVirtualMachine -Name $VMName -Description "" -VMMServer "VMMServer01.Contoso.com" -Owner "Contoso\ReneeLo" -VMHost $VMHost -Path "R:\" -HardwareProfile $HardwareProfile -JobGroup $JobGuid -OperatingSystem $OperatingSystem -RunAsynchronously -StartAction NeverAutoTurnOnVM -StopAction SaveVM
Example 6: Use an existing VHD file on the destination host to create a new virtual machine from a template
The first command generates a GUID, and then stores the GUID string in the $JobGroupID variable. The job group ID functions as an identifier that groups subsequent commands that include this identifier into a single job group.
The second command gets the virtual machine template object named VMTemplate01, and then stores the object in the $VMTemplate variable. VMTemplate01 is assumed to have a virtual disk drive on IDE Bus 0 LUN 0 that contains a virtual hard disk.
The third command gets the host object named VMHost06, and then stores the object in the $VMHost variable.
The fourth command connects the specified virtual hard disk, stored on the physical host at L:\OS.VHD, to the first slot (0) of the primary channel (0) on the virtual IDE controller on the virtual machine instead of the default virtual hard disk in the template. The virtual hard disk stored at L:\OS.VHD contains the operating system that will start on the virtual machine. Additionally, this command uses the JobGroup parameter to specify that it will not run until the New-SCVirtualMachine cmdlet triggers the commands in the JobGroup list to run.
The last command triggers all commands that contain the $JobGroupID variable to run, and creates the new virtual machine named VM06 from the template stored in $VMTemplate. The virtual machine is deployed on the host specified in $VMHost, and the virtual machine is stored in the root directory of the L: drive. The UseLocalVirtualHarddisk parameter specifies that New-SCVirtualMachine use an existing hard disk on the host instead of copying a VHD from the library. Therefore, the virtual hard disk associated with the virtual disk drive on the template is replaced with the virtual hard drive that exists on the host, L:\OS.VHD. As a result, both the virtual machine and its operating system are stored on the L: drive on the host.
The next example stores the virtual machine and its operating system on different drives.
PS C:\> $JobGroupID = [Guid]::NewGuid().ToString()
PS C:\> $VMTemplate = Get-SCVMTemplate | where {$_.Name -eq "VMTemplate01"}
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost06.Contoso.com"
PS C:\> Move-SCVirtualHardDisk -IDE -BUS 0 -LUN 0 -Path "L:\OS.VHD" -JobGroup $JobGroupID
PS C:\> New-SCVirtualMachine -Name "VM06" -Path "L:\" -VMTemplate $VMTemplate -VMHost $VMHost -JobGroup $JobGroupID -UseLocalVirtualHardDisk
Example 7: Use an existing VHD on the destination host to create a virtual machine from a template, and move another VHD to the new virtual machine
The first three commands are identical to the first three commands in the previous example. VMTemplate01 is assumed to have a virtual disk drive on IDE Bus 0 and LUN 0 that contains a virtual hard disk.
The fourth command gets the virtual hard disk object named Other.VHD. The Get-SCVirtual HardDisk cmdlet can retrieve virtual hard disk objects from a virtual machine, from a template, or from a standalone file stored in the VMM library. Specifying the All parameter retrieves a full list of all the subordinate objects independent of the parent object. In this case, the command retrieves all the available virtual hard disk objects and then selects Other.VHD.
The fifth command connects the specified virtual hard disk, stored on the physical host at L:\OS.VHD, to the first slot (0) of the primary channel (0) on the virtual IDE controller on the virtual machine instead of the default virtual hard disk in the template. The virtual hard disk stored at L:\OS.VHD contains the operating system that will start on the virtual machine. Additionally, this command uses the JobGroup parameter to specify that it will not run until the New-SCVirtualMachine cmdlet triggers the commands in the JobGroup list to run.
The sixth command creates a virtual disk drive object, and then attaches the virtual hard disk object stored in $VHD to IDE Bus 0 and LUN 1 on the new drive. The command uses the Path parameter to store the virtual hard disk object in $VHD in the root directory of the R: drive on the virtual machine, and it specifies that its name is Other.VHD. Additionally, this command uses the JobGroup parameter to specify that it will not run until the last command triggers the commands in the JobGroup list to run.
The last command triggers all commands that contain the $JobGroupID variable to run and creates the new virtual machine named VM07 from the template stored in $VMTemplate. The virtual machine is deployed on the host specified in $VMHost and the virtual machine is stored in the D:\VirtualMachinePath folder. The UseLocalVirtualHarddisk parameter specifies that New-SCVirtualMachine use an existing hard disk on the host instead of copying a VHD from the library. Therefore, the virtual hard disk associated with the virtual disk drive on the template is replaced with the virtual hard drive that exists on the host, L:\OS.VHD. As a result, the path to the virtual machine is D:\VirtualMachinePath\VM07, the path to the operating system is L:\OS.VHD, and the path to the other virtual hard disk is R:\Other.VHD.
PS C:\> $JobGroupID = [guid]::NewGuid()
PS C:\> $VMTemplate = Get-SCVMTemplate | where {$_.Name -eq "VMTemplate01"}
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost07.Contoso.com"
PS C:\> $VHD = Get-SCVirtualHardDisk -All | where {$_.Name -eq "Other.Vhd"}
PS C:\> Move-SCVirtualHardDisk -IDE -BUS 0 -LUN 0 -Path "L:\OS.VHD" -JobGroup $JobGroupID
PS C:\> New-SCVirtualDiskDrive -VirtualHardDisk $VHD -IDE -BUS 0 -LUN 1 -Path "R:\" -Filename "Other.Vhd" -JobGroup $JobGroupID
PS C:\> New-SCVirtualMachine -Name "VM07" -Path "D:\VirtualMachinePath" -VMTemplate $VMTemplate -VMHost $VMHost -JobGroup $JobGroupID -UseLocalVirtualHardDisk
Example 8: Create a Linux-based virtual machine from a virtual machine template and deploy it on a host
The first command gets the virtual machine template object named CentOSConfigurable, and then stores the object in the $VMTemplate variable.
The second command gets the host object named VMHost02, and then stores the object in the $VMHost variable.
The third command gets a credential object (user: root and a password), and then stores the object in the $Cred variable.
The last command creates a new virtual machine from the virtual machine template stored in $VMTemplate, names the virtual machine MyCentOSVM, and deploys the virtual machine on host VMHost02, storing its files at C:\VirtualMachinePath. When the virtual machine is created, the following properties are customized: the computer name for the virtual machine (MyCentOSVM), the Linux dnsdomainname (Contoso.com) and the root account password ($Cred). Using the RunAsynchronously parameter returns control to the shell immediately, before the job completes.
PS C:\> $VMTemplate = Get-SCVMTemplate -VMMServer "VMMServer01.Contoso.com" | where {$_.Name -eq "CentOSConfigurable"}
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost02.Contoso.com"
PS C:\> $Cred = Get-Credential
PS C:\> New-SCVirtualMachine -VMTemplate $t -Name "MyCentOSVM" -RunAsynchronously -ComputerName "MyCentOSVM" -LinuxDomainName "Contoso.com" -LocalAdministratorCredential $Cred -VMHost $VMhost -Path "C:\VirtualMachinePath"
Related topics
New-SCP2V