Package: python-shka-gadgets-openstackclient
Author:Shintaro KatayamaContentspython-shka-gadgets-openstackclientGetting StartedExampleCopyrightpython-shka-gadgets-openstackclientThis is a plugin of OpenStackClient (a.k.a. OSC) to make a single and
simple virtual machine handy. In a typical use-case, the virtual
machine (names “vanilla” here) given a floating IP address is created
and used interactively. Sometimes the vanilla would be shelved; the
floating IP address and the security rules are taken away when it is
shelved, and these are given again when it is unshelved. After the
interactive tasks, the given resources and the images would be cleaned
out. The “vanilla” plugin simplifies such resource management in the
project work.Getting Startedsshfsandcurlare prerequisites, and this plugin can be installed
from PyPI using pip. It will install also a minimal OSC
(=python-openstackclient) for the “vanilla” server management.Examplepython3-mvenvvenv3../venv3/bin/activatepip3installpython-shka-gadgets-openstackclient../openrc.shTheopenrc.shhere is a script for OSC environment, which you can
download from the OpenStack dashboard of your project. The script will
ask a password of the project.openstackvanillacreate--flavorstandard.tiny--key-namemykey--imageUbuntu-18.04--loginubuntutestIt creates a vanilla server namedtestonstandard.tinyflavor from
the Ubuntu 18.04 image. The specified key pair must be registered
already. It gives a floating IP address to the vanilla and prepares a
security group to login via ssh. And, in this case, the home directory
of userubuntuis accessible from./vanillavia sshfs.openstackserverssh--loginubuntutestYou can login totestas avobe if the login name isubuntu.openstackvanillashelvetestIt shelvestest- It’s good when you will leave the project
temporarily. The floating IP address and the security group is taken
away. The old image used for the previous unshelve is removed. The./vanillafolder would be unmounted.openstackvanillaunshelve--loginubuntutestYou can unshelvetestwhen you restart the project. The floating IP
address and the security group are configured again. The./vanillafolder would be mounted again.openstackvanillaresize--flavorstandard.xxlarge--loginubuntutestYou can resizetestwhen you need more power, if the project supports it. The./vanillafolder would be mounted again.openstackvanilladeletetestAfter the project you can removetestcompletely.There are more subcommands and the options of each subcommand.--helpoption will show them. For example,$openstackvanilla--helpCommand"vanilla"matches:vanillaallowmevanillacreatevanilladeletevanilladenyusvanillagiveipvanillamountvanillaresizevanillashelvevanillashowidvanillashowipvanillashowmyipvanillashowstatusvanillatakeipvanillaunmountvanillaunshelvevanillawaitsshd$openstackvanillacreate--helpusage:openstackvanillacreate[-h][--add-port<port>]--flavor<flavor>--login<login-name>[--mount<mount-point>]--key-name<key-name>--image<image>[--volume<volume>]<server>Createavanillaserver.positionalarguments:<server>Server(nameorID)optionalarguments:-h,--helpshowthishelpmessageandexit--add-port<port>Destinationport(allowmultipletimes,default:[22])--flavor<flavor>Createwiththisflavor(nameorID)--login<login-name>Loginnameforsshfsmount(ssh-loption)--mount<mount-point>Directoryofthevanillaservertomount(default:~)--key-name<key-name>Keypairtoinjectintothisserver(optionalextension)--image<image>Createserverbootdiskfromthisimage(nameorID)--volume<volume>Volume(sizeinGBforneworIDtomount)Thiscommandisprovidedbythepython-shka-gadgets-openstackclientplugin.$CopyrightSee ./LICENSE