擦除APIC配置并重新设置APIC。

wiper的Python项目详细描述


在局域网上通过CIMC串行擦除并重新设置Cisco ACI APIC。

配置参数的选项

选项可以通过cli设置为命令行参数,也可以在使用 -i/-ini文件选项。优先顺序如下:

  1. cli选项覆盖在别处设置的所有选项。
  2. 特定APIC的INI文件选项将覆盖INI文件中指定的默认选项。
  3. 如果默认部分中的ini文件选项不是 在别处指定。
  4. 任何缺少的选项都将导致脚本无法运行。

由于需要的选项太多,强烈建议在ini中设置选项 文件。

以下是所需配置参数表:

Long CLI
Option
Short CLI
Option
INI File
Option
–controller-number-cnucontroller_number
–strong-passwords-spstrong_passwords
–infra-vlan-id-ivinfra_vlan_id
–fabric-name-ffabric_name
–cimc-username-cucimc_username
–controller-name-cnacontroller_name
–apic-admin-password-apapic_admin_password
–bd-mc-addresses-bbd_mc_addresses
–cimc-password-cpcimc_password
–oob-default-gateway-odoob_default_gateway
–int-speed-isint_speed
–oob-ip-address-oioob_ip_address
–tep-address-pool-ttep_address_pool
–number-of-controllers-ncnumber_of_controllers

cli选项

唯一需要的cli选项是用于登录cimc的cimc ip地址。所有其他 也可以通过ini文件设置选项。cli选项覆盖ini文件中设置的相同选项。

雨刮器有以下cli选项:

$ wiper -h
usage: Provision APICs via CIMC Serial Over LAN [-h] [-ap APIC_ADMIN_PASSWORD]
                                                [-b BD_MC_ADDRESSES]
                                                [-cna CONTROLLER_NAME]
                                                [-cnu CONTROLLER_NUMBER]
                                                [-cp CIMC_PASSWORD]
                                                [-cu CIMC_USERNAME]
                                                [-i INI_FILE]
                                                [-is {auto,10baseT/Half,10baseT/Full,100baseT/Half,100baseT/Full,1000baseT/Full}]
                                                [-iv INFRA_VLAN_ID]
                                                [-f FABRIC_NAME]
                                                [-nc NUMBER_OF_CONTROLLERS]
                                                [-od OOB_DEFAULT_GATEWAY]
                                                [-oi OOB_IP_ADDRESS] [-sim]
                                                [-sp {Y,n}]
                                                [-t TEP_ADDRESS_POOL] [-v]
                                                cimc_ip

positional arguments:
    cimc_ip               CIMC hostname or IP address used to ssh to CIMC

optional arguments:
    -h, --help            show this help message and exit
    -ap APIC_ADMIN_PASSWORD, --apic_admin_password APIC_ADMIN_PASSWORD
                          The APIC admin user password to enter into the APIC
                          setup script.
    -b BD_MC_ADDRESSES, --bd-mc-addresses BD_MC_ADDRESSES
                          The Bridge Domain Multicast address range to enter
                          into the APIC setup script.
    -cna CONTROLLER_NAME, --controller-name CONTROLLER_NAME
                          The controller name to enter into the APIC setup
                          script.
    -cnu CONTROLLER_NUMBER, --controller_number CONTROLLER_NUMBER
                          The controller number (id) to enter into the APIC
                          setup script.
    -cp CIMC_PASSWORD, --cimc_password CIMC_PASSWORD
                          CIMC password
    -cu CIMC_USERNAME, --cimc_username CIMC_USERNAME
                          CIMC username
    -i INI_FILE, --ini-file INI_FILE
                          Use an ini file to find parameters to provision an
                          APIC.
    -is {auto,10baseT/Half,10baseT/Full,100baseT/Half,100baseT/Full,1000baseT/Full}, --int-speed {auto,10baseT/Half,10baseT/Full,100baseT/Half,100baseT/Full,1000baseT/Full}
    -iv INFRA_VLAN_ID, --infra-vlan-id INFRA_VLAN_ID
                          The infra vlan id to enter into the APIC setup script.
    -f FABRIC_NAME, --fabric-name FABRIC_NAME
                          The fabric name to enter into the APIC setup script.
    -nc NUMBER_OF_CONTROLLERS, --number-of-controllers NUMBER_OF_CONTROLLERS
                          The number of controllers to enter into the APIC setup
                          script.
    -od OOB_DEFAULT_GATEWAY, --oob-default-gateway OOB_DEFAULT_GATEWAY
                          The APIC Out-Of-Band default gateway to enter into the
                          APIC setup script.
    -oi OOB_IP_ADDRESS, --oob-ip-address OOB_IP_ADDRESS
                          The APIC Out-Of-Band IP address to enter into the APIC
                          setup script.
    -sim, --simulator     This flag identifies the APIC as a simulator.
    -sp {Y,n}, --strong-passwords {Y,n}
                          Strong password option to enter into the APIC setup
                          script.
    -t TEP_ADDRESS_POOL, --tep-address-pool TEP_ADDRESS_POOL
                          The TEP address pool to enter into the APIC setup
                          script.
    -v, --verbose         Enable debugging and be verbose.

INI文件选项

以下是推荐的ini文件:

; These default settings can be modified to allow for different defaults for your environment.
; You can override these defaults in sections for specific controllers.
[DEFAULT]
; Simulators are not currently supported but the plan is to eventually support them if possible
; So this is in preparation of that.
simulator = False
; A default cimc user to access the Serial Over LAN with
cimc_username = admin
; A default cimc password
cimc_password = password
; The default fabric name.
fabric_name = ACI Fabric1
; The default controller number.
controller_number = 1
; The default number of controllers for all clusters.
number_of_controllers = 3
; The default controller name is 'apic' + the controller id.  So for controller 1, the default
; name is apic1.  For controller 2 the default name is apic2, etc.
controller_name = apic%(controller_number)s
; The default tep address pool.
tep_address_pool = 10.0.0.0/16
; The default infra vlan id.
infra_vlan_id = 4093
; The default BD Multicast Address pool
bd_mc_addresses = 225.0.0.0/15
; The default oob ip address and netmask in the firm x.x.x.x/y
oob_ip_address = 192.168.10.1/24
; The default oob default gateway ip address.
oob_default_gateway = 192.168.10.254
; The default interface speed and duplex, we default to auto
int_speed = auto
; By default we require strong passwords
strong_passwords = Y
; A default admin password.  Usually the individual apic configs will override this.
apic_admin_password = p@s$w0rd

; Sections are defined by the cimc ip address, items defined in sections override the default items
[172.16.176.191]
fabric_name = 176_fabric3
cimc_password = Cisco123!
controller_number = 1
oob_ip_address = 172.16.176.192/24
oob_default_gateway = 172.16.176.1
apic_admin_password = Cisco321!

; Multiple CIMC's can be defined in the ini file
[172.16.176.193]
fabric_name = 176_fabric3
cimc_password = Cisco123!
controller_number = 2
oob_ip_address = 172.16.176.194/24
oob_default_gateway = 172.16.176.1
; apic password is not needed for controllers 2 and 3

; Multiple CIMC's can be defined in the ini file
[172.16.176.195]
fabric_name = 176_fabric3
cimc_password = Cisco123!
controller_number = 3
oob_ip_address = 172.16.176.196/24
oob_default_gateway = 172.16.176.1
; apic password is not needed for controllers 2 and 3

很高兴有一个包含默认设置的默认部分,所以所有必需的设置都是 不需要每个控制器。

尽管每次雨刮器只能对一个cimc运行,所以为了擦除/提供三个apic 将需要运行三次雨刮器,每次提供您运行的CIMC。为了 示例:

wiper -i sample.ini 172.16.176.191
wiper -i sample.ini 172.16.176.193
wiper -i sample.ini 172.16.176.195

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
在glassfish3服务器上上载应用程序文件(ords.war)时发生java部署错误   java如何更改Elasticsearch上的别名值?   java如何使用Xpath读取更多XSD模式?   java使用jstl在两个jsp之间访问值   java将控制台输出转换为PDF文件   java在循环后没有得到任何结果,几乎完成   java运行的程序无法适应变化   java 安卓 RecyclerView添加新项目将回收移至列表顶部   将字符串转换为日期时的java偏移量   导入包的java问题   java gl。glScalef()隐藏gl。glDrawArrays()绘图   java在读取URL时没有协议异常   javascript Nashorn错误与某些函数有关