cloudfoundry-incubator / bosh-oracle-cpi-release

Other
2 stars 2 forks source link

Test Failure: with release and stemcell and subsequent deployments with persistent disk size changing should migrate disk contents #30

Open dmutreja opened 6 years ago

dmutreja commented 6 years ago

From @dmutreja on November 1, 2017 9:22

BATs test failure

rspec ./spec/system/with_release_stemcell_spec.rb:100

Copied from original issue: oracle/bosh-oracle-cpi#11

dmutreja commented 6 years ago
dmutreja commented 6 years ago

@dmutreja Commented Test output

2) with release and stemcell and subsequent deployments with persistent disk size changing should migrate disk contents
     Failure/Error: @requirements.requirement(deployment, @spec)
       expected command to exit with 0 but was 1. output was
       {
           "Tables": null,
           "Blocks": [
               "\nTask 340 | 23:35:22 | ",
               "Deprecation: Ignoring cloud config. Manifest contains 'networks' section.",
               "\nTask 340 | 23:35:22 | ",
               "Preparing deployment: Preparing deployment",
               " (00:00:00)",
               "\nTask 340 | 23:35:22 | ",
               "Preparing package compilation: Finding packages to compile",
               " (00:00:00)",
               "\nTask 340 | 23:35:22 | ",
               "Compiling packages: batarang/dd553dce44383700de302954532220695c3fb912",
               " (00:01:58)",
               "\nTask 340 | 23:37:51 | ",
               "Creating missing vms: colocated/8d277139-b82e-4edf-82f3-edbffa2c4f6c (0)",
               " (00:01:58)",
               "\nTask 340 | 23:39:49 | ",
               "Updating instance colocated: colocated/8d277139-b82e-4edf-82f3-edbffa2c4f6c (0) (canary)",
               " (00:00:03)",
               "\n                    L Error: CPI error 'Bosh::Clouds::CloudError' with message 'Error creating volume: [POST /volumes][400] createVolumeBadRequest  \u0026{Code:0xc42048c140 Message:0xc42048c160}' in 'create_disk' CPI method",
               "\nTask 340 | 23:39:52 | ",
               "Error: CPI error 'Bosh::Clouds::CloudError' with message 'Error creating volume: [POST /volumes][400] createVolumeBadRequest  \u0026{Code:0xc42048c140 Message:0xc42048c160}' in 'create_disk' CPI method"
           ],
           "Lines": [
               "Using environment '10.0.3.2' as client 'admin'",
               "Using deployment 'bat'",
               "+ resource_pools:\n",
               "+ - cloud_properties:\n",
               "+     availability_domain: WZYX:PHX-AD-3\n",
               "+     instance_shape: VM.Standard1.2\n",
               "+   name: common\n",
               "+   network: default\n",
               "+   stemcell:\n",
               "+     name: light-oracle-ubuntu-stemcell\n",
               "+     version: '2000.12'\n",
               "  \n",
               "+ compilation:\n",
               "+   cloud_properties:\n",
               "+     availability_domain: WZYX:PHX-AD-3\n",
               "+     instance_shape: VM.Standard1.2\n",
               "+   network: default\n",
               "+   reuse_compilation_vms: true\n",
               "+   workers: 2\n",
               "  \n",
               "+ networks:\n",
               "+ - name: default\n",
               "+   subnets:\n",
               "+   - cloud_properties:\n",
               "+       subnet_name: private_subnet_ad3\n",
               "+       vcn: cloudfoundry_vcn\n",
               "+     dns:\n",
               "+     - 169.254.169.254\n",
               "+     gateway: 10.0.8.1\n",
               "+     range: 10.0.8.0/24\n",
               "+     reserved:\n",
               "+     - 10.0.8.2 - 10.0.8.9\n",
               "+     static:\n",
               "+     - 10.0.8.10 - 10.0.8.30\n",
               "+   type: manual\n",
               "  \n",
               "+ releases:\n",
               "+ - name: bat\n",
               "+   version: '3'\n",
               "  \n",
               "+ update:\n",
               "+   canaries: 1\n",
               "+   canary_watch_time: 3000-90000\n",
               "+   max_in_flight: 1\n",
               "+   update_watch_time: 3000-90000\n",
               "  \n",
               "+ jobs:\n",
               "+ - instances: 1\n",
               "+   name: colocated\n",
               "+   networks:\n",
               "+   - default:\n",
               "+     - dns\n",
               "+     - gateway\n",
               "+     name: default\n",
               "+     static_ips:\n",
               "+     - 10.0.7.30\n",
               "+   persistent_disk: 2048\n",
               "+   resource_pool: common\n",
               "+   templates:\n",
               "+   - name: batarang\n",
               "+   - name: batlight\n",
               "  \n",
               "+ name: bat\n",
               "  \n",
               "+ properties:\n",
               "+   batlight:\n",
               "+     missing: \"\u003credacted\u003e\"\n",
               "Task 340",
               "\n",
               "\n\nTask 340 Started  Mon Oct 30 23:35:22 UTC 2017\nTask 340 Finished Mon Oct 30 23:39:52 UTC 2017\nTask 340 Duration 00:04:30",
               "\nTask 340 error\n",
               "Updating deployment:\n  Expected task '340' to succeed but state is 'error'",
               "Exit code 1"
           ]
       }
     # ./lib/bat/requirements.rb:99:in `require_deployment'
     # ./lib/bat/requirements.rb:29:in `requirement'
     # ./spec/system/with_release_stemcell_spec.rb:86:in `block (3 levels) in <top (required)>'
dmutreja commented 6 years ago

@dmutreja Commented Discussed

@cdutra @dkalinin Can the persistent disk size used by test (https://github.com/cloudfoundry/bosh-acceptance-tests/blob/gocli-bats/spec/system/with_release_stemcell_spec.rb#L84) be parameterized? The smallest persistent disk size supported in OCI is 50GiB, so the test fails to create the the initial disk.

In our case we want something like


--- a/spec/system/with_release_stemcell_spec.rb
+++ b/spec/system/with_release_stemcell_spec.rb
@@ -81,7 +81,7 @@ describe 'with release and stemcell and subsequent deployments' do
]
use_job('colocated')
use_templates(%w[batarang batlight])
-      use_persistent_disk(2048)
+      use_persistent_disk(51200)
   @requirements.requirement(deployment, @spec)

@@ -89,7 +89,7 @@ describe 'with release and stemcell and subsequent deployments' do unless warden? @size = persistent_disk('colocated', 0, deployment: deployment) end


>I’m assuming supporting 2GiB disks is not a *hard requirement*

> dkalinin
@dmutreja i think we should make the cpi round up to 50 is thats a minimum

> dmutreja
That’s reasonable, we can do that too.

Entered issue #6
dmutreja commented 6 years ago

@dmutreja Commented @cppforlife @cdutra with the fix for #6 in place this test still fails, though for a different reason. This time around it fails with

  2) with release and stemcell and subsequent deployments with persistent disk size changing should migrate disk contents
     Failure/Error: expect(persistent_disk('colocated', 0, deployment: deployment)).to_not eq(@size)

       expected: value != "51473020"
            got: "51473020"

       (compared using ==)
     # ./spec/system/with_release_stemcell_spec.rb:103:in `block (3 levels) in <top (required)>'

The reason is that CPI converts the requested disk sizes, 2Gib and 4GiB, to 50GiB under the covers but the test expectation is that two sizes would be different.

Automatic rounding up to the minimum size is a good behavior, imo, so I'll leave the CPI changes done #6 in place, but seems the test still has to be modified.

dmutreja commented 6 years ago

@dmutreja Commented hi @dberger, @cdutra recommended reaching out to you regarding this BATs test change. Thoughts?