Class GrpcAddVmRequest
Creates a virtual machine. This request returns a GrpcBaseReply.
Namespace: Neon.Kube.GrpcProto.Desktop
Assembly: Neon.Kube.GrpcProto.dll
Syntax
[DataContract]
public class GrpcAddVmRequest
Constructors
GrpcAddVmRequest()
Default constructor.
Declaration
public GrpcAddVmRequest()
GrpcAddVmRequest(string, string, int, string?, string?, bool, string?, string?, IEnumerable<GrpcVirtualDrive>?)
Constructor.
Declaration
public GrpcAddVmRequest(string machineName, string memorySize = "2GiB", int processorCount = 4, string? driveSize = null, string? drivePath = null, bool checkpointDrives = false, string? templateDrivePath = null, string? switchName = null, IEnumerable<GrpcVirtualDrive>? extraDrives = null)
Parameters
Type | Name | Description |
---|---|---|
string | machineName | Sperifies the machine name. |
string | memorySize | Optionally specifies the memory size. This can be a long byte count or a a number with units like 512MiB, 0.5GiB, 2GiB, or 1TiB. This defaults to 2GiB. |
int | processorCount | Optionally specifies the number of virutal processors to assign to the machine. This defaults to 4. |
string | driveSize | Optionally specifies the primary disk size. This can be a long byte count or
a number with units like 512MB, 0.5GiB, 2GiB, or 1TiB. |
string | drivePath | Optionally specifies the path where the virtual hard drive will be located. Pass
|
bool | checkpointDrives | Optionally enables drive checkpoints. This defaults to |
string | templateDrivePath | If this is specified and |
string | switchName | Optionally specifies the name of the associated virtual switch. |
IEnumerable<GrpcVirtualDrive> | extraDrives | Optionally specifies any additional virtual drives to be created and then attached to the new virtual machine. |
Remarks
note
The Path property of extraDrives
may be
passed as null
or empty. In this case, the drive name will default to
being located in the standard Hyper-V virtual drivers folder and will be named
MACHINE-NAME-#.vhdx, where # is the one-based index of the drive
in the enumeration.
Properties
CheckpointDrives
Optionally enables disk checkpoints. This defaults to false
.
Declaration
[DataMember(Order = 6)]
public bool CheckpointDrives { get; set; }
Property Value
Type | Description |
---|---|
bool |
DrivePath
Optionally specifies the path where the virtual hard drive will be located. Pass
null
or empty to default to MACHINE-NAME.vhdx located in the default
Hyper-V virtual machine drive folder.
Declaration
[DataMember(Order = 5)]
public string? DrivePath { get; set; }
Property Value
Type | Description |
---|---|
string |
DriveSize
Optionally specifies the primary disk size. This can be a long byte count or
a number with units like 512MB, 0.5GiB, 2GiB, or 1TiB.
Pass null
to leave the disk alone. This defaults to null
.
Declaration
[DataMember(Order = 4)]
public string? DriveSize { get; set; }
Property Value
Type | Description |
---|---|
string |
ExtraDrives
Optionally specifies any additional virtual drives to be created and then attached to the new virtual machine.
Declaration
[DataMember(Order = 9)]
public List<GrpcVirtualDrive>? ExtraDrives { get; set; }
Property Value
Type | Description |
---|---|
List<GrpcVirtualDrive> |
MachineName
Specifies the machine name.
Declaration
[DataMember(Order = 1)]
public string? MachineName { get; set; }
Property Value
Type | Description |
---|---|
string |
MemorySize
Optionally specifies the memory size. This can be a long byte count or a a number with units like 512MiB, 0.5GiB, 2GiB, or 1TiB. This defaults to 2GiB.
Declaration
[DataMember(Order = 2)]
public string? MemorySize { get; set; }
Property Value
Type | Description |
---|---|
string |
ProcessorCount
Optionally specifies the number of virutal processors to assign to the machine. This defaults to 4.
Declaration
[DataMember(Order = 3)]
public int? ProcessorCount { get; set; }
Property Value
Type | Description |
---|---|
int? |
SwitchName
Optionally specifies the name of the associated virtual switch.
Declaration
[DataMember(Order = 8)]
public string? SwitchName { get; set; }
Property Value
Type | Description |
---|---|
string |
TemplateDrivePath
If this is specified and DrivePath is not null
then
the hard drive template at TemplateDrivePath will be copied
to DrivePath before creating the machine.
Declaration
[DataMember(Order = 7)]
public string? TemplateDrivePath { get; set; }
Property Value
Type | Description |
---|---|
string |