Skip to content

Commit e5efc3f

Browse files
Poorna-Gottimukkula1jlebon
authored andcommitted
powervs: make disk name in OVA more descriptive
Signed-off-by: Poorna Gottimukkula <[email protected]> This will give more meaning full name for disk raw image volume from powervc image volumes view, for example "rhcos-416-94-202401181356-0-disk-raw for rhcos". Signed-off-by: Poorna Gottimukkula <[email protected]>
1 parent 2a8d1e6 commit e5efc3f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/cosalib/ibmcloud.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@
3838
"image_suffix": "ova.gz",
3939
"platform": "powervs",
4040
"compression": "gzip",
41-
"tar_members": [
42-
"disk.raw"
43-
]
41+
"tar_members": [] # disk image is added as part of write_ova() function.
4442
},
4543
}
4644

@@ -99,6 +97,7 @@ def write_ova(self, image_name):
9997
log.debug(ovf_xml)
10098
# OVF descriptor must come first, then the manifest, then the meta file
10199
self.tar_members.append(self.ovf_path)
100+
self.tar_members.append(f'{ovf_params["image"]}-disk.raw')
102101

103102

104103
@retry(reraise=True, stop=stop_after_attempt(3))

src/powervs-template.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ovf:Envelope xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
33
<ovf:References>
4-
<ovf:File href="disk.raw" id="file1" size="{image_size}"/>
4+
<ovf:File href="{image}-disk.raw" id="file1" size="{image_size}"/>
55
</ovf:References>
66
<ovf:DiskSection>
77
<ovf:Info>Disk Section</ovf:Info>
@@ -24,7 +24,7 @@
2424
<ovf:Info>Storage resources</ovf:Info>
2525
<ovf:Item>
2626
<rasd:Description>Temporary clone for export</rasd:Description>
27-
<rasd:ElementName>disk.raw</rasd:ElementName>
27+
<rasd:ElementName>{image}-disk.raw</rasd:ElementName>
2828
<rasd:HostResource>ovf:/disk/disk1</rasd:HostResource>
2929
<rasd:InstanceID>1</rasd:InstanceID>
3030
<rasd:ResourceType>17</rasd:ResourceType>

0 commit comments

Comments
 (0)