Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNV#21150: instance types API #75235

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 26, 2024
@ocpdocs-previewbot
Copy link

ocpdocs-previewbot commented Apr 26, 2024

🤖 Tue May 07 16:38:18 - Prow CI generated the docs preview:
https://75235--ocpdocs-pr.netlify.app
Complete list of updated preview URLs: artifacts/updated_preview_urls.txt

@ousleyp ousleyp force-pushed the cnv-21150 branch 5 times, most recently from d5a5818 to 4cf9d29 Compare April 29, 2024 21:38
@ousleyp ousleyp changed the title [WIP] CNV#21150: instance types CLI CNV#21150: instance types CLI Apr 29, 2024
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 29, 2024
@ousleyp ousleyp changed the title CNV#21150: instance types CLI CNV#21150: instance types API Apr 29, 2024
@ousleyp ousleyp added this to the Continuous Release milestone Apr 29, 2024
@ousleyp ousleyp force-pushed the cnv-21150 branch 2 times, most recently from f603674 to 6d59e38 Compare April 29, 2024 22:03
@ousleyp ousleyp requested a review from lyarwood April 29, 2024 22:04
@lyarwood
Copy link

lyarwood commented May 1, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 1, 2024
@ousleyp ousleyp added the peer-review-needed Signifies that the peer review team needs to review this PR label May 1, 2024
@ousleyp
Copy link
Member Author

ousleyp commented May 1, 2024

@RoniKishner Hi, can you please review this PR from the QE perspective? Thank you!

+
:FeatureName: Creating a VM from an instance type
include::snippets/technology-preview.adoc[]
You can create a VM by using a Red Hat template or an xref:../../virt/virtual_machines/creating_vms_rh/virt-creating-vms-from-instance-types.adoc#virt-creating-vms-from-instance-types[instance type].
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be a separate bullet, as it links to a different assembly than Create a VM from a Red Hat image? It is a touch confusing to me.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good spot. I think there's some rework that needs to be done here in general, because there is overlap between the procedures in the "custom images" and "RH images" directories, and I think the separation is doing more harm than good. Sadly.

(I'm pretty sure that this link was attached to the previous bullet because the instance type assembly is in the "creating_vms_rh" directory.)

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I'm going to leave this as-is and try to address it in a follow-up PR.

@mburke5678
Copy link
Contributor

@ousleyp Overall looks good. A few suggestions/questions. I am not sure what you changed in Configuring SSH access to virtual machines, however. Otherwise LGTM.

@mburke5678 mburke5678 added peer-review-done Signifies that the peer review team has reviewed this PR and removed peer-review-needed Signifies that the peer review team needs to review this PR labels May 1, 2024
@ousleyp
Copy link
Member Author

ousleyp commented May 1, 2024

@ousleyp Overall looks good. A few suggestions/questions. I am not sure what you changed in Configuring SSH access to virtual machines, however. Otherwise LGTM.

Great question. It was in this list of build preview links and I lazily assumed I had forgotten some random change... my apologies for the confusion!

Thanks so much for the thoughtful review, as always, @mburke5678 !

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 1, 2024
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label May 1, 2024
Copy link

openshift-ci bot commented May 1, 2024

New changes are detected. LGTM label has been removed.

@openshift-ci openshift-ci bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 1, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 1, 2024
@openshift-ci openshift-ci bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 1, 2024
@ousleyp ousleyp requested review from RoniKishner and removed request for lyarwood May 1, 2024 16:07
@dominikholler
Copy link

dominikholler commented May 2, 2024

Great to see this documented!

Can the example yaml in "Creating a VM from a VirtualMachine manifest" in https://docs.openshift.com/container-platform/4.15/virt/virtual_machines/creating_vms_rh/virt-creating-vms-from-cli.html#virt-creating-vm-cli_virt-creating-vms-cli be also adopted to use instancetypes?

A very minimalistic VM would be

 apiVersion: kubevirt.io/v1
 kind: VirtualMachine
 metadata:
  name: rhel-9-minimal
 spec:
  dataVolumeTemplates:
    - metadata:
        name: rhel-9-minimal-volume
      spec:
        sourceRef:
          kind: DataSource
          name: rhel9
          namespace: openshift-virtualization-os-images
        storage: {}
  instancetype:
    name: u1.medium
  preference:
    name: rhel.9
  running: true
  template:
    spec:
      domain:
        devices: {}
      volumes:
        - dataVolume:
            name: rhel-9-minimal-volume
          name: rootdisk

@ousleyp
Copy link
Member Author

ousleyp commented May 2, 2024

Great to see this documented!

Can the example yaml in "Creating a VM from a VirtualMachine manifest" in https://docs.openshift.com/container-platform/4.15/virt/virtual_machines/creating_vms_rh/virt-creating-vms-from-cli.html#virt-creating-vm-cli_virt-creating-vms-cli be also adopted to use instancetypes?

Great suggestion, thanks! I just changed that example to the manifest you provided and attempted to give some additional information in the callouts. Can you please review, @dominikholler ? Thanks!

Copy link

@dominikholler dominikholler left a comment

Choose a reason for hiding this comment

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

Thanks @ousleyp .
If I may request another change, can the two examples in https://docs.openshift.com/container-platform/4.15/virt/virtual_machines/virt-accessing-vm-ssh.html#virt-adding-public-key-cli_static-key and https://docs.openshift.com/container-platform/4.15/virt/virtual_machines/virt-accessing-vm-ssh.html#virt-creating-vm-instancetype_dynamic-key be updated to

apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  name: example-vm
spec:
  dataVolumeTemplates:
    - metadata:
        name: example-vm-volume
      spec:
        sourceRef:
          kind: DataSource
          name: rhel9
          namespace: openshift-virtualization-os-images
        storage:
          resources: {}
  instancetype:
    name: u1.medium
  preference:
    name: rhel.9
  running: true
  template:
    spec:
      domain:
        devices: {}
      volumes:
        - dataVolume:
            name: example-vm-volume
          name: rootdisk
        - cloudInitNoCloud:
            userData: |-
              #cloud-config
              user: cloud-user
          name: cloudinitdisk
      accessCredentials:
        - sshPublicKey:
            propagationMethod:
              noCloud: {}
            source:
              secret:
                secretName: authorized-keys
---
apiVersion: v1
kind: Secret
metadata:
  name: authorized-keys
data:
  key: c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDMU0rTDNSMUh4YjI3bFdjdjBJU01nYzhQcHVTcG1XUnRNTWFoR3BtRU5xQk5SSkZXbVhnMVlkeTFxRTNOSXJ4VzdGZmxZelRyOXlnRXZvZDhVNDBmVkNpMnRybnhEd2g5UHJUNzBCS29TcHZLazlTSzZ6ME10SWgxUEk5SDM0ME5YSW5DRGdwZkFFK200eVcwaFlQUWtkZzFZajRQOElVZEczV3pvOHZxK0dmM0M2aHVCVG5HNmpNekZVZEFGcUxrd0hEY3hRc0RjcXl2UFdvU0NzREg1OTM3aWRVZDE0MTRXRlU3bW5xOTBIRXRZbjFYcmt5SUpPSzFtOVk3K3RkSW1jNWJDcjNhN2J3WXVBRWZ6M2pZOGh5NVFYZDdWb29RaXg4UW5vMCtsOE9TWFZBWExaOW1lVGdkRUwxcEJ4Y2hUY2ZsZWU0ekhjQk5RMXdEZnNUSnYgZG9taW5pa0B0NDYwcA==

and the dynamic one to

apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  name: example-vm
spec:
  dataVolumeTemplates:
    - metadata:
        name: example-vm-volume
      spec:
        sourceRef:
          kind: DataSource
          name: rhel9
          namespace: openshift-virtualization-os-images
        storage:
          resources: {}
  instancetype:
    name: u1.medium
  preference:
    name: rhel.9
  running: true
  template:
    spec:
      domain:
        devices: {}
      volumes:
        - dataVolume:
            name: example-vm-volume
          name: rootdisk
        - cloudInitNoCloud:
            userData: |-
              #cloud-config
              runcmd:
              - [ setsebool, -P, virt_qemu_ga_manage_ssh, on ]
          name: cloudinitdisk
      accessCredentials:
        - sshPublicKey:
            propagationMethod:
              qemuGuestAgent:
                users: ["cloud-user"]
            source:
              secret:
                secretName: authorized-keys
---
apiVersion: v1
kind: Secret
metadata:
  name: authorized-keys
data:
  key: c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDMU0rTDNSMUh4YjI3bFdjdjBJU01nYzhQcHVTcG1XUnRNTWFoR3BtRU5xQk5SSkZXbVhnMVlkeTFxRTNOSXJ4VzdGZmxZelRyOXlnRXZvZDhVNDBmVkNpMnRybnhEd2g5UHJUNzBCS29TcHZLazlTSzZ6ME10SWgxUEk5SDM0ME5YSW5DRGdwZkFFK200eVcwaFlQUWtkZzFZajRQOElVZEczV3pvOHZxK0dmM0M2aHVCVG5HNmpNekZVZEFGcUxrd0hEY3hRc0RjcXl2UFdvU0NzREg1OTM3aWRVZDE0MTRXRlU3bW5xOTBIRXRZbjFYcmt5SUpPSzFtOVk3K3RkSW1jNWJDcjNhN2J3WXVBRWZ6M2pZOGh5NVFYZDdWb29RaXg4UW5vMCtsOE9TWFZBWExaOW1lVGdkRUwxcEJ4Y2hUY2ZsZWU0ekhjQk5RMXdEZnNUSnYgZG9taW5pa0B0NDYwcA==

modules/virt-creating-vm-cli.adoc Outdated Show resolved Hide resolved
@ousleyp
Copy link
Member Author

ousleyp commented May 6, 2024

@dominikholler , thanks for the feedback! I have added a link to the SSH page and a note regarding the lack of authentication config to this PR, but I have not yet updated the YAMLs on the SSH page. That page is a little complicated because it uses one YAML with conditionals to cover both static and dynamic. I'll work on making that update shortly.

@openshift-ci openshift-ci bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 7, 2024
@ousleyp
Copy link
Member Author

ousleyp commented May 7, 2024

Copy link

openshift-ci bot commented May 7, 2024

@ousleyp: all tests passed!

Full PR test history. Your PR dashboard.

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.

@adellape adellape added the peer-review-in-progress Signifies that the peer review team is reviewing this PR label May 7, 2024
@adellape adellape self-assigned this May 7, 2024
@adellape adellape removed the peer-review-in-progress Signifies that the peer review team is reviewing this PR label May 8, 2024
@dominikholler
Copy link

@lyarwood @akrejcir can you please have a look, too?

@ousleyp
Copy link
Member Author

ousleyp commented May 9, 2024

Hi @lyarwood @akrejcir , I can merge this if it LGTY, so please let me know when you've taken a look. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch/enterprise-4.15 branch/enterprise-4.16 CNV Label for all CNV PRs peer-review-done Signifies that the peer review team has reviewed this PR size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants