- 积分
- 16844
在线时间 小时
最后登录1970-1-1
|

楼主 |
发表于 2022-10-20 14:57:20
|
显示全部楼层
Nova:9 g" J7 v9 [6 E6 ?- J
List of instances2 ^- ]: l1 j8 Y* W( O/ d+ r7 _
1
% Z: z( ]! p7 z( A( {, i( E6 sopenstack server list4 K/ v( n$ {# J
2
3 ?9 g0 H6 v1 Y& |, e5 Rnova list; D v: p* l5 d
Details on a specific instance
) x1 A, `8 h: w! m1
c5 m! B4 k# W, Y* s @openstack server show <server id>
6 I1 K% W4 t) Z2
( [. x* j Y8 J0 `; T) G" fnova show <server id>. V4 M* E+ H% z D
Rebuild an instance
0 @, X; J8 V# P0 o1 O* o1 R2 c0 S# ~$ ?1+ ?5 R: w }! f8 t
openstack server rebuild --image <image-id> <server-id>
( g* q: M7 \0 d. r' U$ t2
L& O: m3 R7 {; X: w# k, ]! `/ vnova rebuild <server-id> <image-id>! ]* b# c3 c7 S( H% b
Rebuild an instance with metadata
7 O6 X* O8 R6 S0 \1$ T& v3 B4 |% ^0 N/ d0 ~& P
openstack server set --property <meta> <server-id>
% `" J0 o8 \+ i- Y2
7 ?9 l" z9 a1 F4 lnova meta <server-id> set <meta>
5 L( y9 \: a% S3" N/ W' D/ z2 N/ K) ]# u
nova rebuild --meta <meta> <server-id> <image-id>
, K' H" C m8 x& u# B2 ^Attach a port to an instance
% U+ D5 g0 q: U& n! q1# F5 p; r0 o/ q; C2 f3 Z
nova interface-attach --port-id <port id> <instance id>- A( t0 ~7 g0 h6 v4 [% O5 p, U
Create a instance from a availability zone4 Z. a; O+ H. z q8 R
1
8 L8 K$ d3 z/ x8 V6 qnova boot --availability-zone nova:metal01:<ironic-id> --flavor <flavor-id> --image <img-id> --nic net-id=<network id>,v4-fixed-ip=<ip-address> <name>. W7 _7 z" G7 |, k n
20 ^3 E* S' W- \2 b" v, O K
openstack server create --availability-zone nova:metal01:<ironic-id> --flavor <flavor-id> --image <img-id> --nic net-id=<network id>,v4-fixed-ip=<ip-address> <name>$ d5 ?. e8 P9 c" z& N' a
Create a instance with meta property, sec group, fixed ip, ssh-key( ]/ f4 W9 [0 n k* l
1 W) |, g! J/ C5 m, ?, m% `( ?
openstack server create --image <image id> --flavor <flavor id> --nic net-id=<network id>,v4-fixed-ip=<ip-address> --property <meta-data> --security-group <security group id> --key-name <keypair name> vmname
+ D$ G7 z0 n: @9 V7 G a( DCreate a instance0 f) a& U3 _- c1 x0 e4 | d& x
18 W5 } Y D d& g3 l" d
openstack server create --image <image id> --flavor <flavor id> vmname% ^1 z' w8 O3 X
Remove error state from instance 7 k8 _- g6 S. K; Q. A/ p0 z
1
" }$ v% z T4 q, C& Inova reset-state --active <server-id>- K& o( F0 z) o, n) d0 n
Change the flavour (resize)
g! S9 w% L- u$ {1
1 g8 d7 F8 g* X- l7 Sopenstack server resize --flavor <flavor> <ID>
/ a8 A9 }% ^! bNeutron:
0 T" M# J4 p+ D9 TList of subnets and network ID
- ^6 T( t4 e. n0 p; I1
, Q! U3 Y$ L6 |. h/ Z2 L8 Ropenstack network list
6 P8 E) h0 P) P6 ~0 M2, U5 f) `+ q: B1 x% `# ^( ?% g
neutron net-list
7 a$ V: Y) f4 d+ x0 [, U. bList of subnets, their IDs and allocation pools:
2 T: I6 o3 S% l1 _" K6 g1- ~( u1 [* {" H7 T! @# }
openstack subnet list
6 R4 _0 U5 f2 j# t9 i" ]: Q2
: X# P0 G1 w% N% V0 O* J; ^+ I; Eneutron subnet-list
/ a' U0 K. n& b: \List ports+ J8 X" {! M1 @# o7 o' r+ B
1
, N0 s9 c9 \' b, n+ K: D9 Nopenstack port list
( M$ V) V) F% w5 o- Z; x0 c0 T$ A. w! L5 I23 P+ `) ]; w1 m7 v' s5 E- x
neutron port-list
( ~; l8 t4 g$ \. P& f! f0 _Create port
3 t7 ?' W$ k8 M. e- `* B$ J) W1- ^- B& m8 ` d+ J( t
openstack port create --network <network id> --fixed-ip subnet=<subnet id>,ip-address=<ip-address>
# r! a9 {# C6 q4 [3 t* Z2
. H8 k0 P4 o2 Y$ O. s/ Uneutron port-create --fixed-ip subnet_id=<subnet id>,ip_address=<X.X.X.X> <network id> <name>" c: n$ M; l) y, b, n
Update or Set/Unset port9 }" {6 p m# S7 t
1! I; @& l8 C0 u" T) y% N: ?, R
neutron port-update --fixed-ip subnet_id=<subnet id>,ip_address=<ip-address> --fixed-ip subnet_id=<subnet id>,ip_address=<X.X.X.X> <port id>+ Q: K& _4 X# p
2
7 Q4 {. _. g7 Dopenstack port set --fixed-ip subnet=<subnet>,ip-address=<ip-address> <port id>9 ~2 J6 w$ c" Z4 ]2 z) z& c, m
3
. F+ ]. h( R0 k! ]6 Z6 f) Z/ b8 Topenstack port unset --fixed-ip subnet=<subnet>,ip-address=<ip-address> <port id>
4 l5 I0 O9 e; T8 Y0 v, }Get details on a port
0 ?, x4 Y; ^+ ~9 N7 E0 g9 O0 {1
/ h9 k8 X& J% d1 zopenstack port show <port id>6 s, Q8 n, U/ l: x+ ]8 `4 h, T3 l* S
23 c$ D, } t. ]. H
neutron port-show <port id>6 L( t# `( m* R1 c
Allowed address pairs - (Allows one port to add additional IP/MAC address pairs on that port to allow traffic that matches those specified values.)
6 ~. z/ U" X' P& F) L( a. Q1
- m* [, p, Q6 W6 Mneutron port-update <port-uuid> --allowed-address-pairs type=dict list=true ip_address='0.0.0.0/0'
0 V, g# ]8 S" y+ B0 J" LGlance:
/ Q" Z+ A W7 b" @: ]" WList images
9 s5 [; \ ^5 N* s1 y1
/ j3 E' t; ~, _7 v/ T4 i: k1 b& ]3 [openstack image list
9 A7 @' Q: B1 W( N2
# ?* A. }- {( _/ I8 y, Fglance image-list- c U7 ~% |8 c1 S
Get details on an image
- l, d! n% ~7 Z1 q& o18 z: B# o. U, f8 f
glance image-show <image id>9 D% ]9 ?; n S
Upload a image
: r8 @; r+ e3 Z5 P1+ W5 N& `/ L o1 q/ b1 ^
openstack image create --disk-format qcow2 --container-format bare --public --file ./centos7.qcow2 centos7-image( ?) y' p% d) @6 x% j" i/ E
Delete1 t0 j% |; |5 M3 \& r7 R5 C/ _; v% ^7 e9 U
1
7 |# I D( {# U F7 ?openstack image delete <ID>& P9 y R7 O- k' [' j: V5 m
Download a image
0 X& I3 V, b* d6 @8 G7 @1
1 V7 r K9 t/ k/ o( aglance image-download <img-id> --file img.qcow27 \$ ~7 Z; ]6 v# q; a" h3 x+ @
Change state
( N" g9 D" O7 C# `14 w6 P+ G- \+ @
cinder reset-state --state in-use <id>5 L; r, {% z4 X" e3 U# O5 p/ i
Other:
# ~& w$ l+ I( R- M+ o8 O2 gList flavors; n2 }0 N( h7 {( i, n7 o( Q- }
1
# j2 ? M u( D" x0 `openstack flavor list
; w3 J- ^( y& G4 y2 GList keypairs$ W5 N' N% I( q1 m
1! Z" i4 p- R# d3 V& g
openstack keypair list+ d; d3 t- z$ D# k, ^* w
List Security groups
8 ~7 G) m* r5 m& h3 K1
# S8 o5 ~6 i9 o" A! h4 F6 e6 o3 Q9 Xopenstack security group list
8 w# y/ L' w2 O ~Cinder# E6 U8 I; |* q5 h
12 l# Q5 Y/ o) u; ^# T
openstack volume set --state error <id>
, ]! s) F. e# _1 t8 k8 G1 x$ mStop a migraion( q2 u8 O; @9 Z$ n- t
0 C1 h7 k: N* l7 Z/ [; ?& B- DRemove the active volume from the migration state0 `: W$ s8 k; k, h2 H+ L& w
$ G' @- E7 Y( k
1: O @; e8 r, q; F
cinder reset-state <id> --reset-migration-status
" _# P2 _, Q. y5 U. F$ kfind the volume in the attaching state and remove it
* N: T g8 V1 c- c5 m, c# _5 |! X& e; u0 W/ L% U& P. \4 m# A7 }
1
! v8 O: {" a- l% hopenstack volume list Z0 \' H5 U/ `* F1 O1 `, n
1
7 x% R: G5 ~+ _cinder reset-state <id> --state error* d% F$ L- P2 K" q7 V
1
6 x2 v+ }7 g8 F' H8 r( [- scinder reset-state <id> --reset-migration-status
& Z) ~! [9 n* f% y8 Yopenstack volume delete <id>. G4 T7 y6 l6 z; W7 Z, S
18 q4 M$ h2 E2 f( H
openstack volume delete <id> |
|