Skip to content

Commit

Permalink
Merge pull request kubevirt#2416 from ahadas/fix_docs
Browse files Browse the repository at this point in the history
Fix documentation of OvercommitGuestOverhead
  • Loading branch information
rmohr authored Jun 24, 2019
2 parents c44a085 + 4bfc50c commit d7d609c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -5577,7 +5577,7 @@
"type": "object"
},
"overcommitGuestOverhead": {
"description": "Don't ask the scheduler to take the guest-management overhead into account. Instead\nput the overhead only into the requested memory limits. This can lead to crashes if\nall memory is in use on a node. Defaults to false.",
"description": "Don't ask the scheduler to take the guest-management overhead into account. Instead\nput the overhead only into the container's memory limit. This can lead to crashes if\nall memory is in use on a node. Defaults to false.",
"type": "boolean"
},
"requests": {
Expand Down
7 changes: 4 additions & 3 deletions pkg/virt-controller/services/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -989,11 +989,12 @@ func getMemoryOverhead(domain v1.DomainSpec) *resource.Quantity {

// Add CPU table overhead (8 MiB per vCPU and 8 MiB per IO thread)
// overhead per vcpu in MiB
coresMemory := uint32(8)
coresMemory := resource.MustParse("8Mi")
if domain.CPU != nil {
coresMemory *= domain.CPU.Cores
value := coresMemory.Value() * int64(domain.CPU.Cores)
coresMemory = *resource.NewQuantity(value, coresMemory.Format)
}
overhead.Add(resource.MustParse(strconv.Itoa(int(coresMemory)) + "Mi"))
overhead.Add(coresMemory)

// static overhead for IOThread
overhead.Add(resource.MustParse("8Mi"))
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/kubevirt.io/client-go/api/v1/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ type ResourceRequirements struct {
// +optional
Limits v1.ResourceList `json:"limits,omitempty"`
// Don't ask the scheduler to take the guest-management overhead into account. Instead
// put the overhead only into the requested memory limits. This can lead to crashes if
// put the overhead only into the container's memory limit. This can lead to crashes if
// all memory is in use on a node. Defaults to false.
OvercommitGuestOverhead bool `json:"overcommitGuestOverhead,omitempty"`
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d7d609c

Please sign in to comment.