-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support multiple ceph monitors #6792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DaanHoogland
merged 15 commits into
apache:main
from
weizhouapache:4.18-multiple-ceph-monitors
Oct 21, 2022
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
bf9f1ff
utils: add getUriInfo in UriUtils
weizhouapache 5621f72
kvm plugin: support multiple hosts in vm def xml
weizhouapache cab8f65
kvm plugin: parse storage pool xml with multiple hosts
weizhouapache 0242000
kvm: fix exception when backup volume snapshot
weizhouapache 4c3e0ec
kvm: fix backup volume snapshot fails on RBD storage
weizhouapache ac63fe3
kvm QemuImageOptions: use setFormat
weizhouapache 783e79b
kvm #6790: fix code smell
weizhouapache d8a661c
Update #6790: use uppercase
weizhouapache 2a20362
UriUtils: support RBD url with Ipv6 address
weizhouapache f61f624
kvm: fix RBD storage pool definition xml
weizhouapache 4a242a7
kvm: add slash before colon in IPv6 addresses for RBDStringBuilder
weizhouapache 34f8732
kvm: remove Ipv6 brackets in vm definition xml
weizhouapache 58a302d
UriUtils: fix potential NPE
weizhouapache 921d91d
Merge remote-tracking branch 'apache/main' into 4.18-multiple-ceph-mo…
weizhouapache 7ad0b52
UI: add description of rados monitors
weizhouapache File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
.../kvm/src/test/java/com/cloud/hypervisor/kvm/resource/LibvirtStoragePoolXMLParserTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| package com.cloud.hypervisor.kvm.resource; | ||
|
|
||
| import junit.framework.TestCase; | ||
| import org.junit.Assert; | ||
|
|
||
| public class LibvirtStoragePoolXMLParserTest extends TestCase { | ||
|
|
||
| public void testParseNfsStoragePoolXML() { | ||
| String poolXML = "<pool type='netfs'>\n" + | ||
| " <name>feff06b5-84b2-3258-b5f9-1953217295de</name>\n" + | ||
| " <uuid>feff06b5-84b2-3258-b5f9-1953217295de</uuid>\n" + | ||
| " <capacity unit='bytes'>111111111</capacity>\n" + | ||
| " <allocation unit='bytes'>2222222</allocation>\n" + | ||
| " <available unit='bytes'>3333333</available>\n" + | ||
| " <source>\n" + | ||
| " <host name='10.11.12.13'/>\n" + | ||
| " <dir path='/mnt/primary1'/>\n" + | ||
| " <format type='auto'/>\n" + | ||
| " </source>\n" + | ||
| " <target>\n" + | ||
| " <path>/mnt/feff06b5-84b2-3258-b5f9-1953217295de</path>\n" + | ||
| " <permissions>\n" + | ||
| " <mode>0755</mode>\n" + | ||
| " <owner>0</owner>\n" + | ||
| " <group>0</group>\n" + | ||
| " </permissions>\n" + | ||
| " </target>\n" + | ||
| "</pool>"; | ||
|
|
||
| LibvirtStoragePoolXMLParser parser = new LibvirtStoragePoolXMLParser(); | ||
| LibvirtStoragePoolDef pool = parser.parseStoragePoolXML(poolXML); | ||
|
|
||
| Assert.assertEquals("10.11.12.13", pool.getSourceHost()); | ||
| } | ||
|
|
||
| public void testParseRbdStoragePoolXMLWithMultipleHosts() { | ||
| String poolXML = "<pool type='rbd'>\n" + | ||
| " <name>feff06b5-84b2-3258-b5f9-1953217295de</name>\n" + | ||
| " <uuid>feff06b5-84b2-3258-b5f9-1953217295de</uuid>\n" + | ||
| " <source>\n" + | ||
| " <name>rbdpool</name>\n" + | ||
| " <host name='10.11.12.13' port='6789'/>\n" + | ||
| " <host name='10.11.12.14' port='6789'/>\n" + | ||
| " <host name='10.11.12.15' port='6789'/>\n" + | ||
| " <format type='auto'/>\n" + | ||
| " <auth username='admin' type='ceph'>\n" + | ||
| " <secret uuid='262f743a-3726-11ed-aaee-93e90b39d5c4'/>\n" + | ||
| " </auth>\n" + | ||
| " </source>\n" + | ||
| "</pool>"; | ||
|
|
||
| LibvirtStoragePoolXMLParser parser = new LibvirtStoragePoolXMLParser(); | ||
| LibvirtStoragePoolDef pool = parser.parseStoragePoolXML(poolXML); | ||
|
|
||
| Assert.assertEquals(LibvirtStoragePoolDef.PoolType.RBD, pool.getPoolType()); | ||
| Assert.assertEquals(LibvirtStoragePoolDef.AuthenticationType.CEPH, pool.getAuthType()); | ||
| Assert.assertEquals("10.11.12.13,10.11.12.14,10.11.12.15", pool.getSourceHost()); | ||
weizhouapache marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Assert.assertEquals(6789, pool.getSourcePort()); | ||
| } | ||
|
|
||
| public void testParseRbdStoragePoolXMLWithMultipleHostsIpv6() { | ||
| String poolXML = "<pool type='rbd'>\n" + | ||
| " <name>feff06b5-84b2-3258-b5f9-1953217295de</name>\n" + | ||
| " <uuid>feff06b5-84b2-3258-b5f9-1953217295de</uuid>\n" + | ||
| " <source>\n" + | ||
| " <name>rbdpool</name>\n" + | ||
| " <host name='[fc00:aa:bb:cc::1]' port='6789'/>\n" + | ||
| " <host name='[fc00:aa:bb:cc::2]' port='6789'/>\n" + | ||
| " <host name='[fc00:aa:bb:cc::3]' port='6789'/>\n" + | ||
| " <format type='auto'/>\n" + | ||
| " <auth username='admin' type='ceph'>\n" + | ||
| " <secret uuid='262f743a-3726-11ed-aaee-93e90b39d5c4'/>\n" + | ||
| " </auth>\n" + | ||
| " </source>\n" + | ||
| "</pool>"; | ||
|
|
||
| LibvirtStoragePoolXMLParser parser = new LibvirtStoragePoolXMLParser(); | ||
| LibvirtStoragePoolDef pool = parser.parseStoragePoolXML(poolXML); | ||
|
|
||
| Assert.assertEquals(LibvirtStoragePoolDef.PoolType.RBD, pool.getPoolType()); | ||
| Assert.assertEquals(LibvirtStoragePoolDef.AuthenticationType.CEPH, pool.getAuthType()); | ||
| Assert.assertEquals("[fc00:aa:bb:cc::1],[fc00:aa:bb:cc::2],[fc00:aa:bb:cc::3]", pool.getSourceHost()); | ||
| Assert.assertEquals(6789, pool.getSourcePort()); | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.