Blame docs/operations/deploy/virtual-machine.md

ee6248
# Virtual Machine deploy operation
ee6248
ee6248
## CentOS infra KVM hosts
ee6248
ee6248
If the KVM virtual machine we want to deploy is hosted on a CentOS KVM host and hosted within the `Community Cage` (Red Hat) DC, same thing as for bare-metal host : add it in the [Internal Inventory](https://docs.google.com/spreadsheets/d/1K-aewLJ17z3pRC6K5qyBRJYtNXy1WcxRSVwPkGf4NXQ), and start also "reserving" IP address[es] for Operating System.
ee6248
ee6248
Then add the new node to <inventory>/host_vars/<new_node> and also in the <inventory>/kvm file/group (for inheritance).
ee6248
ee6248
Ensure that *all* the variables explained in [adhoc-deploy-kvm-guest](https://github.com/CentOS/ansible-infra-playbooks/blob/master/adhoc-deploy-kvm-guest.yml) playbook are set correctly.
ee6248
ee6248
Then you can call it like that : 
ee6248
ee6248
```
ee6248
 ansible-playbook playbooks/adhoc-deploy-kvm-guest.yml 
ee6248
[WARNING] KVM guests to be deployed with CentOS => : <kvm_guest[s]>
ee6248
ee6248
```
ee6248
ee6248
The process will go like this : 
ee6248
ee6248
  * ansible will generate a kickstart locally on the kvm host
ee6248
  * will deploy a wrapper template/script (calling virt-install) with correct settings
ee6248
  * call that script to kick that `virt-install` script that will inject the kickstart into initrd on demand
ee6248
  * wait for sshd to be available on the node
ee6248
  * clean-up the `virt-install` wrapper script for the kvm guest
ee6248
bd9605
!!! tip
bd9605
    As now in the ansible inventory we know where the VM is hosted, in case you need to reset a node you can use the `adhoc-reset-vm.yml` that will destroy the VM (through delegate_to: ansible task) and restart it
ee6248
ee6248
## Cloud providers
ee6248
ee6248
### AWS/EC2