Skip to content

Bug 1820300: Extend oVirt's MachinePool#3399

Merged
openshift-merge-robot merged 2 commits intoopenshift:masterfrom
rgolangh:bz1813741
May 14, 2020
Merged

Bug 1820300: Extend oVirt's MachinePool#3399
openshift-merge-robot merged 2 commits intoopenshift:masterfrom
rgolangh:bz1813741

Conversation

@rgolangh
Copy link
Copy Markdown
Contributor

@rgolangh rgolangh commented Apr 3, 2020

Those items are now part of MachinePool

  • instance type
  • cpu (cores, sockets)
  • memory
  • os disk size
  • vm type

A compute pool snippet from the install-config.yaml may look like that:

compute:
- architecture: amd64
  hyperthreading: Enabled
  name: worker
  platform:
    ovirt:
      cpu:
        cores: 8
        sockets: 1
        instanceTypeID:
      memoryMB: 65536
      osDisk:
        sizeGB: 100
      type: high_performance
  replicas: 3

Terraform now uses those values, and all the defaults in tf files are
now deleted in favour of the machine-config ones.

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@rgolangh: This pull request references Bugzilla bug 1813741, which is invalid:

  • expected the bug to be in one of the following states: NEW, ASSIGNED, ON_DEV, POST, POST, but it is ON_QA instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

Bug 1813741: Extend oVirt's MachinePool

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Apr 3, 2020
@rgolangh rgolangh changed the title Bug 1813741: Extend oVirt's MachinePool Bug 1820300: Extend oVirt's MachinePool Apr 3, 2020
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@rgolangh: This pull request references Bugzilla bug 1820300, which is invalid:

  • expected the bug to target the "4.5.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

Bug 1820300: Extend oVirt's MachinePool

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rgolangh
Copy link
Copy Markdown
Contributor Author

rgolangh commented Apr 3, 2020

/bugzilla refresh

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@rgolangh: This pull request references Bugzilla bug 1820300, which is invalid:

  • expected the bug to target the "4.5.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rgolangh
Copy link
Copy Markdown
Contributor Author

rgolangh commented Apr 3, 2020

/bugzilla refresh

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@rgolangh: This pull request references Bugzilla bug 1820300, which is invalid:

  • expected the bug to target the "4.5.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rgolangh
Copy link
Copy Markdown
Contributor Author

rgolangh commented Apr 3, 2020

/bugzilla refresh

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@rgolangh: This pull request references Bugzilla bug 1820300, which is invalid:

  • expected the bug to target the "4.5.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rgolangh
Copy link
Copy Markdown
Contributor Author

rgolangh commented Apr 3, 2020

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Apr 3, 2020
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@rgolangh: This pull request references Bugzilla bug 1820300, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)
Details

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot removed the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Apr 3, 2020
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@rgolangh: This pull request references Bugzilla bug 1820300, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)
Details

In response to this:

Bug 1820300: Extend oVirt's MachinePool

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rgolangh
Copy link
Copy Markdown
Contributor Author

rgolangh commented Apr 5, 2020

/retest

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 9, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 1, 2020
Copy link
Copy Markdown
Contributor

@patrickdillon patrickdillon left a comment

Choose a reason for hiding this comment

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

This LGTM. There are just some docs issues that need to be fixed up. oVirt is missing a doc like this: https://github.com/openshift/installer/blob/master/docs/user/aws/customization.md and it should be added to give machinepool examples.

Comment thread data/data/ovirt/masters/variables.tf Outdated
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.

nit: no newline EOF

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.

done

Comment thread data/data/ovirt/template/variables.tf Outdated
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.

nit: no new line EOF

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.

done

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.

i can still see the newline :P

Comment thread data/data/ovirt/variables-ovirt.tf Outdated
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.

nit: no new line EOF

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.

done

Comment thread go.mod Outdated
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.

I think these changes should be in the vendor commit.

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.

done

Comment thread pkg/types/ovirt/machinepool.go Outdated
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.

Can you mark these with +optional and kubebuilder default? See this for details https://github.com/openshift/installer/pull/3515/files#diff-ef5ad052319246b6e805b03c0221dcdcR34 and check out the whole PR for motivation.

Copy link
Copy Markdown
Contributor

@abhinavdahiya abhinavdahiya May 1, 2020

Choose a reason for hiding this comment

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

If InstanceTypeID is passed, all memory and cpu variables will be ignored.

I think we need validation that user doesn't set these conflicting values in install-config.yaml

Comment thread pkg/types/ovirt/machinepool.go Outdated
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.

nit: missing period.

Comment thread pkg/types/ovirt/machinepool.go Outdated
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.

nit: missing is

Comment thread pkg/types/ovirt/machinepool.go Outdated
Comment on lines 21 to 22
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.

effects -> affects

One of "desktop, server, high_performance" -> One of: "desktop", "server", or "high_performance".

Comment thread pkg/types/ovirt/machinepool.go Outdated
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.

nit: missing period

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.

Suggested change
// CPU defines the VM cpu, made of (Sockets * Cores * Threads)
// CPU defines the VM's cpu, which is made of (Sockets * Cores * Threads)

The sockets and cores are defined in this struct, while there is no mention of the threads?

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.

I'm hiding threads for now, I don't want to expose this at the moment. I removed it from the comments as well.

Comment thread pkg/types/ovirt/machinepool.go Outdated
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.

nit: missing period

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.

done

Comment thread pkg/asset/machines/master.go Outdated
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.

nit: move this to defaultOvirtMachinePoolPlatform

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.

or document why this is different from the default.

Comment thread pkg/types/ovirt/machinepool.go Outdated
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.

if these values are known, desktop, server, high_performance, we should be using string enums like the publish

// PublishingStrategy is a strategy for how various endpoints for the cluster are exposed.
type PublishingStrategy string
const (
// ExternalPublishingStrategy exposes endpoints for the cluster to the Internet.
ExternalPublishingStrategy PublishingStrategy = "External"
// InternalPublishingStrategy exposes the endpoints for the cluster to the private network only.
InternalPublishingStrategy PublishingStrategy = "Internal"
)

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.

also include validations.

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.

done

Comment thread data/data/ovirt/variables-ovirt.tf Outdated
Comment thread data/data/ovirt/masters/main.tf Outdated
Comment thread data/data/ovirt/template/main.tf Outdated
Comment on lines 54 to 56
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.

Comment thread pkg/types/ovirt/validation/machinepool.go Outdated
Comment thread pkg/types/ovirt/validation/machinepool_test.go Outdated
Comment thread pkg/types/ovirt/validation/machinepool_test.go Outdated
Comment thread pkg/types/ovirt/validation/machinepool_test.go Outdated
Comment thread pkg/types/ovirt/validation/machinepool_test.go Outdated
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.

Suggested change
InstanceTypeID: "aaaaa-123"},
InstanceTypeID: "aaaaa-123",
},

Comment thread pkg/types/ovirt/validation/machinepool_test.go Outdated
Comment on lines 74 to 75
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.

I'm not big fan of mixed indentation here, one multi-line the rest is one-line. single line is better even for this imo.

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.

for me shorter lines (< 120) are preferred for the price of a bit of weirdness of go multi-line. Unfortunately ovirt sdk is more verbose than I'd wanted it to be (a lot of client code with builder probably)

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.

For me shorter lines (< 120) are preferred for the price of a bit of weirdness of go multi-line. Unfortunately ovirt sdk is quite verbose (a lot of client code are the same probably...)

If that's a code-base guideline that's fine by me. I don't want to repeat this over again.

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.

Suggested change
allErrs = append(allErrs, field.Invalid(fldPath.Child("instanceTypeID"), p.InstanceTypeID, "mixing instanceTypeID and Memory is not supported"))
allErrs = append(allErrs, field.Invalid(fldPath.Child("instanceTypeID"), p.InstanceTypeID, "mixing instanceTypeID and Memory is not supported"))

@abhinavdahiya
Copy link
Copy Markdown
Contributor

Please update the godoc comments for the new fields in the machinepool as these are very sparse and incomplete feeling. With the addition of openshift-install explain installconfig #3515 the godoc comments will directly relate to better UX for users.

Make sure include the generated code using https://github.com/openshift/installer/blob/master/docs/dev/explain.md#generating-the-documentation

also, there is missing documentation in docs/ovirt/customization.md that documents the fields and also provides some example install-config.yaml 's for various configurations for users. see https://github.com/openshift/installer/blob/master/docs/user/aws/customization.md for AWS as example.

@abhinavdahiya
Copy link
Copy Markdown
Contributor

/approve

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 13, 2020
Those items are now part of MachinePool
- instance type
- cpu (cores, sockets)
- memory
- os disk size
- vm type

With those we have controll on the way create worker/nodes,
and we have proper defaults set in the machine pool definitions, one for
the pkg/asset/machines/ master.go and worker.go.

Default master pool:
  cpus: 4
  mem: 16 GiB
  os disk: 120 GB
  VM type: high_performance

Default worker pool:
  cpus: 4
  mem: 16 GiB
  os disk: 120 GB
  VM type: server

A compute pool snippet from the install-config.yaml may look like that:

```yaml
compute:
- architecture: amd64
  hyperthreading: Enabled
  name: worker
  platform:
    ovirt:
      cpu:
        cores: 8
        sockets: 1
      instanceTypeID:
      memoryMB: 65536
      osDisk:
        sizeGB: 120
      vmType: high_performance
  replicas: 3
```

Terraform now uses those values, and all the defaults in tf files are
now deleted in favour of the machine-config ones.
To support `osDisk` size which is differnt than the template
master/main.tf has this block:

  block_device {
    interface = "virtio_scsi"
    size      = var.ovirt_master_os_disk_size_gb
  }

If needed TF will extend the disk size of the VM.

Cluster-api-provider-ovirt also extends the disk of a VM if the
definition in the machine spec is differnt than the template.

Signed-off-by: Roy Golan <rgolan@redhat.com>
@Gal-Zaidman
Copy link
Copy Markdown
Contributor

/test e2e-ovirt

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@rgolangh: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-ovirt 5d0b06a link /test e2e-ovirt
ci/prow/e2e-aws-scaleup-rhel7 5d0b06a link /test e2e-aws-scaleup-rhel7

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@patrickdillon
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 14, 2020
@openshift-merge-robot openshift-merge-robot merged commit 3280f2f into openshift:master May 14, 2020
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@rgolangh: All pull requests linked via external trackers have merged: openshift/installer#3399. Bugzilla bug 1820300 has been moved to the MODIFIED state.

Details

In response to this:

Bug 1820300: Extend oVirt's MachinePool

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rgolangh
Copy link
Copy Markdown
Contributor Author

/cherry-pick release-4.4

@openshift-cherrypick-robot
Copy link
Copy Markdown

@rgolangh: #3399 failed to apply on top of branch "release-4.4":

error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
A	go.mod
A	go.sum
A	vendor/modules.txt
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): vendor/modules.txt deleted in HEAD and modified in ovirt: bump terraform and cluster-api providers. Version ovirt: bump terraform and cluster-api providers of vendor/modules.txt left in tree.
CONFLICT (modify/delete): go.sum deleted in HEAD and modified in ovirt: bump terraform and cluster-api providers. Version ovirt: bump terraform and cluster-api providers of go.sum left in tree.
CONFLICT (modify/delete): go.mod deleted in HEAD and modified in ovirt: bump terraform and cluster-api providers. Version ovirt: bump terraform and cluster-api providers of go.mod left in tree.
Patch failed at 0001 ovirt: bump terraform and cluster-api providers

Details

In response to this:

/cherry-pick release-4.4

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

rgolangh added a commit to rgolangh/release that referenced this pull request May 18, 2020
The fix in openshift/installer#3399 adds
the machine pool definition into install-config. This updated
is needed from now on to make the CI use it.

Signed-off-by: Roy Golan <rgolan@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants