|
1 | | -/* |
2 | | - * // Licensed to the Apache Software Foundation (ASF) under one |
3 | | - * // or more contributor license agreements. See the NOTICE file |
4 | | - * // distributed with this work for additional information |
5 | | - * // regarding copyright ownership. The ASF licenses this file |
6 | | - * // to you under the Apache License, Version 2.0 (the |
7 | | - * // "License"); you may not use this file except in compliance |
8 | | - * // with the License. You may obtain a copy of the License at |
9 | | - * // |
10 | | - * // http://www.apache.org/licenses/LICENSE-2.0 |
11 | | - * // |
12 | | - * // Unless required by applicable law or agreed to in writing, |
13 | | - * // software distributed under the License is distributed on an |
14 | | - * // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
15 | | - * // KIND, either express or implied. See the License for the |
16 | | - * // specific language governing permissions and limitations |
17 | | - * // under the License. |
18 | | - */ |
| 1 | +// Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +// or more contributor license agreements. See the NOTICE file |
| 3 | +// distributed with this work for additional information |
| 4 | +// regarding copyright ownership. The ASF licenses this file |
| 5 | +// to you under the Apache License, Version 2.0 (the |
| 6 | +// "License"); you may not use this file except in compliance |
| 7 | +// with the License. You may obtain a copy of the License at |
| 8 | +// |
| 9 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +// |
| 11 | +// Unless required by applicable law or agreed to in writing, |
| 12 | +// software distributed under the License is distributed on an |
| 13 | +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +// KIND, either express or implied. See the License for the |
| 15 | +// specific language governing permissions and limitations |
| 16 | +// under the License. |
19 | 17 |
|
20 | 18 | package com.cloud.upgrade.dao; |
21 | 19 |
|
@@ -172,7 +170,7 @@ private void updateSystemVmTemplates(final Connection conn) { |
172 | 170 | } |
173 | 171 | // update template ID of system Vms |
174 | 172 | try (PreparedStatement update_templ_id_pstmt = conn |
175 | | - .prepareStatement("update `cloud`.`vm_instance` set vm_template_id = ? where type <> 'User' and hypervisor_type = ?");) { |
| 173 | + .prepareStatement("update `cloud`.`vm_instance` set vm_template_id = ? where type <> 'User' and hypervisor_type = ? and removed is NULL");) { |
176 | 174 | update_templ_id_pstmt.setLong(1, templateId); |
177 | 175 | update_templ_id_pstmt.setString(2, hypervisorAndTemplateName.getKey().toString()); |
178 | 176 | update_templ_id_pstmt.executeUpdate(); |
|
0 commit comments