Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions pkg/asset/machines/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ import (
"github.com/openshift/installer/pkg/types"
alibabacloudtypes "github.com/openshift/installer/pkg/types/alibabacloud"
awstypes "github.com/openshift/installer/pkg/types/aws"
awsdefaults "github.com/openshift/installer/pkg/types/aws/defaults"
azuretypes "github.com/openshift/installer/pkg/types/azure"
azuredefaults "github.com/openshift/installer/pkg/types/azure/defaults"
baremetaltypes "github.com/openshift/installer/pkg/types/baremetal"
Expand Down Expand Up @@ -143,15 +142,6 @@ func (m *Master) Dependencies() []asset.Asset {
}
}

func awsDefaultMasterMachineTypes(region string, arch types.Architecture) []string {
classes := awsdefaults.InstanceClasses(region, arch)
types := make([]string, len(classes))
for i, c := range classes {
types[i] = fmt.Sprintf("%s.xlarge", c)
}
return types
}

// Generate generates the Master asset.
func (m *Master) Generate(dependencies asset.Parents) error {
ctx := context.TODO()
Expand Down Expand Up @@ -240,10 +230,10 @@ func (m *Master) Generate(dependencies asset.Parents) error {
}

if mpool.InstanceType == "" {
mpool.InstanceType, err = aws.PreferredInstanceType(ctx, installConfig.AWS, awsDefaultMasterMachineTypes(installConfig.Config.Platform.AWS.Region, installConfig.Config.ControlPlane.Architecture), mpool.Zones)
mpool.InstanceType, err = aws.PreferredInstanceType(ctx, installConfig.AWS, awsDefaultMachineTypes(installConfig.Config.Platform.AWS.Region, installConfig.Config.ControlPlane.Architecture), mpool.Zones)
if err != nil {
logrus.Warn(errors.Wrap(err, "failed to find default instance type"))
mpool.InstanceType = awsDefaultMasterMachineTypes(installConfig.Config.Platform.AWS.Region, installConfig.Config.ControlPlane.Architecture)[0]
mpool.InstanceType = awsDefaultMachineTypes(installConfig.Config.Platform.AWS.Region, installConfig.Config.ControlPlane.Architecture)[0]
}
}

Expand Down
16 changes: 8 additions & 8 deletions pkg/asset/machines/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func defaultAzureMachinePoolPlatform() azuretypes.MachinePool {

func defaultGCPMachinePoolPlatform() gcptypes.MachinePool {
return gcptypes.MachinePool{
InstanceType: "n1-standard-4",
InstanceType: "n2-standard-4",
Comment thread
rna-afk marked this conversation as resolved.
Outdated
OSDisk: gcptypes.OSDisk{
DiskSizeGB: powerOfTwoRootVolumeSize,
DiskType: "pd-ssd",
Expand Down Expand Up @@ -156,9 +156,9 @@ func defaultOvirtMachinePoolPlatform() ovirttypes.MachinePool {

func defaultVSphereMachinePoolPlatform() vspheretypes.MachinePool {
return vspheretypes.MachinePool{
NumCPUs: 2,
NumCoresPerSocket: 2,
MemoryMiB: 8192,
NumCPUs: 4,
NumCoresPerSocket: 1,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Above it is 4 NumCoresPerSocket and here it is 1. Which is right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 cpus and 1 cores per socket is right. I'll fix it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it to set masters to 4 vcpus and 4 numcores and workers to 4 vcpus and 1 numcores

MemoryMiB: 16384,
OSDisk: vspheretypes.OSDisk{
DiskSizeGB: decimalRootVolumeSize,
},
Expand All @@ -185,11 +185,11 @@ func defaultNutanixMachinePoolPlatform() nutanixtypes.MachinePool {
}
}

func awsDefaultWorkerMachineTypes(region string, arch types.Architecture) []string {
func awsDefaultMachineTypes(region string, arch types.Architecture) []string {
classes := awsdefaults.InstanceClasses(region, arch)
types := make([]string, len(classes))
for i, c := range classes {
types[i] = fmt.Sprintf("%s.large", c)
types[i] = fmt.Sprintf("%s.xlarge", c)
}
return types
}
Expand Down Expand Up @@ -341,10 +341,10 @@ func (w *Worker) Generate(dependencies asset.Parents) error {
}
}
if mpool.InstanceType == "" {
mpool.InstanceType, err = aws.PreferredInstanceType(ctx, installConfig.AWS, awsDefaultWorkerMachineTypes(installConfig.Config.Platform.AWS.Region, installConfig.Config.ControlPlane.Architecture), mpool.Zones)
mpool.InstanceType, err = aws.PreferredInstanceType(ctx, installConfig.AWS, awsDefaultMachineTypes(installConfig.Config.Platform.AWS.Region, installConfig.Config.ControlPlane.Architecture), mpool.Zones)
if err != nil {
logrus.Warn(errors.Wrap(err, "failed to find default instance type"))
mpool.InstanceType = awsDefaultWorkerMachineTypes(installConfig.Config.Platform.AWS.Region, installConfig.Config.ControlPlane.Architecture)[0]
mpool.InstanceType = awsDefaultMachineTypes(installConfig.Config.Platform.AWS.Region, installConfig.Config.ControlPlane.Architecture)[0]
}
}
// if the list of zones is the default we need to try to filter the list in case there are some zones where the instance might not be available
Expand Down