Skip to content

Added zone check for attach iso#3755

Merged
DaanHoogland merged 1 commit intoapache:4.13from
shapeblue:iso-from-other-zone
Dec 23, 2019
Merged

Added zone check for attach iso#3755
DaanHoogland merged 1 commit intoapache:4.13from
shapeblue:iso-from-other-zone

Conversation

@Spaceman1984
Copy link
Copy Markdown
Contributor

@Spaceman1984 Spaceman1984 commented Dec 9, 2019

Description

This fix adds a check if the iso belongs to the zone the virtual machine is in

Fixes: #3588

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Screenshots (if appropriate):

How Has This Been Tested?

This was tested using cloudmonkey using the attach iso command.
A Cloudstack installation with 2 zones is required.
I created an instance in the first zone and then uploaded an iso to the second zone.
When trying to attach the iso to the virtual machine in the first zone this error message is returned:

(localcloud) 🐱 > attach iso virtualmachineid=e1b6b77b-df84-4d5e-998a-d7283e5f4f21 id=326c0c96-db4f-4e01-924e-2eac50e0420e
{
"accountid": "4c71abb8-1a54-11ea-a067-000c29a1fe4f",
"cmd": "org.apache.cloudstack.api.command.admin.iso.AttachIsoCmdByAdmin",
"completed": "2019-12-09T12:02:43+0200",
"created": "2019-12-09T12:02:43+0200",
"jobid": "971ce126-7d8c-4ea0-ba3f-5cbbcdbf750f",
"jobprocstatus": 0,
"jobresult": {
"errorcode": 431,
"errortext": "ISO is not available in the zone the VM is in."
},
"jobresultcode": 530,
"jobresulttype": "object",
"jobstatus": 2,
"userid": "4c71db6e-1a54-11ea-a067-000c29a1fe4f"
}
🙈 Error: async API failed for job 971ce126-7d8c-4ea0-ba3f-5cbbcdbf750f

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-452

@borisstoyanov
Copy link
Copy Markdown
Contributor

@blueorangutan test

Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

lgtm

@DaanHoogland
Copy link
Copy Markdown
Contributor

@Spaceman1984 this is a typical bug fix. i think want it in 4.13 as well

@Spaceman1984 Spaceman1984 changed the base branch from master to 4.13 December 13, 2019 07:50
@Spaceman1984 Spaceman1984 changed the base branch from 4.13 to master December 13, 2019 07:54
@DaanHoogland
Copy link
Copy Markdown
Contributor

HOLD ON this one until the branching is fixed

@borisstoyanov
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-617)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 34330 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3755-t617-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_host_maintenance.py
Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
Smoke tests completed. 75 look OK, 2 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_cancel_host_maintenace_with_no_migration_jobs Failure 1.16 test_host_maintenance.py
test_02_cancel_host_maintenace_with_migration_jobs Error 3.61 test_host_maintenance.py
test_hostha_enable_ha_when_host_disabled Error 2.64 test_hostha_kvm.py
test_hostha_enable_ha_when_host_in_maintenance Error 302.87 test_hostha_kvm.py

Copy link
Copy Markdown
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

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

@Spaceman1984, I think Daan suggest this needs rebasing. Can you please do that so I can test it out.

@Spaceman1984
Copy link
Copy Markdown
Contributor Author

Rebased to 4.13

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@DaanHoogland DaanHoogland changed the base branch from master to 4.13 December 17, 2019 10:10
@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-478

@borisstoyanov
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@borisstoyanov a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@DaanHoogland DaanHoogland added this to the 4.13.1.0 milestone Dec 19, 2019
@DaanHoogland
Copy link
Copy Markdown
Contributor

@borisstoyanov can you approve?

Copy link
Copy Markdown
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

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

LGTM, manually checked


(localcloud) SBCM5> > attach iso virtualmachineid=340df668-a1a4-42df-b1db-8de5ef792568 id=577a2ec5-cf46-45cb-b6aa-18d577dcfee2
{
  "accountid": "7933dbb6-2573-11ea-9212-1e00b3010780",
  "cmd": "org.apache.cloudstack.api.command.admin.iso.AttachIsoCmdByAdmin",
  "completed": "2019-12-23T12:18:42+0000",
  "created": "2019-12-23T12:18:42+0000",
  "jobid": "354ad12f-5af7-41ab-abd6-ca8bfdee3683",
  "jobprocstatus": 0,
  "jobresult": {
    "errorcode": 431,
    "errortext": "ISO is not available in the zone the VM is in."
  },
  "jobresultcode": 530,
  "jobresulttype": "object",
  "jobstatus": 2,
  "userid": "7933e929-2573-11ea-9212-1e00b3010780"
}
🙈 Error: async API failed for job 354ad12f-5af7-41ab-abd6-ca8bfdee3683

@DaanHoogland DaanHoogland merged commit 1003085 into apache:4.13 Dec 23, 2019
@DaanHoogland DaanHoogland deleted the iso-from-other-zone branch December 23, 2019 15:48
DaanHoogland added a commit that referenced this pull request Dec 23, 2019
* 4.13:
  Added zone check for attach iso (#3755)
  config: add isdynamic flag in configuration response (#3729)
  filter hosts to query on zone wide storage (#3733)
  convert protocal names to be found as labels (#3747)
  Once again allow a VM to be on multiple networks from VPCs (#3754)
  create template from snapshot regression (partly reverted) (#3767)
ustcweizhou pushed a commit to ustcweizhou/cloudstack that referenced this pull request Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants