Class HypervisorHostingOptions
Specifies common options for on-premise hypervisor based hosting environments such as Hyper-V and XenServer.
Namespace: Neon.Kube.ClusterDef
Assembly: Neon.Kube.dll
Syntax
public class HypervisorHostingOptions
Constructors
HypervisorHostingOptions()
Default constructor.
Declaration
public HypervisorHostingOptions()
Properties
DiskLocation
Path to the location where virtual machine hard disk will be created. This defaults to the local Hyper-V folder for Windows.
note
This is currently recognized only when deploying on a local Hyper-V hypervisor. Eventually, you'll be able to specify a XenServer storage repository.
Declaration
[JsonProperty(PropertyName = "DiskLocation", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "diskLocation", ApplyNamingConventions = false)]
public string DiskLocation { get; set; }
Property Value
Type | Description |
---|---|
string |
HostPassword
The default password to use for connecting the hypervisor host machines specified by Hosts.
This may be overridden for specific hypervisor machines within Hosts items. This defaults to null
.
Declaration
[JsonProperty(PropertyName = "HostPassword", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "hostPassword", ApplyNamingConventions = false)]
public string HostPassword { get; set; }
Property Value
Type | Description |
---|---|
string |
HostUsername
The default username to use for connecting the hypervisor host machines specified by Hosts.
This may be overridden for specific hypervisor machines. This defaults to null
.
note
This defaults to root for XenServer based environments.
Declaration
[JsonProperty(PropertyName = "HostUsername", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "hostUsername", ApplyNamingConventions = false)]
public string HostUsername { get; set; }
Property Value
Type | Description |
---|---|
string |
Hosts
Optionally identifies the target Hyper-V or XenServer hypervisor machines.
Declaration
[JsonProperty(PropertyName = "Hosts", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "hosts", ApplyNamingConventions = false)]
public List<HypervisorHost> Hosts { get; set; }
Property Value
Type | Description |
---|---|
List<HypervisorHost> |
Memory
Specifies the default amount of memory to allocate to each cluster virtual machine. This is specified as a string that can be a byte count or a number with units like 512MiB, 0.5GiB, 2iGB, or 1TiB. This defaults to 4GiB.
note
NEONKUBE requires that each control-plane and worker node have at least 4GiB of RAM.
Declaration
[JsonProperty(PropertyName = "Memory", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "memory", ApplyNamingConventions = false)]
public string Memory { get; set; }
Property Value
Type | Description |
---|---|
string |
NamePrefix
The prefix to be prepended to virtual machine provisioned to hypervisors for the HyperV, HyperV, and XenServer environments. This is used to avoid VM naming conflicts between different clusters.
note
This property is ignored for cloud hosting environments because cluster VMs will be isolated in their own resource groups and private networks.
When this is null
(the default), the cluster name followed by a dash will
prefix the provisioned virtual machine names. When this is a non-empty string, the
value followed by a dash will be used. If this is an empty string or whitespace then
the machine names will not be prefixed.
note
Virtual machine name prefixes will always be converted to lowercase.
Declaration
[JsonProperty(PropertyName = "NamePrefix", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "namePrefix", ApplyNamingConventions = false)]
public string NamePrefix { get; set; }
Property Value
Type | Description |
---|---|
string |
OpenEbsDisk
Specifies the default size of the second block device to be created for nodes enabled for OpenEBS. This is specified as a string that can be a byte count or a number with units like 512MiB, 0.5GiB, 2iGB, or 1TiB. This defaults to 128GiB.
Declaration
[JsonProperty(PropertyName = "OpenEbsDisk", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "openEbsDisk", ApplyNamingConventions = false)]
public string OpenEbsDisk { get; set; }
Property Value
Type | Description |
---|---|
string |
OsDisk
Specifies the default size of the operating system disk for cluster virtual machines. This is specified as a string that can be a long byte count or a byte count or a number with units like 512MiB, 0.5GiB, 2GiB, or 1TiB. This defaults to 128GiB.
Declaration
[JsonProperty(PropertyName = "OsDisk", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "osDisk", ApplyNamingConventions = false)]
public string OsDisk { get; set; }
Property Value
Type | Description |
---|---|
string |
VCpus
The default number of processors to assign to each cluster virtual machine.
note
NEONKUBE requires that each control-plane and worker node have at least 4 CPUs.
Declaration
[JsonProperty(PropertyName = "VCpus", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[YamlMember(Alias = "vcpus", ApplyNamingConventions = false)]
public int VCpus { get; set; }
Property Value
Type | Description |
---|---|
int |
Methods
ClearSecrets()
Clears all hosting related secrets.
Declaration
public void ClearSecrets()
GetVmNamePrefix(ClusterDefinition)
Returns the prefix to be used when provisioning virtual machines in hypervisor environments during cluster deployment.
Declaration
public string GetVmNamePrefix(ClusterDefinition clusterDefinition)
Parameters
Type | Name | Description |
---|---|---|
ClusterDefinition | clusterDefinition | The cluster definition. |
Returns
Type | Description |
---|---|
string | The prefix. |
GetVmNamePrefix(KubeConfigCluster)
Returns the prefix to be used when provisioning virtual machines in hypervisor environments.
Declaration
public string GetVmNamePrefix(KubeConfigCluster configCluster)
Parameters
Type | Name | Description |
---|---|---|
KubeConfigCluster | configCluster | The cluster configuration (from kubeconfig). |
Returns
Type | Description |
---|---|
string | The prefix. |
Validate(ClusterDefinition)
Validates the options and also ensures that all null
properties are
initialized to their default values.
Declaration
public void Validate(ClusterDefinition clusterDefinition)
Parameters
Type | Name | Description |
---|---|---|
ClusterDefinition | clusterDefinition | The cluster definition. |
Exceptions
Type | Condition |
---|---|
ClusterDefinitionException | Thrown if the definition is not valid. |