Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

[issue-85] Drift in state file #88

Merged
merged 1 commit into from
Sep 11, 2020
Merged

[issue-85] Drift in state file #88

merged 1 commit into from
Sep 11, 2020

Conversation

Prativa20
Copy link
Contributor

@Prativa20 Prativa20 commented Sep 9, 2020

Added pagination in resource read to fetch all VMs in a deployment to fix #85
Modified the schema, README and the doc is updated with the changes.

NOTE: The schema has been modified. With this change, the .tf files needs no modification, but the state file will have a few changes in the resource_configuration block. This will require the outputs to be modified according to the new state file.

Following is a brief summary of state file modifications:

resource_configuration: [
     "component_name" = "Machine1"
     "cluster" = 2
     "configuration" : {
          "cpu"= 2
          "memory" = 1024
     }
     // this has been renamed from resource_state to instances. resource_state was a map, but instances is a list
     // it is a list of all VMs in the above cluster. each element in an instance represents a VM and its properties
     instances: [
          {
               "resource_id" : <some_id>,
               "name" : Machine1-2000,
               " ip_address" : 10.xxx.xxx.xxx,
               "properties" : {
                    "cpu" : 2
                    "memory" : 1024,
                    "storage" : 8,
                    "ChangeLease": "true",
                    "ChangeOwner": "true",
                    "Component": "vSphere2",
                    "machineId": "4678efa4-1ccn8-457f-b5ee-ed73727decc9",
                    // all other properties returned by vRA
             },
            {
               "resource_id" : <some_id>,
               "name" : Machine1-2001,
               " ip_address" : 10.xxx.xxx.xxx,
               "properties" : {
                    "cpu" : 2
                    "memory" : 1024,
                    "storage" : 8,
                    "ChangeLease": "true",
                    "ChangeOwner": "true",
                    "Component": "vSphere2",
                    "machineId": "4678efa4-14b8-457f-b5ee-edhgf27decc9",
                    // all other properties returned by vRA
             }
          } 
     ]
]

Signed-off-by: Prativa Bawri bawrip@vmware.com

Added pagination in resource read to fetch all VMs in a deployment
Modified the schema, README and the doc is updated with the changes

Signed-off-by: Prativa Bawri <bawrip@vmware.com>
Copy link
Contributor

@markpeek markpeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Prativa20 Prativa20 merged commit 642828e into master Sep 11, 2020
@Prativa20 Prativa20 deleted the pagination-fix branch September 11, 2020 02:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drift in state file
2 participants