Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-29196

Synced Content field is not auto populated while provisioning VM via Satellite CLI

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 6.14.z, 6.15.z
    • Hosts - Content
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • 0
    • Phoenix - Subscriptions
    • Moderate
    • None

      Description of problem:

      While deploying/provisioning VM via Satellite WebUI, the 'Synced Content' field gets populated automatically after the "Operating System" and "Content View" are selected. However while provisioning VM via API Call, the  'Synced Content' field is not auto populated and remains empty

       

      Steps to Reproduce:

      using the Ansible uri module to make an API call and create a host in Satellite. While the following code successfully creates the host, it is not populating the "Synced Content" and "Guest OS" fields.

      Please see the code below:

      ------------------------------------

      • name: Create host
          ansible.builtin.uri:
            url: "https://{{ satellite_url }}/api/v2/hosts"
            method: POST
            user: "{{ rhel_username }}"
            password: "{{ rhel_password }}"
            force_basic_auth: true
            headers:
              Content-Type: "application/json"
              Accept: "application/json"
            body_format: json
            body: |
                  {
                    "host": {
                      "name": "{{ hostname }}",
                      "organization_id": "{{ id_organization }}",
                      "location_id": "{{ id_location }}",
                      "hostgroup_id": "{{ id_hostgroup }}",
                      "architecture_id": "{{ id_architecture }}",
                      "operatingsystem_id": "{{ id_operatingsystem }}",
                      "provision_method": "bootdisk",
                      "build": "true",
                      "root_pass": "{{ root_password }}",
                      "content_facet_attributes": {                 "content_view_id": xx,                 "content_source_id": x               }
        ,
                      "compute_attributes": {
                        "cpus": "{{ cpu }}",
                        "memory_mb": "{{ memory * 1024 }}",
                        "corespersocket": "{{ sockets }}",
                        "firmware": "BIOS",
                        "cluster_name": "{{ cluster name }}",
                        "volumes_attributes": {
                          "0": {
                            "datastore": "{{ datastore name }}",
                            "size_gb": 200
                          }
                        }
                      },
                      "interfaces_attributes": [
                        {
                          "ip": "{{ ip_address }}",
                          "subnet_id": "{{ id_subnet }}",
                          "compute_attributes": {
                            "network": "{{ id_vlan }}"
                          }
                        }
                      ],
                      "host_parameters_attributes": [
                        {
                          "name": "oud_access_users",
                          "value": "['user1','srv_xxxxxx','\\\{{ admin_user }}']",
                          "parameter_type": "array"
                        }
                      ]
                    }
                  }
            validate_certs: false
            timeout: 300
            status_code: [200, 201]
          delegate_to: localhost
          register: host_details

       

      Expected behavior:
      The 'Synced Content' field should be auto populated while using the above code/API Call to perform provisioning

      Business Impact / Additional info: Able to successfully provision the host  with Satellite GUI but failing to do so via API calls.

       

              Unassigned Unassigned
              rhn-support-jbhatia Jayant Bhatia
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: