The cost is associated with the Bandwidth statement of the PO interface (or any interface for that matter). It just happens that the BW is automatically adjusted as you add/delete interfaces to the etherchannel which in turn adjusts the cost.
STP path cost used to be linear and calculation was very simple , 1000/Bandwidth in Mbps
As 1 Gbps & 10 Gbps came into picture, path costs have been revised and formula is not availavble (atleast I could not find it). cost are non-linear now.
100 Mbps - 19 and how it is calculated, I donnt know
but as far as your query on etherchannel goes, my understanding is that when you configure etherchannel, it is because you need more bandwidth and you wonnt just add & delete the member ports daily. So you should statically define the path cost for etherchannel.
Even in case of failure, I will prefer STP to stay silent and donnt recalculate, even if I have redundant path of higher bandwidth.
Because end of the day I end up having STP recalulating the best L2 path twice, first when one of the port of my primary etherchannel went down and second when it came up. If I fix the issue with primary ethernerchannel port, there will be no STP convergence.
** There could be the extreme case when performance is badly hampered when one of the port went bad in an etherchannel, even then one should prefer manual intervention.
Cisco says this
Calculating the Port Cost for Aggregate Links
As individual links are added or removed from an aggregate link (port bundle), the bandwidth of the aggregate link increases or decreases. These changes in bandwidth lead to recalculation of the default port cost for the aggregated port. Changes to the default port cost or changes resulting from links that autonegotiate their bandwidth could lead to recalculation of the spanning tree topology which may not be desirable, especially if the added or removed link is of little consequence to the bandwidth of the aggregate link (for example, if a 10-Mbps link is removed from a 10-Gbps aggregate link). Because of the limitations that are presented by automatically recalculating the topology, 802.1t states that changes in bandwidth will not result in changes to the cost of the port. Therefore, the aggregated port will use the same port cost parameters as a standalone port.
We are pleased to announce availability of Beta software for 16.6.3.
16.6.3 will be the second rebuild on the 16.6 release train targeted
towards Catalyst 9500/9400/9300/3850/3650 switching platforms. We are
looking for early feedback from customers befor...
Introduction Featured Speakers Luis Espejel is the Telecommunications
Manager of IENova, an Oil & Gas company. Currently he works with Cisco
IOS® and Cisco IOS XE platforms, and NX to some extent. He has also
worked as a Senior Engineer with the Routing P...
In this session you can learn more about Layer 3 multicast and the best
practices to identify possible threats and take security measures. It
provides an overview of basic multicast, the best security practices for
use of this technology, and recommendati...