Skip to content

Conversation

jkary
Copy link

@jkary jkary commented Sep 29, 2025

Summary

  • Add VM management job templates (create-vm and delete-vm) to AAP controller configuration
  • Configure dedicated vm-operations instance group with kubernetes service account access
  • Set up vm-operations inventory for VM lifecycle management

This PR depends on #131
🤖 Generated with Claude Code

larsks and others added 3 commits September 9, 2025 14:53
Implements playbook_cloudkit_create_vm.yml and playbook_cloudkit_delete_vm.yml to handle virtual machine creation and deletion operations. These playbooks integrate with the VM template system and provide proper resource management including namespace finalizers and locking mechanisms.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Add create-vm and delete-vm job templates with vm-operations instance group
- Configure vm-operations inventory and inventory source for VM management
- Set up vm-operations-ig container group with kubernetes service account access

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@jkary jkary closed this Sep 29, 2025
@jkary jkary reopened this Sep 29, 2025
Comment on lines +49 to +67
- name: Acquire VM lock for deletion
kubernetes.core.k8s:
state: present
apply: true
server_side_apply:
field_manager: "{{ vm_order_holder_id }}"
definition:
apiVersion: coordination.k8s.io/v1
kind: Lease
metadata:
name: "{{ vm_order_lock_name }}"
namespace: "{{ vm_target_namespace }}"
labels:
cloudkit.openshift.io/aap-job-id: "job-{{ awx_job_id | default('unknown') }}"
cloudkit.openshift.io/resource-type: "vm"
cloudkit.openshift.io/operation: "delete"
spec:
holderIdentity: "{{ vm_order_holder_id }}"

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think need the lock

Copy link
Author

Choose a reason for hiding this comment

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

@adriengentil Actually we do need the lock. From my testing, if we don't grab a lock then 2 namespaces can be created. I'm not sure how this is possible but it happens. I am testing this fix now and will update the PR once I know it works. (Also, I believe the lock should be held in the CloudKit namespace...)

description: "Publish templates inventory"
organization: "{{ aap_organization_name }}"
- name: "{{ aap_prefix }}-vm-operations"
description: "VM Operational Inventory - Dedicated BM Hypervisors"
Copy link
Contributor

Choose a reason for hiding this comment

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

"Dedicated BM Hypervisors" ?

Copy link
Author

Choose a reason for hiding this comment

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

That claude is one crazy fella!

@adriengentil
Copy link
Contributor

no eda config as code?
Can you also address the comment left in https://github.com/innabox/cloudkit-aap/pull/129/files#diff-36159d51ce0793186d0f166d8f6e5252afa8d51306015e368809b4589b1951a5 on the same files?

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.

3 participants