mirror of
https://github.com/openshift/installer.git
synced 2026-02-06 09:47:02 +01:00
Merge pull request #9310 from r4f4/azure-avoid-growfs-var
OCPBUGS-46144: azure: use separate /var to avoid growfs timeouts
This commit is contained in:
@@ -42,6 +42,7 @@ import (
|
||||
"github.com/openshift/installer/pkg/asset/tls"
|
||||
"github.com/openshift/installer/pkg/types"
|
||||
awstypes "github.com/openshift/installer/pkg/types/aws"
|
||||
aztypes "github.com/openshift/installer/pkg/types/azure"
|
||||
baremetaltypes "github.com/openshift/installer/pkg/types/baremetal"
|
||||
gcptypes "github.com/openshift/installer/pkg/types/gcp"
|
||||
nutanixtypes "github.com/openshift/installer/pkg/types/nutanix"
|
||||
@@ -229,7 +230,8 @@ func (a *Common) generateConfig(dependencies asset.Parents, templateData *bootst
|
||||
}},
|
||||
)
|
||||
|
||||
if platform == nutanixtypes.Name {
|
||||
switch platform {
|
||||
case nutanixtypes.Name:
|
||||
// Inserts the file "/etc/hostname" with the bootstrap machine name to the bootstrap ignition data
|
||||
hostname := fmt.Sprintf("%s-bootstrap", clusterID.InfraID)
|
||||
hostnameFile := igntypes.File{
|
||||
@@ -245,6 +247,9 @@ func (a *Common) generateConfig(dependencies asset.Parents, templateData *bootst
|
||||
},
|
||||
}
|
||||
a.Config.Storage.Files = append(a.Config.Storage.Files, hostnameFile)
|
||||
case aztypes.Name:
|
||||
// See https://issues.redhat.com/browse/OCPBUGS-43625
|
||||
ignition.AppendVarPartition(a.Config)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@@ -7,11 +7,13 @@ import (
|
||||
|
||||
igntypes "github.com/coreos/ignition/v2/config/v3_2/types"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/openshift/installer/pkg/asset"
|
||||
"github.com/openshift/installer/pkg/asset/ignition"
|
||||
"github.com/openshift/installer/pkg/asset/installconfig"
|
||||
"github.com/openshift/installer/pkg/asset/tls"
|
||||
"github.com/openshift/installer/pkg/types/azure"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -42,6 +44,12 @@ func (a *Master) Generate(_ context.Context, dependencies asset.Parents) error {
|
||||
|
||||
a.Config = pointerIgnitionConfig(installConfig.Config, rootCA.Cert(), "master")
|
||||
|
||||
if installConfig.Config.Platform.Name() == azure.Name {
|
||||
logrus.Debugf("Adding /var partition to skip CoreOS growfs step")
|
||||
// See https://issues.redhat.com/browse/OCPBUGS-43625
|
||||
ignition.AppendVarPartition(a.Config)
|
||||
}
|
||||
|
||||
data, err := ignition.Marshal(a.Config)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to marshal Ignition config")
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
igntypes "github.com/coreos/ignition/v2/config/v3_2/types"
|
||||
"github.com/vincent-petithory/dataurl"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/utils/ptr"
|
||||
|
||||
"github.com/openshift/installer/pkg/asset"
|
||||
)
|
||||
@@ -91,3 +92,44 @@ func ConvertToAppendix(file *igntypes.File) {
|
||||
file.Contents = igntypes.Resource{}
|
||||
file.Overwrite = ignutil.BoolToPtr(false)
|
||||
}
|
||||
|
||||
// AppendVarPartition appends a /var partition to the ignition configuration to avoid growfs.
|
||||
func AppendVarPartition(config *igntypes.Config) {
|
||||
// https://docs.openshift.com/container-platform/4.17/installing/installing_platform_agnostic/installing-platform-agnostic.html#installation-user-infra-machines-advanced_vardisk_installing-platform-agnostic
|
||||
config.Storage.Disks = append(config.Storage.Disks, igntypes.Disk{
|
||||
Device: "/dev/disk/by-id/coreos-boot-disk",
|
||||
Partitions: []igntypes.Partition{
|
||||
{
|
||||
Label: ptr.To("var"),
|
||||
Number: 5,
|
||||
StartMiB: ptr.To(50000),
|
||||
SizeMiB: ptr.To(0),
|
||||
},
|
||||
},
|
||||
})
|
||||
config.Storage.Filesystems = append(config.Storage.Filesystems, igntypes.Filesystem{
|
||||
Path: ptr.To("/var"),
|
||||
Device: "/dev/disk/by-partlabel/var",
|
||||
Format: ptr.To("xfs"),
|
||||
MountOptions: []igntypes.MountOption{"defaults", "prjquota"},
|
||||
})
|
||||
// generate a mount unit so that this filesystem gets mounted in the real root.
|
||||
config.Systemd.Units = append(config.Systemd.Units, igntypes.Unit{
|
||||
Name: "var.mount",
|
||||
Enabled: ptr.To(true),
|
||||
Contents: ptr.To(`
|
||||
[Unit]
|
||||
Requires=systemd-fsck@dev-disk-by\x2dpartlabel-var.service
|
||||
After=systemd-fsck@dev-disk-by\x2dpartlabel-var.service
|
||||
|
||||
[Mount]
|
||||
Where=/var
|
||||
What=/dev/disk/by-partlabel/var
|
||||
Type=xfs
|
||||
Options=defaults,prjquota
|
||||
|
||||
[Install]
|
||||
RequiredBy=local-fs.target
|
||||
`),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user