Allow NetworkManagerImpl and SecondaryStorageImpl to tolerate missing of system vm template at startup

This commit is contained in:
Kelven Yang 2010-08-26 16:47:16 -07:00
parent d36227986a
commit 7eb61b705a
3 changed files with 4 additions and 8 deletions

View File

@ -1830,7 +1830,9 @@ public class NetworkManagerImpl implements NetworkManager, VirtualMachineManager
_offering = _serviceOfferingDao.persistSystemServiceOffering(_offering); _offering = _serviceOfferingDao.persistSystemServiceOffering(_offering);
_template = _templateDao.findById(_routerTemplateId); _template = _templateDao.findById(_routerTemplateId);
if (_template == null) { if (_template == null) {
throw new ConfigurationException("Unable to find the template for the router: " + _routerTemplateId); s_logger.error("Unable to find system vm template.");
// throw new ConfigurationException("Unable to find the template for the router: " + _routerTemplateId);
} }
_publicNetworkOffering = new NetworkOfferingVO(NetworkOfferingVO.SystemVmPublicNetwork, TrafficType.Public, null); _publicNetworkOffering = new NetworkOfferingVO(NetworkOfferingVO.SystemVmPublicNetwork, TrafficType.Public, null);

View File

@ -1370,7 +1370,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
_serviceOffering.setUniqueName("Cloud.com-SecondaryStorage"); _serviceOffering.setUniqueName("Cloud.com-SecondaryStorage");
_serviceOffering = _offeringDao.persistSystemServiceOffering(_serviceOffering); _serviceOffering = _offeringDao.persistSystemServiceOffering(_serviceOffering);
_template = _templateDao.findConsoleProxyTemplate(); _template = _templateDao.findConsoleProxyTemplate();
if (_template == null) { if (_template == null && _useServiceVM) {
throw new ConfigurationException("Unable to find the template for secondary storage vm VMs"); throw new ConfigurationException("Unable to find the template for secondary storage vm VMs");
} }

View File

@ -1,9 +1,3 @@
INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones)
VALUES (1, 'routing', 'SystemVM Template', 0, now(), 'ext3', 0, 64, 1, 'http://nfs1.lab.vmops.com/templates/vmware/dummydomr.tar.bz2', '54c578d2c02759de4a9a8be7bd533df1', 0, 'SystemVM Template', 'VMDK', 47, 0, 1);
INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones)
VALUES (2, 'fedora11-x86', 'Fedora11-x86', 1, now(), 'ext3', 0, 32, 1, 'http://nfs1.lab.vmops.com/templates/vmware/fedora11-x86.tar.bz2', '7957ff05cae838689eb53c7600b2fbe4', 0, 'Fedora 11 x86', 'VMDK', 47, 1, 1);
INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (1, 'Windows'); INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (1, 'Windows');
INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (2, 'Linux'); INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (2, 'Linux');
INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (3, 'Novell Netware'); INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (3, 'Novell Netware');