fix(region): vendor update for disable esxi swap (#21516)

This commit is contained in:
屈轩
2024-11-04 15:09:23 +08:00
committed by GitHub
parent 8eaf118118
commit 6b39ee756f
7 changed files with 27 additions and 4 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ require (
k8s.io/client-go v0.19.3
k8s.io/cluster-bootstrap v0.19.3
moul.io/http2curl/v2 v2.3.0
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20241029090712-4a5b6fd13960
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20241104064848-022c612f1b99
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32
yunion.io/x/jsonutils v1.0.1-0.20240930100528-1671a2d0d22f
yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91
+2 -2
View File
@@ -1274,8 +1274,8 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20241029090712-4a5b6fd13960 h1:1O5sJZ9KjaUTEXKTuioLFU6/+poCWHTwWjid8i2W8vc=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20241029090712-4a5b6fd13960/go.mod h1:rj/pb3DitJlQaQD8UW1oxx/KD+PzDZqoywzqRJaFE9A=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20241104064848-022c612f1b99 h1:WH0NfhjhnnjbxaLbgOqaCx212S0IrYjMcd9SooaACH8=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20241104064848-022c612f1b99/go.mod h1:rj/pb3DitJlQaQD8UW1oxx/KD+PzDZqoywzqRJaFE9A=
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32 h1:v7POYkQwo1XzOxBoIoRVr/k0V9Y5JyjpshlIFa9raug=
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
+1
View File
@@ -912,6 +912,7 @@ type GuestJsonDesc struct {
InstanceSnapshotId string `json:"instance_snapshot_id"`
InstanceId string `json:"instance_id"`
} `json:"instance_snapshot_info"`
EnableEsxiSwap bool `json:"enable_esxi_swap"`
EncryptKeyId string `json:"encrypt_key_id,omitempty"`
+2
View File
@@ -5069,6 +5069,8 @@ func (self *SGuest) GetJsonDescAtHypervisor(ctx context.Context, host *SHost) *a
IsDaemon: self.IsDaemon.Bool(),
LightMode: self.RescueMode,
EnableEsxiSwap: options.Options.EnableEsxiSwap,
}
if len(self.BackupHostId) > 0 {
+1 -1
View File
@@ -1576,7 +1576,7 @@ sigs.k8s.io/structured-merge-diff/v4/value
# sigs.k8s.io/yaml v1.2.0
## explicit; go 1.12
sigs.k8s.io/yaml
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20241029090712-4a5b6fd13960
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20241104064848-022c612f1b99
## explicit; go 1.21
yunion.io/x/cloudmux/pkg/apis
yunion.io/x/cloudmux/pkg/apis/billing
+19
View File
@@ -781,6 +781,7 @@ type SCreateVMParam struct {
Nics []jsonutils.JSONObject
ResourcePool string
InstanceSnapshotInfo SEsxiInstanceSnapshotInfo
EnableEsxiSwap bool
}
type SEsxiInstanceSnapshotInfo struct {
@@ -1083,7 +1084,17 @@ func (host *SHost) DoCreateVM(ctx context.Context, ds *SDatastore, params SCreat
CpuHotAddEnabled: &True,
CpuHotRemoveEnabled: &True,
MemoryHotAddEnabled: &True,
ExtraConfig: []types.BaseOptionValue{},
}
if !params.EnableEsxiSwap {
spec.ExtraConfig = append(spec.ExtraConfig, &types.OptionValue{
Key: "sched.swap.vmxSwapEnabled",
Value: "FALSE",
})
}
spec.Files = &types.VirtualMachineFileInfo{
VmPathName: datastorePath,
}
@@ -1322,6 +1333,14 @@ func (host *SHost) CloneVM(ctx context.Context, from *SVirtualMachine, snapshot
CpuHotAddEnabled: &True,
CpuHotRemoveEnabled: &True,
MemoryHotAddEnabled: &True,
ExtraConfig: []types.BaseOptionValue{},
}
if !params.EnableEsxiSwap {
spec.ExtraConfig = append(spec.ExtraConfig, &types.OptionValue{
Key: "sched.swap.vmxSwapEnabled",
Value: "FALSE",
})
}
cloneSpec.Config = &spec
task, err := ovm.Clone(ctx, folders.VmFolder, name, *cloneSpec)
+1
View File
@@ -42,6 +42,7 @@ type SDatastoreImageCache struct {
type EsxiOptions struct {
ReasonableCIDREsxi string `help:"Reasonable CIDR in esxi, such as '10.0.0.0/8'" defautl:""`
TemplateNameRegex string `help:"Regex of template name"`
EnableEsxiSwap bool `help:"Enable esxi vm swap" default:"false"`
}
var tempalteNameRegex *regexp.Regexp