Skip to content

kvm: Fix double-escape issue while creating rbd disk options#4568

Merged
yadvr merged 2 commits into
apache:4.15from
shapeblue:ceph-double-quote-fix
Jan 5, 2021
Merged

kvm: Fix double-escape issue while creating rbd disk options#4568
yadvr merged 2 commits into
apache:4.15from
shapeblue:ceph-double-quote-fix

Conversation

@yadvr

@yadvr yadvr commented Jan 4, 2021

Copy link
Copy Markdown
Member

This fixes issue introduced in c3554ec
which enable block of code that will double escape rados host/monitor
port.

Seen in logs:

2021-01-04 14:21:35,412 INFO  [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-4:null) (logid:c5187751) Creating volume 125a9ebb-de4c-49cf-b9a7-9249c4af53b9 from template d9eb3660-23e5-4b37-85ec-b6ad4978bf22 in pool 509bd564-b7e3-3d5f-b84b-b799055b11ca (RBD) with size (5.00 GB) 5368709120

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)

This fixes issue introduced in c3554ec
which enable block of code that will double escape rados host/monitor
port.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@yadvr yadvr added this to the 4.15.0.0 milestone Jan 4, 2021
@yadvr

yadvr commented Jan 4, 2021

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@wido

wido commented Jan 4, 2021

Copy link
Copy Markdown
Contributor

@GabrielBrascher had a discussion about this. As the port usually is 6789 the escaping wouldn't happen. Now the if-statement changed and this causes it to escape most of the time.

Gabriel is testing this to see if this fixes it.

@yadvr yadvr closed this Jan 4, 2021
@yadvr yadvr reopened this Jan 4, 2021
@GabrielBrascher

Copy link
Copy Markdown
Member

@rhtyd just adding a small change that is necessary in order to have all tests passing.

At line:

"rbd:volume1:mon_host=ceph-monitor\\\\:8000:auth_supported=cephx:id=admin:key=supersecret:rbd_default_format=2:client_mount_timeout=30");

It needs to be updated from

... monitor\\\\:8000:auth_supported=...

to
... monitor\\:8000:auth_supported=...

@GabrielBrascher GabrielBrascher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Update KVMPhysicalDiskTest class to match mon_host=ceph-monitor\\:8000.

@GabrielBrascher

Copy link
Copy Markdown
Member

@DaanHoogland @rhtyd @wido tests are looking good 👍

Additionally, from my tests, this also fixes #4498.

Once the test class is updated this is good to go.

@DaanHoogland

Copy link
Copy Markdown
Contributor

@GabrielBrascher can you send a PR to this one to include the test fix?

@weizhouapache

Copy link
Copy Markdown
Member

code lgtm
thanks @GabrielBrascher for testing.
@div8cn could you please test it as well ?

@div8cn

div8cn commented Jan 5, 2021

Copy link
Copy Markdown
Contributor

thanks @rhtyd @GabrielBrascher @weizhouapache

This patch has fixed the double-escape .
Now copy template to primary storage is running

2021-01-05 01:07:56,411 DEBUG [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-2:null) (logid:a8028c86) copyPhysicalDisk: disk size:(356.96 MB) 374304768, virtualsize:(2.44 GB) 2621440000 format:qcow2 2021-01-05 01:07:56,412 DEBUG [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-2:null) (logid:a8028c86) The source image is not RBD, but the destination is. We will convert into RBD format 2 2021-01-05 01:07:56,413 DEBUG [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-2:null) (logid:a8028c86) Starting copy from source image /mnt/466f03d4-9dfe-3af4-a042-33a00dae0e97/40165b83-896c-4693-abe7-9fd96b40ce9a.qcow2 to RBD image rbd/40165b83-896c-4693-abe7-9fd96b40ce9a 2021-01-05 01:07:56,413 DEBUG [utils.script.Script] (agentRequest-Handler-2:null) (logid:a8028c86) Executing: qemu-img convert -O raw /mnt/466f03d4-9dfe-3af4-a042-33a00dae0e97/40165b83-896c-4693-abe7-9fd96b40ce9a.qcow2 rbd:rbd/40165b83-896c-4693-abe7-9fd96b40ce9a:mon_host=10.100.250.14\:6789:auth_supported=cephx:id=hyperx:key=AQAywfFf8jCiIxAAbnDBjX1QQAO9Sj22kUBh7g==:rbd_default_format=2:client_mount_timeout=30 2021-01-05 01:07:56,414 DEBUG [utils.script.Script] (agentRequest-Handler-2:null) (logid:a8028c86) Executing while with timeout : 10800000 2021-01-05 01:08:16,919 DEBUG [cloud.agent.Agent] (agentRequest-Handler-4:null) (logid:248c7e0b) Processing command: com.cloud.agent.api.GetStorageStatsCommand

@GabrielBrascher

Copy link
Copy Markdown
Member

@DaanHoogland the only change necessary to pass all tests was the following commit: CLDIN@cc6f7f7

for reference, I added it under ceph-double-quote-fix-test branch.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@yadvr

yadvr commented Jan 5, 2021

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd 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: ✔centos7 ✔centos8 ✔debian. JID-2523

@DaanHoogland

Copy link
Copy Markdown
Contributor

ok, looks good, I'll await travis and assume that will do. Given that there is no ceph automation and we have manual confirmation, i'll create a new rc today.

@yadvr

yadvr commented Jan 5, 2021

Copy link
Copy Markdown
Member Author

Travis is green and we've manual tests from @div8cn and me, as well as lgtm from Daan and Wei. Merging this, let's cut RC4 after this.

@yadvr
yadvr merged commit c82688a into apache:4.15 Jan 5, 2021
qrry added a commit to qrry/cloudstack that referenced this pull request Jan 14, 2021
* commit '280c13a4bb103dd748ec304bfe0714a148c24602':
  Updating pom.xml version numbers for release 4.15.0.0
  kvm: Fix double-escape issue while creating rbd disk options (apache#4568)
  networkorchestrator: Fix typo in exception message (apache#4559)
  checkstyle: fix pom version
  Updating pom.xml version numbers for release 4.15.1.0-SNAPSHOT
  Updating pom.xml version numbers for release 4.15.0.0
  vmware: Fix for mapping guest OS type read from OVF to existing guest OS in C… (apache#4553)
  vmware: Fix template upload from local (apache#4555)
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.

7 participants