Skip to content

feat(snc): add --profile flag with virtualization addon support for OCP SNC#738

Merged
adrianriobo merged 1 commit into
redhat-developer:mainfrom
jangel97:feature/ocp-snc-virt
Mar 5, 2026
Merged

feat(snc): add --profile flag with virtualization addon support for OCP SNC#738
adrianriobo merged 1 commit into
redhat-developer:mainfrom
jangel97:feature/ocp-snc-virt

Conversation

@jangel97
Copy link
Copy Markdown
Contributor

@jangel97 jangel97 commented Mar 2, 2026

Add a profile system to the OpenShift SNC command that allows installing addons on the cluster after deployment. The first supported profile is 'virtualization' which installs the OCP Virtualization (CNV) operator and enables nested virtualization on the compute instance.

Comment thread pkg/target/service/snc/profile_virtualization.go Outdated
Comment thread pkg/provider/aws/action/snc/snc.go Outdated
Comment thread pkg/target/service/snc/profile_virtualization.go Outdated
@jangel97 jangel97 force-pushed the feature/ocp-snc-virt branch 6 times, most recently from d2f13f1 to 677ecb0 Compare March 5, 2026 16:42
@jangel97 jangel97 marked this pull request as ready for review March 5, 2026 16:42
@jangel97 jangel97 force-pushed the feature/ocp-snc-virt branch 2 times, most recently from 09b8212 to f153f72 Compare March 5, 2026 17:24
adrianriobo
adrianriobo previously approved these changes Mar 5, 2026
Copy link
Copy Markdown
Collaborator

@adrianriobo adrianriobo left a comment

Choose a reason for hiding this comment

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

@adrianriobo adrianriobo dismissed their stale review March 5, 2026 17:30

missing something

@jangel97 jangel97 force-pushed the feature/ocp-snc-virt branch 2 times, most recently from c8d8f81 to 273a78e Compare March 5, 2026 17:42
Add a profile system to the OpenShift SNC command that allows
installing addons on the cluster after deployment. The first
supported profile is 'virtualization' which installs the OCP
Virtualization (CNV) operator and enables nested virtualization
on the compute instance.

Signed-off-by: Jose Angel Morena <jmorenas@redhat.com>
@jangel97 jangel97 force-pushed the feature/ocp-snc-virt branch from 273a78e to 7ec787a Compare March 5, 2026 17:44
Copy link
Copy Markdown
Collaborator

@adrianriobo adrianriobo left a comment

Choose a reason for hiding this comment

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

LGTM

@adrianriobo adrianriobo merged commit c283c05 into redhat-developer:main Mar 5, 2026
@jangel97
Copy link
Copy Markdown
Contributor Author

jangel97 commented Mar 6, 2026

Testing

Tested the virtualization profile on a fresh SNC cluster (OCP 4.21.0, spot instance).

--profile virtualization

./out/mapt aws openshift-snc create \
    --project-name jmorenas-snc-test \
    --backed-url file:///tmp/mapt-workspace \
    --version 4.21.0 \
    --pull-secret-file <pull-secret> \
    --conn-details-output /tmp/snc \
    --spot --tags owner=jmorenas \
    --profile virtualization

export KUBECONFIG=/tmp/snc/kubeconfig

Operator installed successfully:

$ oc get csv -n openshift-cnv
# kubevirt-hyperconverged-operator.v4.21.x with PHASE: Succeeded

HyperConverged CR ready:

$ oc get hyperconverged -n openshift-cnv
# kubevirt-hyperconverged with status

Created a Fedora VM and verified it runs:

# Create cloud-init secret
cat <<EOF > cloudinit.yaml
#cloud-config
user: fedora
password: test123
chpasswd:
  expire: false
ssh_pwauth: true
EOF

oc create secret generic test-vm-cloudinit \
  --from-file=userdata=cloudinit.yaml

# Create VM
cat <<'EOF' | oc apply -f -
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  name: test-vm
  namespace: default
spec:
  runStrategy: Always
  template:
    spec:
      domain:
        devices:
          disks:
          - disk:
              bus: virtio
            name: containerdisk
          - disk:
              bus: virtio
            name: cloudinit
        resources:
          requests:
            memory: 1Gi
      volumes:
      - containerDisk:
          image: quay.io/containerdisks/fedora:latest
        name: containerdisk
      - cloudInitNoCloud:
          secretRef:
            name: test-vm-cloudinit
        name: cloudinit
EOF

VM running:

$ oc get vm
NAME      AGE   STATUS    READY
test-vm   ...   Running   True

$ oc get vmi
NAME      AGE   PHASE     IP            NODENAME   READY
test-vm   ...   Running   ...           crc        True

Console access verified with virtctl console test-vm.

Cleanup:

oc delete vm test-vm
./out/mapt aws openshift-snc destroy \
    --project-name jmorenas-snc-test \
    --backed-url file:///tmp/mapt-workspace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants