zoukankan      html  css  js  c++  java
  • OpenStack命令工具整理

    文件批量复制

    cat allrpm.txt |while read name ;do cp -a /mnt/Packages/$name.rpm /root/orgin/ ;done

    批量删除云主机

    source ~/keystonerc_admin
    
    a=`nova list |grep '[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12}' -o`
    for b in $a
    do
        echo $b
        nova force-delete $b
        #nova delete $b
    done

    设置安全组规则(Nova-network)

    source ~/keystonerc_admin
    
    nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0
    
    nova secgroup-add-rule default udp 1 65535 0.0.0.0/0
    
    nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0

    设置安全组规则(Neutron)

    source ~/keystonerc_admin
    
    a=`neutron security-group-rule-list |grep '[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12}' -o`
    
    for b in $a
    do
        neutron security-group-rule-delete $b
    done
    
    a1=`neutron security-group-list |grep '[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12}' -o`
    
    for b1 in $a1
    do
        neutron security-group-rule-create --protocol tcp --port-range-min 1 --port-range-max 65535 --direction ingress $b1
    
        neutron security-group-rule-create --protocol udp --port-range-min 1 --port-range-max 65535 --direction ingress $b1
    
        neutron security-group-rule-create --protocol icmp --direction ingress $b1
    
        neutron security-group-rule-create --protocol icmp --direction egress $b1
    done

    上传镜像(Icehouse)

    source /root/keystonerc_admin
    
    glance image-create --name cirros --file cirros-0.3.1-x86_64-disk.img --disk-format qcow2 --container-format bare --is-public True --progress

    上传镜像(Mitaka)

    source /root/keystonerc_admin
    
    glance image-create --name cirros --file cirros-0.3.1-x86_64-disk.img --disk-format qcow2 --container-format bare --progress

    创建网络(Neutron)

    source ~/keystonerc_admin
    
    neutron net-create private
    
    neutron subnet-create private 172.16.1.0/24 --name private_subnet --dns-nameserver 223.5.5.5
    
    neutron router-create router1
    
    neutron router-interface-add router1 private_subnet
    
    neutron net-create public --router:external
    
    neutron subnet-create public 10.0.0.0/24 --name public_subnet --enable_dhcp=False --allocation_pool start=10.0.0.100,end=10.0.0.200 --gateway 10.0.0.1
    
    neutron router-gateway-set router1 public
    
    neutron floatingip-create public
  • 相关阅读:
    scrapy(二)内容获取
    scrapy(一)建立一个scrapy项目
    scrapy(四)使用redis
    scrapy(三)使用mongoDB
    索引处的解码字符串
    Golang竞争状态
    Golang之泛型编程-细节
    区块链学这个就够了-DLT(一)
    Linux日志分析-Ubuntu(一)
    经典博弈-int
  • 原文地址:https://www.cnblogs.com/liboo/p/13550924.html
Copyright © 2011-2022 走看看