创建ironic node + 裸金属
1、创建ironic node
IPMI_ADDRESS=10.10.XX.186
NAME=node186
openstack baremetal node create --driver ipmi --name ${NAME} \
--driver-info ipmi_port=623 \
--driver-info ipmi_username=admin \
--driver-info ipmi_password='admin' \
--driver-info ipmi_address=${IPMI_ADDRESS} \
--inspect-interface no-inspect \
--resource-class baremetal-XX\
--property cpus=64 \
--property memory_mb=524288 \
--property cpu_arch=aarch64 \
--property capabilities='boot_mode:uefi' \
--property root_device='{"name": "/dev/sda"}' \
--driver-info deploy_kernel=34fb179c-54b1-4e3e-b63c-5b7ee35174b7\
--driver-info deploy_ramdisk=14dc5e08-bbe2-4c30-aff1-6efe9c2a60f4\
--driver-info ipmi_protocol_version=2.0\
1.2 设置node状态为available 和创建port
uuid=d1e92147-03d9-4598-b1cf-4ebd87580ffd
openstack baremetal node manage ${uuid}
openstack baremetal node validate ${uuid}
openstack baremetal node provide ${uuid}
##openstack baremetal node set ${uuid} --property capabilities=profile:compute,boot_mode:uefi
##openstack baremetal port create 48:57:02:64:E7:AC --node ${uuid}
##openstack baremetal node set ${uuid} --property cpu_arch=aarch64
##openstack baremetal node set ${uuid} --property cpus=64
##ironic node-update ${uuid} add \
##properties/local_gb=34 \
##properties/memory_mb=256910 \
##properties/root_device='{"name": "/dev/sdc"}' \
##openstack baremetal node set ${uuid} \
--network-interface neutron
HW_MAC_ADDRESS=48:57:02:64:E7:AD
SWITCH_MAC_ADDRESS=48:57:02:64:ea:1b
SWITCH_HOSTNAME=localhost.localdomain
SWITCH_PORT=tapd46ec11c-01
openstack baremetal port create $HW_MAC_ADDRESS --node ${uuid} \
--local-link-connection switch_id=$SWITCH_MAC_ADDRESS \
--local-link-connection switch_info=$SWITCH_HOSTNAME \
--local-link-connection port_id=$SWITCH_PORT \
--pxe-enabled true
2、创建flavor
openstack flavor create --ram 524288 --vcpus 64 huawei916
openstack flavor set huawei916 --property resources:CUSTOM_BAREMETAL_XX=1 --property tag=baremetal
3、创建裸金属
nova boot --flavor huawei916 --image NeoKylin-Server-baremetal\
--security-group default --key-name ssh_key kunpeng82 \
--nic net-id=e00c4e3a-3634-4c59-8ce9-c09221cf684b
#!/bin/bash # to be executed inside operator pod export OS_TOKEN=fake-token export OS_URL=http://openstack-ironic:6385 openstack baremetal node list # TODO: retrieve right ipmi creds export NODE_IPMI_ADDRESS="192.168.126.1" export NODE_IPMI_USERNAME="admin" export NODE_IPMI_PASSWORD="password" export NODE_IPMI_PORT=6232 export NODE_PXE_MAC="pxe:mac:address" export IMAGES_SERVER="ip-from-server" export DEPLOY_KERNEL="http://$IMAGES_SERVER/ironic-python-agent.kernel" export DEPLOY_RAMDISK="http://$IMAGES_SERVER/ironic-python-agent.initramfs" openstack baremetal node create --driver ipmi --driver-info ipmi_address=$NODE_IPMI_ADDRESS \ --driver-info ipmi_username=$NODE_IPMI_USERNAME \ --driver-info ipmi_password=$NODE_IPMI_PASSWORD \ --driver-info ipmi_port=$NODE_IPMI_PORT \ --driver-info deploy_kernel=$DEPLOY_KERNEL \ --driver-info deploy_ramdisk=$DEPLOY_RAMDISK # TODO: properly retrieve generated node uuid export NODE_UUID=dummy_uuid export IMAGE_SUM=md5sum /path/to/rhcos-openstack.qcow2 openstack baremetal port create $NODE_PXE_MAC --node $NODE_UUID openstack baremetal node set $NODE_UUID \ --instance-info image_source=http://$IMAGES_SERVER/rhcos-openstack.qcow2 \ --instance-info root_gb=20 \ --instance-info image_checksum=$IMAGE_SUM openstack baremetal node validate $NODE_UUID openstack baremetal node manage $NODE_UUID openstack baremetal node provide $NODE_UUID # now generate config drive mkdir -p /tmp/config-drive/openstack/latest curl http://$IMAGES_SERVER/artifacts/stable_ignition/dummy.ign -o user_data yum install -y genisoimage # we may need this dep # and now deploy openstack baremetal node deploy $NODE_UUID --config-drive /tmp/config-drive/