Refactor cloud-init support and VM Salt config seeding

Missing package dependancies added.

A missing "config" parameter for qemu-nbd based seeding
method added.

A new seeding method utilising Cloud-init added.
The qemu-nbd based method is still a default method
for backward compatibility.

To enable cloud-init, set the "seed" parameter on
a cluster or node level to "cloud-init".
To disable seeding, set this parameter to "false".
Setting this parameter to "true" will default to
the "qemu-nbd" method.

Salt Minion config file will be created automatically
and may be overrided via cluster or node level
metadata:

  salt:
    control:
      cluster:
        mycluster:
          seed: cloud-init
          cloud_init:
            user_data:
              salt_minion:
                conf:
                  master: 10.1.1.1

or for qemu-nbd case:

  salt:
    control:
      cluster:
        mycluster:
          seed: true
          config:
            host: 10.1.1.1

That may be useful when Salt Master has two IPs in
different networks and one of the networks isn't accessible
from a VM at the moment it's created. Setting a reachable
Salt master IP from metadata helps avoid potential problems.

Also, a liitle optimization has been done to parse/dump
an libvirt XML only once while modifying it.

Change-Id: I091cf409cb43ba2d0a18eaf2a08c11e88d0334e2
Closes-Bug: PROD-22191
diff --git a/tests/pillar/control_virt_custom.sls b/tests/pillar/control_virt_custom.sls
index 265d484..3ee85f1 100644
--- a/tests/pillar/control_virt_custom.sls
+++ b/tests/pillar/control_virt_custom.sls
@@ -67,6 +67,7 @@
         config:
           engine: salt
           host: master.domain.com
+        seed: cloud-init
         cloud_init:
           user_data:
             disable_ec2_metadata: true
@@ -104,6 +105,9 @@
             image: bubuntu.qcomw
             size: small
             img_dest: /var/lib/libvirt/hddimages
+            seed: qemu-nbd
+            cloud_init:
+              enabled: false
             loader:
               readonly: yes
               type: pflash
@@ -113,6 +117,10 @@
             image: meowbuntu.qcom2
             size: medium_three_disks
             cloud_init:
+              user_data:
+                salt_minion:
+                  config:
+                    master: master.domain.com
               network_data:
                 networks:
                 - <<: *private-ipv4