Created
September 8, 2013 20:25
-
-
Save vpetersson/6488106 to your computer and use it in GitHub Desktop.
Simple snippet for creating servers on CloudSigma via the python module.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cloudsigma | |
name = 'SomeName' | |
drive = cloudsigma.resource.Drive() | |
server = cloudsigma.resource.Server() | |
gb_in_bytes = 1024 * 1024 ** 2 | |
test_disk = { | |
'name': name, | |
'size': 1073741824 * 15, | |
'media': 'disk' | |
} | |
my_test_disk = drive.create(test_disk) | |
test_server = { | |
'name': name, | |
'cpu': 2000, | |
'mem': gb_in_bytes * 2, | |
'vnc_password': 'ChangeMeNow', | |
'drives': [{ | |
'boot_order': 1, | |
'dev_channel': '0:0', | |
'device': 'virtio', | |
'drive': my_test_disk['uuid'] | |
}], | |
'nics': [{ | |
'ip_v4_conf': { | |
'conf': 'dhcp', | |
'ip': None | |
}, | |
'model': 'virtio', | |
'vlan': None | |
}], | |
} | |
my_test_server = server.create(test_server) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment