Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.4k
CLOUDSTACK-10197: Rename xentools iso for XenServer 7.0+#2365
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2592,9 +2592,10 @@ public VDI getIsoVDIByURL(final Connection conn, final String vmName, final Stri | ||
| String mountpoint = null; | ||
| if (isoURL.startsWith("xs-tools")) { | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This ISO URL remained the same? ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it did. I had an idea to change the iso name (url here refers to name) to something general - like | ||
| try { | ||
| final Set<VDI> vdis = VDI.getByNameLabel(conn, isoURL); | ||
| final String actualIsoURL = actualIsoTemplate(conn); | ||
| final Set<VDI> vdis = VDI.getByNameLabel(conn, actualIsoURL); | ||
| if (vdis.isEmpty()) { | ||
| throw new CloudRuntimeException("Could not find ISO with URL: " + isoURL); | ||
| throw new CloudRuntimeException("Could not find ISO with URL: " + actualIsoURL); | ||
| } | ||
| return vdis.iterator().next(); | ||
| @@ -2630,6 +2631,22 @@ public VDI getIsoVDIByURL(final Connection conn, final String vmName, final Stri | ||
| } | ||
| } | ||
| private String actualIsoTemplate(final Connection conn) throws BadServerResponse, XenAPIException, XmlRpcException { | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you mind creating a documentation for the method? Then, you do not need comments in line.
| ||
| final Host host = Host.getByUuid(conn, _host.getUuid()); | ||
| final Host.Record record = host.getRecord(conn); | ||
| final String xenBrand = record.softwareVersion.get("product_brand"); | ||
| final String xenVersion = record.softwareVersion.get("product_version"); | ||
| final String[] items = xenVersion.split("\\."); | ||
| // guest-tools.iso for XenServer version 7.0+ | ||
| if (xenBrand.equals("XenServer") && Integer.parseInt(items[0]) >= 7) { | ||
| return "guest-tools.iso"; | ||
| } | ||
| // xs-tools.iso for older XenServer versions | ||
| return "xs-tools.iso"; | ||
| } | ||
| public String getLabel() { | ||
| final Connection conn = getConnection(); | ||
| final String result = callHostPlugin(conn, "ovstunnel", "getLabel"); | ||
| @@ -3882,9 +3899,10 @@ protected VDI mount(final Connection conn, final String vmName, final DiskTO vol | ||
| final String templateName = iso.getName(); | ||
| if (templateName.startsWith("xs-tools")) { | ||
| try { | ||
| final Set<VDI> vdis = VDI.getByNameLabel(conn, templateName); | ||
| final String actualTemplateName = actualIsoTemplate(conn); | ||
| final Set<VDI> vdis = VDI.getByNameLabel(conn, actualTemplateName); | ||
| if (vdis.isEmpty()) { | ||
| throw new CloudRuntimeException("Could not find ISO with URL: " + templateName); | ||
| throw new CloudRuntimeException("Could not find ISO with URL: " + actualTemplateName); | ||
| } | ||
| return vdis.iterator().next(); | ||
| } catch (final XenAPIException e) { | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will create an entry for deployments that do not have it yet using this new "standardized name". However, for environment that already had it from previous versions, the name (display_text) will not be updated, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is correct, I can explicitly add
tmplt.setDisplayText("XenServer Tools Installer ISO (xen-pv-drv-iso)");at line 544 (couple lines down here)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the right thing to do, so we get consistency.
You have to save the
tmpltas well right? So, you update the data in the database