[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-1804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13614944#comment-13614944
 ] 

Marcus Sorensen commented on CLOUDSTACK-1804:
---------------------------------------------

I have no idea if this is correct, but I took a guess and added:

alter table network_offerings add column eip_associate_public_ip 
enum('true','false');

to setup/db/db/schema-40to410.sql, and now fresh update from 4.0 to 4.1 works 
(barring the previously mentioned issues). Here's what I've done:

install 4.1 RPMs onto existing 4.0 management server

cp /etc/cloud/management/db.properties.rpmsave 
/etc/cloudstack/management/db.properties
chown cloud:cloud /etc/cloudstack/management/db.properties
cp /etc/cloud/management/key /etc/cloudstack/management/key

edit /usr/share/cloudstack-management/setup/db/schema-40to410.sql adding alter 
table line
run cloudstack-setup-management (this fixes up the tomcat and other mgmt 
configs, could probably be done by copying files around. It also starts the 
mgmt server and kicks off the upgrades)

If nobody else gets to it, I'll look at changing cloud.spec to account for some 
of these things tomorrow, but I'd appreciate input on the sql table column 
issue.


                
> Upgrade 4.0 -> 4.1 - DB upgrade fails.
> --------------------------------------
>
>                 Key: CLOUDSTACK-1804
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-1804
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: Management Server
>    Affects Versions: 4.1.0
>         Environment: Upgrade from 4.0 - > 4.1
>            Reporter: Sangeetha Hariharan
>            Assignee: Jayapal Reddy
>            Priority: Blocker
>             Fix For: 4.1.0
>
>         Attachments: Upgrade-4.0-4.1.rar
>
>
> 1. Install and configure 4.0 setup 
> 2. Create 4.1 repo and update the packages to 4.1 
> 3. Tried to start Management server. 
> Management server fails to start. 
> To proceed further , I had to do the following steps manually: 
> Issue1 : Failed to start management server as there is no tomcat6.conf file 
> Resolved: Created a copy of tomcat6-nonssl.conf to tomcat6.conf 
> Issue2 : Failed to start MS as there is no server.xml 
> Resolved: Created a copy of server-nonssl.xml to server.xml 
> Issue3: Failed to start MS as connection to DB failed. 
> Resolved this issue by copying the original db.properties (which used to be 
> in /etc/cloud/management/db.properties .It is removed as part of upgrade) to 
> /etc/cloudstack/management/db.properties. 
> After this we see the management server starts. 
> But we see the version in DB is still at 4.0. 
> Also we are able to log in to the management server as admin user but we are 
> not presented with the dashboard view and user is presented with the 
> following error message - "The given command does not exist or it is not 
> available for user" 
> 013-03-25 13:40:13,470 INFO [cloud.api.ApiServer] (catalina-exec-19:null) 
> (userId=2 accountId=2 sessionId=477A36D68C43BF607B120C101BAC9394) 
> 10.216.132.72 -- POST command=login domain=/ 
> 2013-03-25 13:40:13,530 INFO [cloud.api.ApiServer] (catalina-exec-18:null) 
> 10.216.132.72 -- GET 
> command=listCapabilities&response=json&sessionkey=j1yRhgpqVLP55aACJc1tnMvsgoo%3D&_=1364244047351
>  432 The given command does not exist or it is not available for user 
> 2013-03-25 13:40:13,552 INFO [cloud.api.ApiServer] (catalina-exec-5:null) 
> 10.216.132.72 -- GET 
> command=listSwifts&response=json&sessionkey=j1yRhgpqVLP55aACJc1tnMvsgoo%3D&_=1364244047413
>  432 The given command does not exist or it is not available for user 
> mysql> select * from version; 
> +----+----------------------+---------------------+----------+ 
> | id | version | updated | step | 
> +----+----------------------+---------------------+----------+ 
> | 1 | 4.0.0.20130314045651 | 2013-03-25 10:54:37 | Complete | 
> +----+----------------------+---------------------+----------+ 
> 1 row in set (0.00 sec) 
> From management server , we see upgrade scripts being executed , but there is 
> a rollback that happens during the upgrade process that indicates a failure 
> in upgrade procedure. No sql exceptions seen during the upgrade steps. 
> 2013-03-25 13:26:03,427 DEBUG [utils.db.ScriptRunner] (Timer-1:null) -- 
> Schema upgrade from 4.0.0 to 4.1.0; 
> 2013-03-25 13:26:03,427 DEBUG [utils.db.ScriptRunner] (Timer-1:null) --; 
> 2013-03-25 13:26:03,427 DEBUG [utils.db.ScriptRunner] (Timer-1:null) use 
> cloud 
> 2013-03-25 13:26:03,429 DEBUG [utils.db.ScriptRunner] (Timer-1:null) SET 
> foreign_key_checks = 0 
> 2013-03-25 13:26:03,430 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table vm_template add size bigint unsigned 
> 2013-03-25 13:26:03,602 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table vm_template add state varchar(255) 
> 2013-03-25 13:26:03,638 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table vm_template add update_count bigint unsigned 
> 2013-03-25 13:26:03,659 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table vm_template add updated datetime 
> 2013-03-25 13:26:03,673 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table storage_pool add storage_provider_id bigint unsigned 
> 2013-03-25 13:26:03,728 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table storage_pool add scope varchar(255) 
> 2013-03-25 13:26:03,755 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table storage_pool modify id bigint unsigned AUTO_INCREMENT UNIQUE NOT NULL 
> 2013-03-25 13:26:03,766 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table template_spool_ref add state varchar(255) 
> 2013-03-25 13:26:03,778 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table template_spool_ref add update_count bigint unsigned 
> 2013-03-25 13:26:03,788 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table volumes add disk_type varchar(255) 
> 2013-03-25 13:26:03,824 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table volumes drop foreign key `fk_volumes__account_id` 
> 2013-03-25 13:26:03,858 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table vm_instance add column disk_offering_id bigint unsigned 
> 2013-03-25 13:26:03,920 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table vm_instance add column cpu int(10) unsigned 
> 2013-03-25 13:26:03,942 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table vm_instance add column ram bigint unsigned 
> 2013-03-25 13:26:03,955 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table vm_instance add column owner varchar(255) 
> 2013-03-25 13:26:03,968 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table vm_instance add column speed int(10) unsigned 
> 2013-03-25 13:26:03,980 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table vm_instance add column host_name varchar(255) 
> 2013-03-25 13:26:03,997 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table vm_instance add column display_name varchar(255) 
> 2013-03-25 13:26:04,031 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table vm_instance add column `desired_state` varchar(32) NULL 
> 2013-03-25 13:26:04,047 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table data_center add column owner varchar(255) 
> 2013-03-25 13:26:04,424 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table data_center add column created datetime COMMENT 'date created' 
> 2013-03-25 13:26:04,438 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table data_center add column lastUpdated datetime COMMENT 'last updated' 
> 2013-03-25 13:26:04,448 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table data_center add column engine_state varchar(32) NOT NULL DEFAULT 
> 'Disabled' CO 
> MMENT 'the engine state of the zone' 
> 2013-03-25 13:26:04,459 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table host_pod_ref add column owner varchar(255) 
> 2013-03-25 13:26:04,526 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table host_pod_ref add column created datetime COMMENT 'date created' 
> 2013-03-25 13:26:04,536 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table host_pod_ref add column lastUpdated datetime COMMENT 'last updated' 
> 2013-03-25 13:26:04,548 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table host_pod_ref add column engine_state varchar(32) NOT NULL DEFAULT 
> 'Disabled' C 
> OMMENT 'the engine state of the zone' 
> 2013-03-25 13:26:04,562 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table host add column owner varchar(255) 
> 2013-03-25 13:26:04,587 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table host add column lastUpdated datetime COMMENT 'last updated' 
> 2013-03-25 13:26:04,600 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table host add column engine_state varchar(32) NOT NULL DEFAULT 'Disabled' 
> COMMENT ' 
> the engine state of the zone' 
> 2013-03-25 13:26:04,612 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table cluster add column owner varchar(255) 
> 2013-03-25 13:26:04,665 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table cluster add column created datetime COMMENT 'date created' 
> 2013-03-25 13:26:04,676 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table cluster add column lastUpdated datetime COMMENT 'last updated' 
> 2013-03-25 13:26:04,688 DEBUG [utils.db.ScriptRunner] (Timer-1:null) alter 
> table cluster add column engine_state varchar(32) NOT NULL DEFAULT 'Disabled' 
> COMMEN 
> T 'the engine state of the zone' 
> 2013-03-25 13:26:04,701 DEBUG [utils.db.ScriptRunner] (Timer-1:null) CREATE 
> TABLE `cloud`.`vm_compute_tags` ( `id` bigint unsigned NOT NULL 
> AUTO_INCREMENT CO 
> MMENT 'id', `vm_id` bigint unsigned NOT NULL COMMENT 'vm id', `compute_tag` 
> varchar(255) NOT NULL COMMENT 'name of tag', PRIMARY KEY(`id`) ) ENGINE=InnoD 
> B DEFAULT CHARSET=utf8 
> 2013-03-25 13:26:04,715 DEBUG [utils.db.ScriptRunner] (Timer-1:null) CREATE 
> TABLE `cloud`.`vm_root_disk_tags` ( `id` bigint unsigned NOT NULL 
> AUTO_INCREMENT 
> COMMENT 'id', `vm_id` bigint unsigned NOT NULL COMMENT 'vm id', 
> `root_disk_tag` varchar(255) NOT NULL COMMENT 'name of tag', PRIMARY 
> KEY(`id`) ) ENGINE=I 
> nnoDB DEFAULT CHARSET=utf8 
> 2013-03-25 13:26:04,719 DEBUG [utils.db.ScriptRunner] (Timer-1:null) CREATE 
> TABLE `cloud`.`vm_network_map` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT 
> COM 
> MENT 'id', `vm_id` bigint unsigned NOT NULL COMMENT 'vm id', `network_id` 
> bigint unsigned NOT NULL COMMENT 'network id', PRIMARY KEY(`id`) ) 
> ENGINE=InnoD 
> B DEFAULT CHARSET=utf8 
> ................ 
> ................ 
> 2013-03-25 13:26:06,022 DEBUG [utils.db.ScriptRunner] (Timer-1:null) SET 
> foreign_key_checks = 1 
> 2013-03-25 13:26:06,022 DEBUG [upgrade.dao.Upgrade40to41] (Timer-1:null) 
> Updating region table with Id: 1 
> 2013-03-25 13:26:06,033 DEBUG [db.Transaction.Transaction] (Timer-1:null) 
> Rolling back the transaction: Time = 2630 Name = Upgrade; called by 
> -Transaction.rollback:890-Transaction.removeUpTo:833-Transaction.close:657-DatabaseUpgradeChecker.upgrade:263-DatabaseUpgradeChecker.check:358-NativeMethodAccessorImpl.invoke0:-2-NativeMethodAccessorImpl.invoke:57-DelegatingMethodAccessorImpl.invoke:43-Method.invoke:616-AopUtils.invokeJoinpointUsingReflection:319-ReflectiveMethodInvocation.invokeJoinpoint:183-ReflectiveMethodInvocation.proceed:150
>  
> 2013-03-25 13:26:13,390 INFO [utils.component.ComponentContext] (main:null) 
> Configuring com.cloud.bridge.persist.dao.CloudStackAccountDaoImpl 
> 2013-03-25 13:26:13,402 INFO [utils.db.GenericDaoBase] (main:null) Register 
> dao interface in GenericDaoBase entity-DAO map. 
> com.cloud.bridge.persist.dao.CloudStackAccountDao 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to