Merge pull request #11776 from Nibbler999/swap

Add swap option
This commit is contained in:
Joseph Hall 2014-04-04 14:38:26 -06:00
commit 0598405d41

View File

@ -109,6 +109,15 @@ def get_password(vm_):
)
def get_swap(vm_):
'''
Return the amount of swap space to use
'''
return config.get_cloud_config_value(
'swap', vm_, __opts__, default=128
)
def create(vm_):
'''
Create a single VM from a data dict
@ -132,7 +141,8 @@ def create(vm_):
'image': get_image(conn, vm_),
'size': get_size(conn, vm_),
'location': get_location(conn, vm_),
'auth': NodeAuthPassword(get_password(vm_))
'auth': NodeAuthPassword(get_password(vm_)),
'ex_swap': get_swap(vm_)
}
salt.utils.cloud.fire_event(
@ -142,7 +152,8 @@ def create(vm_):
{'kwargs': {'name': kwargs['name'],
'image': kwargs['image'].name,
'size': kwargs['size'].name,
'location': kwargs['location'].name}},
'location': kwargs['location'].name,
'ex_swap': kwargs['ex_swap']}},
transport=__opts__['transport']
)