Skip to content

Instantly share code, notes, and snippets.

@0xIslamTaha
Last active July 26, 2018 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xIslamTaha/87f5235897abfc705c7188b92f9a53d0 to your computer and use it in GitHub Desktop.
Save 0xIslamTaha/87f5235897abfc705c7188b92f9a53d0 to your computer and use it in GitHub Desktop.
# Your machine is running zrobot in tmux
# bash: `zrobot server start -T http://github.com/zero-os/0-templates -T http://github.com/jumpscale/digital_me`
# You created a robot connected to this zrobot
# You need a ZOS machine registered to the capacity
# Both machines are in the same ZT NW
NODE_ID=''
ZT_ID=''
ZT_TOKEN=''
robot = j.clients.zrobot.robots['main']
robot.services.find_or_create('github.com/zero-os/0-templates/zerotier_client/0.0.1',
'xTremX', {'token':ZT_TOKEN})
data = {
'nodeId': NODE_ID,
'disks': [{
'diskType': 'ssd',
'size': 10,
'mountPoint': '/mnt',
'filesystem': 'btrfs',
'label': 'xtremx'
}],
'image': 'ubuntu',
'memory': 2048,
'cpu':4,
'zerotier': {'id':ZT_ID, 'ztClient': 'xTremX'},
'configs': [{'path': '/root/.ssh/authorized_keys', 'content': mykey, 'name': 'sshkey'}]
}
vmservice = robot.services.create('github.com/jumpscale/digital_me/vm/0.0.1', service_name='vm001', data=data)
vmservice.schedule_action('install').wait(die=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment