Skip to content

db-schema update 4.15.0 to 4.15.1: correct some guest-os namings#4574

Merged
yadvr merged 1 commit into
apache:4.15from
mib1185:mib1185-patch-1
Mar 11, 2021
Merged

db-schema update 4.15.0 to 4.15.1: correct some guest-os namings#4574
yadvr merged 1 commit into
apache:4.15from
mib1185:mib1185-patch-1

Conversation

@mib1185
Copy link
Copy Markdown
Contributor

@mib1185 mib1185 commented Jan 8, 2021

Description

Correct copy&paste issue from lines

INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name, created) VALUES (325, UUID(), 7, 'SCO OpenServer 6', now());

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)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

-- SCO OpenServer 6 VMWare guest os mapping
-- Add OpenSUSE Linux as support guest os
INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name, created) VALUES (327, UUID(), 7, 'OpenSUSE Linux', now());
-- OpenSUSE Linux VMWare guest os mapping
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.

"opensuseGuest" vmware mapping refers to "SUSE openSUSE (32-bit), so I think its better to keep 32bit information in the display name. 64bit has different name in vmware "opensuse64Guest" so its good to differentiate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I´m a little bit confused, because the behaviour of adding/not adding (32-bit) is inconsistent already in this single db-schema upgrade file - for example:


INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name, created) VALUES (306, UUID(), 2, 'Linux 3.x Kernel (64 bit)', now());

INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name, created) VALUES (307, UUID(), 2, 'Linux 3.x Kernel (32 bit)', now());


INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name, created) VALUES (309, UUID(), 7, 'Asianux Server 4 (32 bit)', now());

INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name, created) VALUES (310, UUID(), 7, 'Asianux Server 4 (64 bit)', now());


and opposite

INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name, created) VALUES (319, UUID(), 7, 'Fedora Linux (64 bit)', now());

INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name, created) VALUES (320, UUID(), 7, 'Fedora Linux', now());


INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name, created) VALUES (322, UUID(), 7, 'Mandriva Linux (64 bit)', now());

INSERT INTO `cloud`.`guest_os` (id, uuid, category_id, display_name, created) VALUES (323, UUID(), 7, 'Mandriva Linux', now());

So, what should I use as template?

Copy link
Copy Markdown
Contributor

@RodrigoDLopez RodrigoDLopez left a comment

Choose a reason for hiding this comment

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

I believe that what our colleague @harikrishna-patnala is saying makes sense since in the past we had distinct markings between 32 and 64 bits.

I believe it would be a good correction if you make the necessary adjustments to the other entries, adding 32/64 bits to the names if there are none. From my point of view, I would say that the entries whose ID: 316, 320, 321, 323, 324, 325, 327 are all 32-bit versions

@mib1185
Copy link
Copy Markdown
Contributor Author

mib1185 commented Jan 14, 2021

Hi,
I have added (32 Bit) where it is applicable. For 693, 739, 771 and 782 there are no different versions for 32 or 64 bit and therefor has no information about that added.
Source: https://vdc-download.vmware.com/vmwb-repository/dcr-public/da47f910-60ac-438b-8b9b-6122f4d14524/16b7274a-bf8b-4b4c-a05e-746f2aa93c8c/doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html

@DaanHoogland DaanHoogland modified the milestone: 4.16.0.0 Jan 18, 2021
@DaanHoogland
Copy link
Copy Markdown
Contributor

@mib1185 @harikrishna-patnala @RodrigoDLopez does it make sense to move this line to a newer upgrade file? 4.15.0.0 has been released already and we want to keep our fragile upgrade system as consistent as possible.

@mib1185
Copy link
Copy Markdown
Contributor Author

mib1185 commented Jan 18, 2021

@DaanHoogland yeah for sure, you are right. But to be honest, I'm not really familiar with the upgrade system and therefore would kindly ask for support to create a appropriate upgrade file. Will there be an 4.15.1 or is 4.16 targeted for this issue?

@DaanHoogland
Copy link
Copy Markdown
Contributor

@mib1185 if you can make it idempotent it makes sense to put it in 4.14.0.0 to 4.14.1.0 and in 4.15.0.0 to 4.15.1.0. If that is too much work I'd leave it to only go to 4.15.1.0.

@weizhouapache
Copy link
Copy Markdown
Member

@mib1185 since 4.15.0.0 is released and the records has been inserted into db, you need to use UPDATE instead of INSERT INTO.

@harikrishna-patnala
Copy link
Copy Markdown
Member

@mib1185 code changes looks good to me, as suggested please move out from 4.15.0

@mib1185
Copy link
Copy Markdown
Contributor Author

mib1185 commented Jan 19, 2021

@DaanHoogland I would limit it to "4.15.0.0 to 4.15.1.0", because adding it also to 4.14.1 will conflict with the the insert's in table cloud.guest_os during upgrade to 4.15.0.
I noticed that there is an com.cloud.upgrade.dao package still needed, but I hope, someone other will implement this 🤞 😄

@shwstppr
Copy link
Copy Markdown
Contributor

@mib1185 can you please fix conflicts and rebase against 4.15

@mib1185
Copy link
Copy Markdown
Contributor Author

mib1185 commented Jan 25, 2021

@shwstppr conflicts are resolved and rebase to current master is done, or do you mean, i should set this PR again branch 4.15 instead of master ?

@mib1185 mib1185 changed the title correct db-schema update 4.14.0 to 4.15.0 db-schema update 4.15.0 to 4.15.1: correct some guest-os namings Jan 25, 2021
@mib1185 mib1185 changed the base branch from master to 4.15 January 25, 2021 10:38
@mib1185
Copy link
Copy Markdown
Contributor Author

mib1185 commented Jan 25, 2021

@shwstppr now I get it ... rebase to 4.15 is done and PR is set again branch 4.15

@weizhouapache
Copy link
Copy Markdown
Member

@mib1185
this pr lgtm

one question, there are two "SCO OpenServer 5" (ids are 85 and 324).
do you know the difference and plan to change one of them as well ?

@mib1185
Copy link
Copy Markdown
Contributor Author

mib1185 commented Jan 25, 2021

@weizhouapache
id 85 looks somehow strange - I gues it should be "other guest" instead of "SCO OpenServer 5" 🤔

SELECT * FROM cloud.guest_os WHERE id=85;
# id, category_id, name, uuid, display_name, created, removed, is_user_defined
'85', '9', NULL, '78751473-935a-11ea-95f2-005056bb3ebd', 'SCO OpenServer 5', '2020-05-11 09:42:56', NULL, '0'
SELECT * FROM cloud.guest_os_hypervisor WHERE guest_os_id=85;
# id, hypervisor_type, guest_os_name, guest_os_id, hypervisor_version, uuid, created, removed, is_user_defined
'202', 'VmWare', 'SCO OpenServer 5', '85', 'default', '07511bbc-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:56', NULL, '0'
'1387', 'VMware', 'otherGuest', '85', '4.0', '0864ff31-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1528', 'VMware', 'otherGuest', '85', '4.1', '0870b56f-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1669', 'VMware', 'otherGuest', '85', '5.0', '087d1de5-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1810', 'VMware', 'otherGuest', '85', '5.1', '0888ac46-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1951', 'VMware', 'otherGuest', '85', '5.5', '0895bef6-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'2448', 'VMware', 'otherGuest', '85', '6.0', '0cf88f63-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:05', NULL, '0'
'2889', 'VMware', 'otherGuest', '85', '6.5', '0f30e427-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:09', NULL, '0'
'4822', 'VMware', 'otherGuest', '85', '6.7', '1169e8de-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'
'5077', 'VMware', 'otherGuest', '85', '6.7.1', '116b494b-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'
'5332', 'VMware', 'otherGuest', '85', '6.7.2', '116c801a-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'
'5587', 'VMware', 'otherGuest', '85', '6.7.3', '116dbb0a-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'

@weizhouapache
Copy link
Copy Markdown
Member

@weizhouapache
id 85 looks somehow strange - I gues it should be "other guest" instead of "SCO OpenServer 5" 🤔

SELECT * FROM cloud.guest_os WHERE id=85;
# id, category_id, name, uuid, display_name, created, removed, is_user_defined
'85', '9', NULL, '78751473-935a-11ea-95f2-005056bb3ebd', 'SCO OpenServer 5', '2020-05-11 09:42:56', NULL, '0'
SELECT * FROM cloud.guest_os_hypervisor WHERE guest_os_id=85;
# id, hypervisor_type, guest_os_name, guest_os_id, hypervisor_version, uuid, created, removed, is_user_defined
'202', 'VmWare', 'SCO OpenServer 5', '85', 'default', '07511bbc-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:56', NULL, '0'
'1387', 'VMware', 'otherGuest', '85', '4.0', '0864ff31-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1528', 'VMware', 'otherGuest', '85', '4.1', '0870b56f-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1669', 'VMware', 'otherGuest', '85', '5.0', '087d1de5-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1810', 'VMware', 'otherGuest', '85', '5.1', '0888ac46-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1951', 'VMware', 'otherGuest', '85', '5.5', '0895bef6-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'2448', 'VMware', 'otherGuest', '85', '6.0', '0cf88f63-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:05', NULL, '0'
'2889', 'VMware', 'otherGuest', '85', '6.5', '0f30e427-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:09', NULL, '0'
'4822', 'VMware', 'otherGuest', '85', '6.7', '1169e8de-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'
'5077', 'VMware', 'otherGuest', '85', '6.7.1', '116b494b-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'
'5332', 'VMware', 'otherGuest', '85', '6.7.2', '116c801a-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'
'5587', 'VMware', 'otherGuest', '85', '6.7.3', '116dbb0a-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'

@mib1185 thanks.

@nvazquez since you are author of commit 50ab1b2, could you please look at the issue above ?

@yadvr yadvr requested a review from nvazquez January 28, 2021 10:26
@shwstppr shwstppr added this to the 4.15.1.0 milestone Feb 8, 2021
-- Correct guest OS names
UPDATE `cloud`.`guest_os` SET display_name='Fedora Linux (32 bit)' WHERE id=320;
UPDATE `cloud`.`guest_os` SET display_name='Mandriva Linux (32 bit)' WHERE id=323;
UPDATE `cloud`.`guest_os` SET display_name='OpenSUSE Linux (32 bit)' WHERE id=327;
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.

ID 327 in DB is SCO OpenServer 6

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.

Nevermind the only mapping is that for opensuse/vmware:

mysql> select * from guest_os_hypervisor where guest_os_id=327;
+------+-----------------+---------------+-------------+--------------------+--------------------------------------+---------------------+---------+-----------------+
| id   | hypervisor_type | guest_os_name | guest_os_id | hypervisor_version | uuid                                 | created             | removed | is_user_defined |
+------+-----------------+---------------+-------------+--------------------+--------------------------------------+---------------------+---------+-----------------+
| 7156 | VMware          | opensuseGuest |         327 | 6.0                | 81c7f8a1-4b4d-11eb-8705-dca6322512d7 | 2020-12-31 09:49:42 | NULL    |               0 |
| 7157 | VMware          | opensuseGuest |         327 | 6.5                | 81c8b2d6-4b4d-11eb-8705-dca6322512d7 | 2020-12-31 09:49:42 | NULL    |               0 |
| 7158 | VMware          | opensuseGuest |         327 | 6.7                | 81c95b16-4b4d-11eb-8705-dca6322512d7 | 2020-12-31 09:49:42 | NULL    |               0 |
| 7159 | VMware          | opensuseGuest |         327 | 6.7.1              | 81ca26a0-4b4d-11eb-8705-dca6322512d7 | 2020-12-31 09:49:42 | NULL    |               0 |
| 7160 | VMware          | opensuseGuest |         327 | 6.7.2              | 81cadedc-4b4d-11eb-8705-dca6322512d7 | 2020-12-31 09:49:42 | NULL    |               0 |
| 7161 | VMware          | opensuseGuest |         327 | 6.7.3              | 81cbadad-4b4d-11eb-8705-dca6322512d7 | 2020-12-31 09:49:42 | NULL    |               0 |
+------+-----------------+---------------+-------------+--------------------+--------------------------------------+---------------------+---------+-----------------+
6 rows in set (0.00 sec)

@yadvr yadvr merged commit 1cfb449 into apache:4.15 Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants