create state disk on constellation create

This commit is contained in:
Malte Poll 2022-04-05 14:25:49 +02:00 committed by Malte Poll
parent ede83bd555
commit daf2280e3f
6 changed files with 51 additions and 21 deletions

View file

@ -17,6 +17,7 @@ func (c *Client) CreateInstances(ctx context.Context, input CreateInstancesInput
NamePrefix: c.name + "-worker-" + c.uid + "-",
Count: input.Count - 1,
InstanceType: input.InstanceType,
StateDiskSizeGB: int32(input.StateDiskSizeGB),
Image: input.Image,
UserAssingedIdentity: input.UserAssingedIdentity,
}
@ -33,6 +34,7 @@ func (c *Client) CreateInstances(ctx context.Context, input CreateInstancesInput
NamePrefix: c.name + "-control-plane-" + c.uid + "-",
Count: 1,
InstanceType: input.InstanceType,
StateDiskSizeGB: int32(input.StateDiskSizeGB),
Image: input.Image,
UserAssingedIdentity: input.UserAssingedIdentity,
}
@ -63,6 +65,7 @@ func (c *Client) CreateInstances(ctx context.Context, input CreateInstancesInput
type CreateInstancesInput struct {
Count int
InstanceType string
StateDiskSizeGB int
Image string
UserAssingedIdentity string
}
@ -165,6 +168,7 @@ func (c *Client) createScaleSet(ctx context.Context, input CreateScaleSetInput)
NamePrefix: input.NamePrefix,
Location: c.location,
InstanceType: input.InstanceType,
StateDiskSizeGB: input.StateDiskSizeGB,
Count: int64(input.Count),
Username: "constellation",
SubnetID: c.subnetID,
@ -239,6 +243,7 @@ type CreateScaleSetInput struct {
NamePrefix string
Count int
InstanceType string
StateDiskSizeGB int32
Image string
UserAssingedIdentity string
}

View file

@ -14,6 +14,7 @@ type ScaleSet struct {
NamePrefix string
Location string
InstanceType string
StateDiskSizeGB int32
Count int64
Username string
SubnetID string
@ -52,6 +53,13 @@ func (s ScaleSet) Azure() armcompute.VirtualMachineScaleSet {
ImageReference: &armcompute.ImageReference{
ID: to.StringPtr(s.Image),
},
DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{
{
CreateOption: armcompute.DiskCreateOptionTypesEmpty.ToPtr(),
DiskSizeGB: to.Int32Ptr(s.StateDiskSizeGB),
Lun: to.Int32Ptr(0),
},
},
},
NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{
NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{