Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5AABD200BE9 for ; Mon, 26 Dec 2016 12:25:24 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 594E1160B3B; Mon, 26 Dec 2016 11:25:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7CA7D160B2A for ; Mon, 26 Dec 2016 12:25:23 +0100 (CET) Received: (qmail 34767 invoked by uid 500); 26 Dec 2016 11:25:17 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 34755 invoked by uid 99); 26 Dec 2016 11:25:17 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Dec 2016 11:25:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 496A9DFB93; Mon, 26 Dec 2016 11:25:17 +0000 (UTC) From: sudhansu7 To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org Message-ID: Subject: [GitHub] cloudstack pull request #1869: CLOUDSTACK-9701: When host is disabled/remove... Content-Type: text/plain Date: Mon, 26 Dec 2016 11:25:17 +0000 (UTC) archived-at: Mon, 26 Dec 2016 11:25:24 -0000 GitHub user sudhansu7 opened a pull request: https://github.com/apache/cloudstack/pull/1869 CLOUDSTACK-9701: When host is disabled/removed, capacity_type for loc… …al storage in op_host_capacity is still enabled Description ========= When a host is disabled or removed, local storage related capacity data for the corresponding local storage of the host is still in enabled state. This may not directly impact deploy VM functionality (for example) but it does show incorrect capacity calculations. Steps ===== 1. Enable local storage for zone 2. Disable host or remove host (after adding it to maintenance mode) 3. Check op_host_capacity (capacity_state=9) In either of the cases, the local storage related capacity is still enabled for the host. ``` mysql> select id, name, uuid, status,resource_state, type, removed from host where type = 'Routing'; +----+--------------------+--------------------------------------+--------+----------------+---------+---------+ | id | name | uuid | status | resource_state | type | removed | +----+--------------------+--------------------------------------+--------+----------------+---------+---------+ | 1 | xenserver-nvjxksqs | 16a922d0-7b4c-4c84-baad-5bd91542181c | Up | Disabled | Routing | NULL | | 4 | xenserver-hnkwhblp | 0e0f161a-7cf5-4e44-8bcc-a25ba7d798e5 | Up | Enabled | Routing | NULL | +----+--------------------+--------------------------------------+--------+----------------+---------+---------+ 2 rows in set (0.00 sec) mysql> select host_id, used_capacity, reserved_capacity, total_capacity, capacity_type, capacity_state from op_host_capacity where capacity_type=9; +---------+---------------+-------------------+----------------+---------------+----------------+ | host_id | used_capacity | reserved_capacity | total_capacity | capacity_type | capacity_state | +---------+---------------+-------------------+----------------+---------------+----------------+ | 3 | 4194304 | 0 | 491505319936 | 9 | Enabled | | 4 | 4194304 | 0 | 491505319936 | 9 | Enabled | +---------+---------------+-------------------+----------------+---------------+----------------+ 2 rows in set (0.00 sec) mysql> select id, name, removed, pool_type, capacity_bytes from storage_pool where id in (3,4); +----+----------------------------------+---------+-----------+----------------+ | id | name | removed | pool_type | capacity_bytes | +----+----------------------------------+---------+-----------+----------------+ | 3 | xenserver-nvjxksqs Local Storage | NULL | LVM | 491505319936 | | 4 | xenserver-hnkwhblp Local Storage | NULL | LVM | 491505319936 | +----+----------------------------------+---------+-----------+----------------+ mysql> select host_id, used_capacity, reserved_capacity, total_capacity, capacity_type, capacity_state from op_host_capacity where capacity_type in (0,1,3,9); +---------+---------------+-------------------+----------------+---------------+----------------+ | host_id | used_capacity | reserved_capacity | total_capacity | capacity_type | capacity_state | +---------+---------------+-------------------+----------------+---------------+----------------+ | 1 | 1342177280 | 0 | 15721585024 | 0 | Disabled | | 1 | 1000 | 0 | 12400 | 1 | Disabled | | 1 | 119954444288 | 0 | 11804569632768 | 3 | Enabled | | 4 | 2013265920 | 0 | 15721585024 | 0 | Enabled | | 4 | 2600 | 0 | 12400 | 1 | Enabled | | 2 | 0 | 0 | 11804569632768 | 3 | Enabled | | 3 | 4194304 | 0 | 491505319936 | 9 | Disabled | | 4 | 4194304 | 0 | 491505319936 | 9 | Enabled | +---------+---------------+-------------------+----------------+---------------+----------------+ 8 rows in set (0.00 sec) ``` After fix: ``` mysql> select host_id, used_capacity, reserved_capacity, total_capacity, capacity_type, capacity_state from op_host_capacity where capacity_type in (0,1,3,9); +---------+---------------+-------------------+----------------+---------------+----------------+ | host_id | used_capacity | reserved_capacity | total_capacity | capacity_type | capacity_state | +---------+---------------+-------------------+----------------+---------------+----------------+ | 1 | 1342177280 | 0 | 15721585024 | 0 | Disabled | | 1 | 1000 | 0 | 12400 | 1 | Disabled | | 1 | 119954444288 | 0 | 11804569632768 | 3 | Enabled | | 4 | 2013265920 | 0 | 15721585024 | 0 | Enabled | | 4 | 2600 | 0 | 12400 | 1 | Enabled | | 2 | 0 | 0 | 11804569632768 | 3 | Enabled | | 3 | 4194304 | 0 | 491505319936 | 9 | Disabled | | 4 | 4194304 | 0 | 491505319936 | 9 | Enabled | +---------+---------------+-------------------+----------------+---------------+----------------+ 8 rows in set (0.00 sec) ``` You can merge this pull request into a Git repository by running: $ git pull https://github.com/sudhansu7/cloudstack CLOUDSTACK-9701 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cloudstack/pull/1869.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1869 ---- commit 7491032be7258a276c8a988c72f6ff0cdc8d986e Author: Sudhansu Date: 2016-12-23T10:31:21Z CLOUDSTACK-9701: When host is disabled/removed, capacity_type for local storage in op_host_capacity is still enabled ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---