Compute Example - Create a node

from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver cls = get_driver ( Provider . RACKSPACE ) driver = cls ( 'username' , 'api key' , region = 'iad' ) sizes = driver . list_sizes () images = driver . list_images () size = [ s for s in sizes if s . id == 'performance1-1' ][ 0 ] image = [ i for i in images if 'Ubuntu 18.04' in i . name ][ 0 ] node = driver . create_node ( name = 'libcloud' , size = size , image = image ) print ( node )

For information on what the code does, click or hover over the line.

For more compute examples, see documentation.