# using cs\_instance

**URL:** <https://forum.ansible.com/t/using-cs-instance/20687>\
**Category:** Ansible Project\
**Created:** [February 26, 2016, 11:33am UTC](https://forum.ansible.com/t/using-cs-instance/20687 "2016-02-26T11:33:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daan\_Hoogland](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@Daan\_Hoogland](https://forum.ansible.com/u/Daan_Hoogland)\
**Post date:** [February 26, 2016, 11:33am UTC](https://forum.ansible.com/t/using-cs-instance/20687/1 "2016-02-26T11:33:21Z")

</div>

LS, I am trying to use the cloudstack set of modules with ansible 2.0

host file:

[vms]  
vm01

end of host file

stip.yaml:

- hosts: all  
gather\_facts: no  
tasks:
- name: stop vm  
local\_action: cs\_instance name=“{{ inventory\_hostname }}” state=stopped

end of stop.yaml

command:  
$ ansible-playbook stop.yaml -i …/inventory/vms/hosts

PLAY \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [stop vm] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [bubble05 → localhost]: FAILED! =\> {“changed”: false, “failed”: true, “msg”: “Template or ISO is required.”}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
bubble05 : ok=0 changed=0 unreachable=0 failed=1

✘-2 ~/leaseweb/provisioning/ansible/bubbles [mkbubble L|…13]  
12:22 $ ansible-playbook stop.yaml -i …/inventory/vms/hosts

PLAY \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [stop vm] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [vm01 → localhost]: FAILED! =\> {“changed”: false, “failed”: true, “msg”: “Template or ISO is required.”}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
vm01 : ok=0 changed=0 unreachable=0 failed=1

In my interpretation of the module docs at [http://docs.ansible.com/ansible/cs\_instance\_module.html](http://docs.ansible.com/ansible/cs_instance_module.html) the state=stopped would not require me to add a template or iso parameter, or does it? Or maybe I am missing something else?

---

<div class="post-metadata">

**Author:** ![Rene\_Moser](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@Rene\_Moser](https://forum.ansible.com/u/Rene_Moser)\
**Post date:** [February 27, 2016, 9:06am UTC](https://forum.ansible.com/t/using-cs-instance/20687/2 "2016-02-27T09:06:00Z")

</div>

```auto
Hi Daan

It is true that state=stopped does not require template/iso if the VM is
present. If the VM is not yet present, it will try to create a VM which
will not boot (state=stopped), which will require a template or iso.

Is the VM present?

BTW: Did you see the detailed guide for the cloudstack modules? http://docs.ansible.com/ansible/guide_cloudstack.html

René

```

---

<div class="post-metadata">

**Author:** ![Daan\_Hoogland](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@Daan\_Hoogland](https://forum.ansible.com/u/Daan_Hoogland)\
**Post date:** [March 1, 2016, 10:27am UTC](https://forum.ansible.com/t/using-cs-instance/20687/3 "2016-03-01T10:27:12Z")

</div>

> ```auto
> 
> ```

> ```auto
> 
> BTW: Did you see the detailed guide for the cloudstack modules? [http://docs.ansible.com/ansible/guide_cloudstack.html](http://docs.ansible.com/ansible/guide_cloudstack.html)
> 
> ```

thanks Rene, I didn’t I will go through it 😉
