Repository: ansible/ansible
Pull request: Ovirt add rename functionality
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
Now you can rename most of ovirt components. When you pass components ID then you can change name.  

<!--- If you are fixing an existing issue, please include "Fixes #nnn" in your
commit message and your description; but you should still explain what
the change does.-->
Fixes #43236

##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Feature Pull Request
 - Bugfix Pull Request
##### COMPONENT NAME
<!--- Name of the module, plugin, task or feature -->
ovirt
##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes below -->
```
ansible 2.6.3
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/mnecas/Desktop/Projects/Redhat/ansible/lib/ansible/modules/cloud/ovirt']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.15 (default, May 16 2018, 17:50:09) [GCC 8.1.1 20180502 (Red Hat 8.1.1-1)]

```


##### ADDITIONAL INFORMATION
<!--- Include additional information to help people understand the change here.
For bugs that don't have a linked bug report, a step-by-step reproduction
of the problem is helpful. -->

<!--- Paste verbatim command output below, e.g. before and after your change -->
```

```


Problem statement:
ovirt module: Rename ovirt management network
##### SUMMARY

During the deployment on ovirt Hosted-Engine via ansible I need to rename the network from the default name (ovirtmgmt) to something else. Currently there is no way to do it on the ovirt-ansible modules.

This RFE is crucial for Hosted-engine to support other management network names other than the default one.

##### ISSUE TYPE
 - Feature idea

##### COMPONENT NAME
ovirt-ansible module

##### ANSIBLE VERSION
2.6

Hints from issue discussion:
Files identified in the description:
* [lib/ansible/modules/cloud/ovirt/ovirt_affinity_group.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_affinity_group.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_affinity_label.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_affinity_label.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_affinity_label_facts.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_affinity_label_facts.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_api_facts.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_api_facts.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_auth.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_auth.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_cluster.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_cluster.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_disk.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_disk.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_nics.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_nics.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_quotas.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_quotas.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_tags.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_tags.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_users.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_users.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_vms.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_vms.py)

If these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @machacekondra @mwperina
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->
Files identified in the description:
* [lib/ansible/modules/cloud/ovirt/ovirt_affinity_group.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_affinity_group.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_affinity_label.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_affinity_label.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_affinity_label_facts.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_affinity_label_facts.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_api_facts.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_api_facts.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_auth.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_auth.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_cluster.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_cluster.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_disk.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_disk.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_nic.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_nic.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_tag.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_tag.py)
* [lib/ansible/modules/cloud/ovirt/ovirt_user.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/ovirt/ovirt_user.py)

If these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->

Commit message: update pep8 syntax

Patch to review:
diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_cluster.py b/lib/ansible/modules/cloud/ovirt/ovirt_cluster.py
index 54e1dc99dec737..9f7b743e4ca91d 100644
--- a/lib/ansible/modules/cloud/ovirt/ovirt_cluster.py
+++ b/lib/ansible/modules/cloud/ovirt/ovirt_cluster.py
@@ -18,6 +18,10 @@
 description:
     - "Module to manage clusters in oVirt/RHV"
 options:
+    id:
+        description:
+            - "ID of the cluster to manage."
+        version_added: "2.7"
     name:
         description:
             - "Name of the cluster to manage."
@@ -266,6 +270,11 @@
 - ovirt_cluster:
     state: absent
     name: mycluster
+
+# Change cluster Name
+- ovirt_cluster:
+    id: 00000000-0000-0000-0000-000000000000
+    name: "new cluster name"
 '''
 
 RETURN = '''
@@ -381,6 +390,7 @@ def _get_external_network_providers_entity(self):
     def build_entity(self):
         sched_policy = self._get_sched_policy()
         return otypes.Cluster(
+            id=self.param('id'),
             name=self.param('name'),
             comment=self.param('comment'),
             description=self.param('description'),
@@ -543,6 +553,7 @@ def check_custom_scheduling_policy_properties():
 
         return (
             check_custom_scheduling_policy_properties() and
+            equal(self.param('name'), entity.name) and
             equal(self.param('comment'), entity.comment) and
             equal(self.param('description'), entity.description) and
             equal(self.param('switch_type'), str(entity.switch_type)) and
@@ -599,6 +610,7 @@ def main():
             default='present',
         ),
         name=dict(default=None, required=True),
+        id=dict(default=None),
         ballooning=dict(default=None, type='bool', aliases=['balloon']),
         gluster=dict(default=None, type='bool'),
         virt=dict(default=None, type='bool'),
diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_datacenter.py b/lib/ansible/modules/cloud/ovirt/ovirt_datacenter.py
index e08b16912ef574..c70f8be804bf56 100644
--- a/lib/ansible/modules/cloud/ovirt/ovirt_datacenter.py
+++ b/lib/ansible/modules/cloud/ovirt/ovirt_datacenter.py
@@ -18,6 +18,10 @@
 description:
     - "Module to manage data centers in oVirt/RHV"
 options:
+    id:
+        description:
+            - "ID of the datacenter to manage."
+        version_added: "2.7"
     name:
         description:
             - "Name of the data center to manage."
@@ -77,6 +81,11 @@
 - ovirt_datacenter:
     state: absent
     name: mydatacenter
+
+# Change Datacenter Name
+- ovirt_datacenter:
+    id: 00000000-0000-0000-0000-000000000000
+    name: "new datacenter name"
 '''
 
 RETURN = '''
@@ -140,6 +149,7 @@ def _get_mac_pool(self):
     def build_entity(self):
         return otypes.DataCenter(
             name=self._module.params['name'],
+            id=self._module.params['id'],
             comment=self._module.params['comment'],
             description=self._module.params['description'],
             mac_pool=otypes.MacPool(
@@ -162,6 +172,7 @@ def update_check(self, entity):
             equal(getattr(self._get_mac_pool(), 'id', None), getattr(entity.mac_pool, 'id', None)) and
             equal(self._module.params.get('comment'), entity.comment) and
             equal(self._module.params.get('description'), entity.description) and
+            equal(self._module.params.get('name'), entity.name) and
             equal(self._module.params.get('quota_mode'), str(entity.quota_mode)) and
             equal(self._module.params.get('local'), entity.local) and
             equal(minor, self.__get_minor(entity.version)) and
@@ -178,6 +189,7 @@ def main():
         name=dict(default=None, required=True),
         description=dict(default=None),
         local=dict(type='bool'),
+        id=dict(default=None),
         compatibility_version=dict(default=None),
         quota_mode=dict(choices=['disabled', 'audit', 'enabled']),
         comment=dict(default=None),
diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_host.py b/lib/ansible/modules/cloud/ovirt/ovirt_host.py
index 0376dd19a21360..176d09cfbeaeca 100644
--- a/lib/ansible/modules/cloud/ovirt/ovirt_host.py
+++ b/lib/ansible/modules/cloud/ovirt/ovirt_host.py
@@ -18,6 +18,10 @@
 description:
     - "Module to manage hosts in oVirt/RHV"
 options:
+    id:
+        description:
+            - "ID of the nic to manage."
+        version_added: "2.7"
     name:
         description:
             - "Name of the host to manage."
@@ -218,6 +222,11 @@
     state: absent
     name: myhost
     force: True
+
+# Change host Name
+- ovirt_host:
+    id: 00000000-0000-0000-0000-000000000000
+    name: "new host name"
 '''
 
 RETURN = '''
@@ -263,6 +272,7 @@ class HostsModule(BaseModule):
 
     def build_entity(self):
         return otypes.Host(
+            id=self._module.params.get('id'),
             name=self.param('name'),
             cluster=otypes.Cluster(
                 name=self.param('cluster')
@@ -295,6 +305,7 @@ def update_check(self, entity):
             equal(self.param('comment'), entity.comment) and
             equal(self.param('kdump_integration'), 'enabled' if entity.power_management.kdump_detection else 'disabled') and
             equal(self.param('spm_priority'), entity.spm.priority) and
+            equal(self.param('name'), entity.name) and
             equal(self.param('power_management_enabled'), entity.power_management.enabled) and
             equal(self.param('override_display'), getattr(entity.display, 'address', None)) and
             equal(
@@ -400,6 +411,7 @@ def main():
             default='present',
         ),
         name=dict(required=True),
+        id=dict(default=None),
         comment=dict(default=None),
         cluster=dict(default=None),
         address=dict(default=None),
diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_mac_pool.py b/lib/ansible/modules/cloud/ovirt/ovirt_mac_pool.py
index 22858f3b73eb10..6b546e709267c9 100644
--- a/lib/ansible/modules/cloud/ovirt/ovirt_mac_pool.py
+++ b/lib/ansible/modules/cloud/ovirt/ovirt_mac_pool.py
@@ -18,6 +18,10 @@
 description:
     - "This module manage MAC pools in oVirt/RHV."
 options:
+    id:
+        description:
+            - "ID of the mac pool to manage."
+        version_added: "2.7"
     name:
         description:
             - "Name of the MAC pool to manage."
@@ -58,6 +62,11 @@
 - ovirt_mac_pool:
     state: absent
     name: mymacpool
+
+# Change MAC pool Name
+- ovirt_nic:
+    id: 00000000-0000-0000-0000-000000000000
+    name: "new mac pool name"
 '''
 
 RETURN = '''
@@ -95,6 +104,7 @@ class MACPoolModule(BaseModule):
     def build_entity(self):
         return otypes.MacPool(
             name=self._module.params['name'],
+            id=self._module.params['id'],
             allow_duplicates=self._module.params['allow_duplicates'],
             description=self._module.params['description'],
             ranges=[
@@ -103,7 +113,7 @@ def build_entity(self):
                     to=mac_range.split(',')[1],
                 )
                 for mac_range in self._module.params['ranges']
-            ],
+            ] if self._module.params['ranges'] else None,
         )
 
     def _compare_ranges(self, entity):
@@ -120,7 +130,8 @@ def update_check(self, entity):
         return (
             self._compare_ranges(entity) and
             equal(self._module.params['allow_duplicates'], entity.allow_duplicates) and
-            equal(self._module.params['description'], entity.description)
+            equal(self._module.params['description'], entity.description) and
+            equal(self._module.params['name'], entity.name)
         )
 
 
@@ -131,6 +142,7 @@ def main():
             default='present',
         ),
         name=dict(required=True),
+        id=dict(default=None),
         allow_duplicates=dict(default=None, type='bool'),
         description=dict(default=None),
         ranges=dict(default=None, type='list'),
diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_network.py b/lib/ansible/modules/cloud/ovirt/ovirt_network.py
index a7e6a9d4752cc2..179958b8804729 100644
--- a/lib/ansible/modules/cloud/ovirt/ovirt_network.py
+++ b/lib/ansible/modules/cloud/ovirt/ovirt_network.py
@@ -33,6 +33,10 @@
 description:
     - "Module to manage logical networks in oVirt/RHV"
 options:
+    id:
+        description:
+            - "ID of the network to manage."
+        version_added: "2.7"
     name:
         description:
             - "Name of the network to manage."
@@ -93,6 +97,12 @@
 - ovirt_network:
     state: absent
     name: mynetwork
+
+# Change Network Name
+- ovirt_network:
+    id: 00000000-0000-0000-0000-000000000000
+    name: "new network name"
+    data_center: mydatacenter
 '''
 
 RETURN = '''
@@ -134,6 +144,7 @@ def build_entity(self):
             name=self._module.params['name'],
             comment=self._module.params['comment'],
             description=self._module.params['description'],
+            id=self._module.params['id'],
             data_center=otypes.DataCenter(
                 name=self._module.params['data_center'],
             ) if self._module.params['data_center'] else None,
@@ -168,6 +179,7 @@ def update_check(self, entity):
         self._update_label_assignments(entity)
         return (
             equal(self._module.params.get('comment'), entity.comment) and
+            equal(self._module.params.get('name'), entity.name) and
             equal(self._module.params.get('description'), entity.description) and
             equal(self._module.params.get('vlan_tag'), getattr(entity.vlan, 'id', None)) and
             equal(self._module.params.get('vm_network'), True if entity.usages else False) and
@@ -226,6 +238,7 @@ def main():
             default='present',
         ),
         data_center=dict(required=True),
+        id=dict(default=None),
         name=dict(required=True),
         description=dict(default=None),
         comment=dict(default=None),
diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_nic.py b/lib/ansible/modules/cloud/ovirt/ovirt_nic.py
index 20a6ccf221eb53..766ab066eb1fe3 100644
--- a/lib/ansible/modules/cloud/ovirt/ovirt_nic.py
+++ b/lib/ansible/modules/cloud/ovirt/ovirt_nic.py
@@ -18,6 +18,10 @@
 description:
     - Module to manage network interfaces of Virtual Machines in oVirt/RHV.
 options:
+    id:
+        description:
+            - "ID of the nic to manage."
+        version_added: "2.7"
     name:
         description:
             - Name of the network interface to manage.
@@ -94,6 +98,12 @@
     state: absent
     vm: myvm
     name: mynic
+
+# Change NIC Name
+- ovirt_nic:
+    id: 00000000-0000-0000-0000-000000000000
+    name: "new nic name"
+    vm: myvm
 '''
 
 RETURN = '''
@@ -144,6 +154,7 @@ def vnic_id(self, vnic_id):
 
     def build_entity(self):
         return otypes.Nic(
+            id=self._module.params.get('id'),
             name=self._module.params.get('name'),
             interface=otypes.NicInterface(
                 self._module.params.get('interface')
@@ -160,12 +171,14 @@ def update_check(self, entity):
         if self._module.params.get('vm'):
             return (
                 equal(self._module.params.get('interface'), str(entity.interface)) and
+                equal(self._module.params.get('name'), str(entity.name)) and
                 equal(self._module.params.get('profile'), get_link_name(self._connection, entity.vnic_profile)) and
                 equal(self._module.params.get('mac_address'), entity.mac.address)
             )
         elif self._module.params.get('template'):
             return (
                 equal(self._module.params.get('interface'), str(entity.interface)) and
+                equal(self._module.params.get('name'), str(entity.name)) and
                 equal(self._module.params.get('profile'), get_link_name(self._connection, entity.vnic_profile))
             )
 
@@ -174,6 +187,7 @@ def main():
     argument_spec = ovirt_full_argument_spec(
         state=dict(type='str', default='present', choices=['absent', 'plugged', 'present', 'unplugged']),
         vm=dict(type='str'),
+        id=dict(default=None),
         template=dict(type='str'),
         name=dict(type='str', required=True),
         interface=dict(type='str'),
diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_quota.py b/lib/ansible/modules/cloud/ovirt/ovirt_quota.py
index 3926534e18d760..9a1ac73c83e50c 100644
--- a/lib/ansible/modules/cloud/ovirt/ovirt_quota.py
+++ b/lib/ansible/modules/cloud/ovirt/ovirt_quota.py
@@ -18,6 +18,10 @@
 description:
     - "Module to manage datacenter quotas in oVirt/RHV"
 options:
+    id:
+        description:
+            - "ID of the quota to manage."
+        version_added: "2.7"
     name:
         description:
             - "Name of the quota to manage."
@@ -106,6 +110,12 @@
     state: absent
     data_center: dcX
     name: quota1
+
+# Change Quota Name
+- ovirt_quota:
+    id: 00000000-0000-0000-0000-000000000000
+    name: "new quota name"
+    data_center: dcX
 '''
 
 RETURN = '''
@@ -146,6 +156,7 @@ def build_entity(self):
         return otypes.Quota(
             description=self._module.params['description'],
             name=self._module.params['name'],
+            id=self._module.params['id'],
             storage_hard_limit_pct=self._module.params.get('storage_grace'),
             storage_soft_limit_pct=self._module.params.get('storage_threshold'),
             cluster_hard_limit_pct=self._module.params.get('cluster_grace'),
@@ -202,6 +213,7 @@ def update_check(self, entity):
         return (
             self.update_storage_limits(entity) and
             self.update_cluster_limits(entity) and
+            equal(self._module.params.get('name'), entity.name) and
             equal(self._module.params.get('description'), entity.description) and
             equal(self._module.params.get('storage_grace'), entity.storage_hard_limit_pct) and
             equal(self._module.params.get('storage_threshold'), entity.storage_soft_limit_pct) and
@@ -216,6 +228,7 @@ def main():
             choices=['present', 'absent'],
             default='present',
         ),
+        id=dict(default=None),
         name=dict(required=True),
         data_center=dict(required=True),
         description=dict(default=None),
diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_tag.py b/lib/ansible/modules/cloud/ovirt/ovirt_tag.py
index c1fbf1cb925a7c..0a5d94ede9d73b 100644
--- a/lib/ansible/modules/cloud/ovirt/ovirt_tag.py
+++ b/lib/ansible/modules/cloud/ovirt/ovirt_tag.py
@@ -34,6 +34,10 @@
     - "This module manage tags in oVirt/RHV. It can also manage assignments
        of those tags to entities."
 options:
+    id:
+        description:
+            - "ID of the tag to manage."
+        version_added: "2.7"
     name:
         description:
             - "Name of the tag to manage."
@@ -93,6 +97,11 @@
 - ovirt_tag:
     state: absent
     name: mytag
+
+# Change cluster Name
+- ovirt_tag:
+    id: 00000000-0000-0000-0000-000000000000
+    name: "new tag name"
 '''
 
 RETURN = '''
@@ -130,6 +139,7 @@ class TagsModule(BaseModule):
 
     def build_entity(self):
         return otypes.Tag(
+            id=self._module.params['id'],
             name=self._module.params['name'],
             description=self._module.params['description'],
             parent=otypes.Tag(
@@ -195,6 +205,7 @@ def update_check(self, entity):
         self._update_tag_assignments(entity, 'hosts')
         return (
             equal(self._module.params.get('description'), entity.description) and
+            equal(self._module.params.get('name'), entity.name) and
             equal(self._module.params.get('parent'), self._get_parent(entity))
         )
 
@@ -205,6 +216,7 @@ def main():
             choices=['present', 'absent', 'attached', 'detached'],
             default='present',
         ),
+        id=dict(default=None),
         name=dict(required=True),
         description=dict(default=None),
         parent=dict(default=None),
diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_template.py b/lib/ansible/modules/cloud/ovirt/ovirt_template.py
index 6e280240443ce6..d952f55d2a0cab 100644
--- a/lib/ansible/modules/cloud/ovirt/ovirt_template.py
+++ b/lib/ansible/modules/cloud/ovirt/ovirt_template.py
@@ -185,6 +185,11 @@
     state: absent
     name: mytemplate
 
+# Change Template Name
+- ovirt_template:
+    id: 00000000-0000-0000-0000-000000000000
+    name: "new template name"
+
 # Register template
 - ovirt_template:
   state: registered
@@ -289,6 +294,7 @@ class TemplatesModule(BaseModule):
 
     def build_entity(self):
         return otypes.Template(
+            id=self._module.params['id'],
             name=self._module.params['name'],
             cluster=otypes.Cluster(
                 name=self._module.params['cluster']
@@ -326,6 +332,7 @@ def update_check(self, entity):
             equal(self._module.params.get('cluster'), get_link_name(self._connection, entity.cluster)) and
             equal(self._module.params.get('description'), entity.description) and
             equal(self.param('operating_system'), str(entity.os.type)) and
+            equal(self.param('name'), str(entity.name)) and
             equal(convert_to_bytes(self.param('memory_guaranteed')), entity.memory_policy.guaranteed) and
             equal(convert_to_bytes(self.param('memory_max')), entity.memory_policy.max) and
             equal(convert_to_bytes(self.param('memory')), entity.memory) and
diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_vm.py b/lib/ansible/modules/cloud/ovirt/ovirt_vm.py
index 0f444616ca3a00..153ccf028afc87 100644
--- a/lib/ansible/modules/cloud/ovirt/ovirt_vm.py
+++ b/lib/ansible/modules/cloud/ovirt/ovirt_vm.py
@@ -677,6 +677,11 @@
     nics:
       - name: nic1
 
+# Change VM Name
+- ovirt_vmpool:
+    id: 00000000-0000-0000-0000-000000000000
+    name: "new vm name"
+
 - name: Run VM with cloud init
   ovirt_vm:
     name: rhel7
@@ -1166,6 +1171,7 @@ def check_host():
             equal(self.param('cpu_threads'), entity.cpu.topology.threads) and
             equal(self.param('cpu_mode'), str(cpu_mode) if cpu_mode else None) and
             equal(self.param('type'), str(entity.type)) and
+            equal(self.param('name'), str(entity.name)) and
             equal(self.param('operating_system'), str(entity.os.type)) and
             equal(self.param('boot_menu'), entity.bios.boot_menu.enabled) and
             equal(self.param('soundcard_enabled'), entity.soundcard_enabled) and
diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_vmpool.py b/lib/ansible/modules/cloud/ovirt/ovirt_vmpool.py
index 2255d0b72b3989..3c082ab69f8e7c 100644
--- a/lib/ansible/modules/cloud/ovirt/ovirt_vmpool.py
+++ b/lib/ansible/modules/cloud/ovirt/ovirt_vmpool.py
@@ -33,6 +33,10 @@
 description:
     - "Module to manage VM pools in oVirt/RHV."
 options:
+    id:
+        description:
+            - "ID of the vmpool to manage."
+        version_added: "2.7"
     name:
         description:
             - "Name of the VM pool to manage."
@@ -97,6 +101,11 @@
 - ovirt_vmpool:
     state: absent
     name: myvmpool
+
+# Change Pool Name
+- ovirt_vmpool:
+    id: 00000000-0000-0000-0000-000000000000
+    name: "new disk name"
 '''
 
 RETURN = '''
@@ -136,6 +145,7 @@ class VmPoolsModule(BaseModule):
 
     def build_entity(self):
         return otypes.VmPool(
+            id=self._module.params['id'],
             name=self._module.params['name'],
             description=self._module.params['description'],
             comment=self._module.params['comment'],
@@ -155,6 +165,7 @@ def build_entity(self):
 
     def update_check(self, entity):
         return (
+            equal(self._module.params.get('name'), entity.name) and
             equal(self._module.params.get('cluster'), get_link_name(self._connection, entity.cluster)) and
             equal(self._module.params.get('description'), entity.description) and
             equal(self._module.params.get('comment'), entity.comment) and
@@ -166,6 +177,7 @@ def update_check(self, entity):
 
 def main():
     argument_spec = ovirt_full_argument_spec(
+        id=dict(default=None),
         state=dict(
             choices=['present', 'absent'],
             default='present',


Code review comments:
diff_hunk: @@ -97,6 +101,11 @@
 - ovirt_vmpool:
     state: absent
     name: myvmpool
+
+# Change Pool Name
+- ovirt_vmpool:
+    id: 00000000-0000-0000-0000-000000000000
+    name: "new disk name"
path: lib/ansible/modules/cloud/ovirt/ovirt_vmpool.py
text: @user1:
No spaces. s/new disk name/new_pool_name

diff_hunk: @@ -266,6 +270,11 @@
 - ovirt_cluster:
     state: absent
     name: mycluster
+
+# Change cluster Name
+- ovirt_cluster:
+    id: 00000000-0000-0000-0000-000000000000
+    name: "new cluster name"
path: lib/ansible/modules/cloud/ovirt/ovirt_cluster.py
text: @user1:
There can't be spaces in cluster name.

diff_hunk: @@ -18,6 +18,10 @@
 description:
     - "Module to manage hosts in oVirt/RHV"
 options:
+    id:
+        description:
+            - "ID of the nic to manage."
path: lib/ansible/modules/cloud/ovirt/ovirt_host.py
text: @user1:
s/nic/host

diff_hunk: @@ -93,6 +97,11 @@
 - ovirt_tag:
     state: absent
     name: mytag
+
+# Change cluster Name
+- ovirt_tag:
+    id: 00000000-0000-0000-0000-000000000000
+    name: "new tag name"
path: lib/ansible/modules/cloud/ovirt/ovirt_tag.py
text: @user1:
No spaces. s/new tag name/new_cluster_name