You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Prasanna Santhanam <ts...@apache.org> on 2012/10/28 07:01:48 UTC
questions in guest_os tables
I was looking at the mapping of guest_os types and found the following
three tables:
guest_os_category, guest_os, guest_os_hypervisor
a. guest_os_category - contains the different distributions
(centos,redhat, etc) as categories
b. guest_os - lists the common set of guest_os's supported across every
hypervisor. correct?
c. guest_os_hypervisor - lists (exhaustive?) all the OSs supported by
each hypervisor.
Some questons I have
1. guest_os_category has a `name` column that is always null. What is
the purpose of this column? Why is it null?
2. guest_os.name, guest_os.display_name, guest_os_hypervisor.guest_os_name - what's the difference?
For eg:
mysql> select * from guest_os_hypervisor where guest_os_name like 'CentOS 5.5%';
+-----+-----------------+---------------+-------------+
| id | hypervisor_type | guest_os_name | guest_os_id |
+-----+-----------------+---------------+-------------+
| 193 | KVM | CentOS 5.5 | 111 |
| 194 | KVM | CentOS 5.5 | 112 |
+-----+-----------------+---------------+-------------+
2 rows in set (0.00 sec)
mysql> select * from guest_os where display_name like 'CentOS 5.5%';
+-----+-------------+------+--------------------------------------+---------------------+
| id | category_id | name | uuid | display_name |
+-----+-------------+------+--------------------------------------+---------------------+
| 111 | 1 | NULL | 3ffadb73-cda1-47a0-bb7a-06dcd52fc05a | CentOS 5.5 (32-bit) |
| 112 | 1 | NULL | 3ff86514-52f7-40b8-9de6-43abf916ec16 | CentOS 5.5 (64-bit) |
+-----+-------------+------+--------------------------------------+---------------------+
2 rows in set (0.00 sec)
3. I'm unable to tell whether guest_os derives from
guest_os_hypervisor or vice-versa? From what I understood - guest_os
is a filtered list built off guest_os_hypervisor. Is this correct?
If not - guest_os_hypervisor doesn't contain any foreign keys
referring to guest_os although it uses various ostype ids from that
table. Why is that? Should a foreign key be added?
mysql> show create table guest_os_hypervisor\G
*************************** 1. row ***************************
Table: guest_os_hypervisor
Create Table: CREATE TABLE `guest_os_hypervisor` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`hypervisor_type` varchar(32) NOT NULL,
`guest_os_name` varchar(255) NOT NULL,
`guest_os_id` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=266 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
mysql> show create table guest_os\G
*************************** 1. row ***************************
Table: guest_os
Create Table: CREATE TABLE `guest_os` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`category_id` bigint(20) unsigned NOT NULL,
`name` varchar(255) DEFAULT NULL,
`uuid` varchar(40) DEFAULT NULL,
`display_name` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uc_guest_os__uuid` (`uuid`),
KEY `fk_guest_os__category_id` (`category_id`),
CONSTRAINT `fk_guest_os__category_id` FOREIGN KEY (`category_id`) REFERENCES `guest_os_category` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=204 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
Thanks,
--
Prasanna.,
questions in guest_os tables
Posted by prasanna <ts...@apache.org>.
I was looking at the mapping of guest_os types and found the following
three tables:
guest_os_category, guest_os, guest_os_hypervisor
a. guest_os_category - contains the different distributions
(centos,redhat, etc) as categories
b. guest_os - lists the common set of guest_os's supported across every
hypervisor. correct?
c. guest_os_hypervisor - lists (exhaustive?) all the OSs supported by
each hypervisor.
Some questons I have
1. guest_os_category has a `name` column that is always null. What is
the purpose of this column? Why is it null?
2. guest_os.name, guest_os.display_name,
guest_os_hypervisor.guest_os_name - what's the difference?
For eg:
mysql> select * from guest_os_hypervisor where guest_os_name like 'CentOS 5.5%';
+-----+-----------------+---------------+-------------+
| id | hypervisor_type | guest_os_name | guest_os_id |
+-----+-----------------+---------------+-------------+
| 193 | KVM | CentOS 5.5 | 111 |
| 194 | KVM | CentOS 5.5 | 112 |
+-----+-----------------+---------------+-------------+
2 rows in set (0.00 sec)
mysql> select * from guest_os where display_name like 'CentOS 5.5%';
+-----+-------------+------+--------------------------------------+---------------------+
| id | category_id | name | uuid |
display_name |
+-----+-------------+------+--------------------------------------+---------------------+
| 111 | 1 | NULL | 3ffadb73-cda1-47a0-bb7a-06dcd52fc05a |
CentOS 5.5 (32-bit) |
| 112 | 1 | NULL | 3ff86514-52f7-40b8-9de6-43abf916ec16 |
CentOS 5.5 (64-bit) |
+-----+-------------+------+--------------------------------------+---------------------+
2 rows in set (0.00 sec)
3. I'm unable to tell whether guest_os derives from
guest_os_hypervisor or vice-versa? From what I understood - guest_os
is a filtered list built off guest_os_hypervisor. Is this correct?
If not - guest_os_hypervisor doesn't contain any foreign keys
referring to guest_os although it uses various ostype ids from that
table. Why is that? Should a foreign key be added?
mysql> show create table guest_os_hypervisor\G
*************************** 1. row ***************************
Table: guest_os_hypervisor
Create Table: CREATE TABLE `guest_os_hypervisor` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`hypervisor_type` varchar(32) NOT NULL,
`guest_os_name` varchar(255) NOT NULL,
`guest_os_id` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=266 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
mysql> show create table guest_os\G
*************************** 1. row ***************************
Table: guest_os
Create Table: CREATE TABLE `guest_os` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`category_id` bigint(20) unsigned NOT NULL,
`name` varchar(255) DEFAULT NULL,
`uuid` varchar(40) DEFAULT NULL,
`display_name` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uc_guest_os__uuid` (`uuid`),
KEY `fk_guest_os__category_id` (`category_id`),
CONSTRAINT `fk_guest_os__category_id` FOREIGN KEY (`category_id`)
REFERENCES `guest_os_category` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=204 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
Thanks,
--
Prasanna.,