Exemple #1
0
    def create(self, caller_task, options):
        assert caller_task
        assert options
        assert 'template' in options
        assert 'vmid' in options
        assert 'hdd' in options
        assert 'ram' in options
        assert 'cpu' in options
        assert 'user' in options
        assert 'ip' in options
        assert 'gateway' in options
        assert 'netmask' in options
        assert 'hostname' in options
        assert 'dns1' in options
        assert 'dns2' in options

        shell_proxy_options = {}
        for option in options:
            shell_proxy_options[option.upper()] = options[option]

        shell_proxy_options['SUBCOMMAND'] = self.CREATE_CMD

        vps_tpl = VpsTemplate(options['template'])
        shell_proxy_options['TEMPLATE'] = vps_tpl.template

        logger.info("Create KVM using template %s (%s)" %
                    (options['template'], vps_tpl.template))

        self._render_template('%s.boot.template' % vps_tpl.template,
                              '%s.boot.pxe' % options['vmid'], options)
        self._render_template('%s.template' % vps_tpl.template,
                              '%s.pxe' % options['vmid'], options)

        return shell_hook(caller_task, 'vps_cmd_proxy', shell_proxy_options)
Exemple #2
0
    def create(self, caller_task, options):
        assert caller_task
        assert options
        assert 'template' in options
        assert 'vmid' in options
        assert 'hdd' in options
        assert 'ram' in options
        assert 'cpu' in options
        assert 'user' in options
        assert 'ip' in options
        assert 'gateway' in options
        assert 'netmask' in options
        assert 'hostname' in options
        assert 'dns1' in options
        assert 'dns2' in options

        shell_proxy_options = {}
        for option in options:
            shell_proxy_options[option.upper()] = options[option]

        shell_proxy_options['SUBCOMMAND'] = self.CREATE_CMD

        vps_tpl = VpsTemplate(options['template'])

        shell_proxy_options['TEMPLATE'] = vps_tpl.template

        return shell_hook(caller_task, 'vps_cmd_proxy', shell_proxy_options)
Exemple #3
0
    def create(self, caller_task, options):
        assert caller_task
        assert options
        assert 'template' in options
        assert 'vmid' in options
        assert 'hdd' in options
        assert 'ram' in options
        assert 'cpu' in options
        assert 'user' in options
        assert 'ip' in options
        assert 'gateway' in options
        assert 'netmask' in options
        assert 'hostname' in options
        assert 'dns1' in options
        assert 'dns2' in options

        shell_proxy_options = {}
        for option in options:
            shell_proxy_options[option.upper()] = options[option]

        shell_proxy_options['SUBCOMMAND'] = self.CREATE_CMD

        vps_tpl = VpsTemplate(options['template'])
        shell_proxy_options['TEMPLATE'] = vps_tpl.template

        logger.info("Create KVM using template %s (%s)" % (options['template'], vps_tpl.template))

        self._render_template('%s.boot.template' % vps_tpl.template, '%s.boot.pxe' % options['vmid'], options)
        self._render_template('%s.template' % vps_tpl.template, '%s.pxe' % options['vmid'], options)

        return shell_hook(caller_task, 'vps_cmd_proxy', shell_proxy_options)
Exemple #4
0
    def create(self, caller_task, options):
        assert caller_task
        assert options
        assert 'template' in options
        assert 'vmid' in options
        assert 'hdd' in options
        assert 'ram' in options
        assert 'cpu' in options
        assert 'user' in options
        assert 'ip' in options
        assert 'gateway' in options
        assert 'netmask' in options
        assert 'hostname' in options
        assert 'dns1' in options
        assert 'dns2' in options

        shell_proxy_options = {}
        for option in options:
            shell_proxy_options[option.upper()] = options[option]

        shell_proxy_options['SUBCOMMAND'] = self.CREATE_CMD

        vps_tpl = VpsTemplate(options['template'])

        shell_proxy_options['TEMPLATE'] = vps_tpl.template

        return shell_hook(caller_task, 'vps_cmd_proxy', shell_proxy_options)
Exemple #5
0
    def stop(self, caller_task, options):
        assert caller_task
        assert options

        options['SUBCOMMAND'] = self.STOP_CMD

        shell_proxy_options = {}
        for option in options:
            shell_proxy_options[option.upper()] = options[option]

        return shell_hook(caller_task, 'vps_cmd_proxy', shell_proxy_options)
Exemple #6
0
    def stop(self, caller_task, options):
        assert caller_task
        assert options

        options['SUBCOMMAND'] = self.STOP_CMD

        shell_proxy_options = {}
        for option in options:
            shell_proxy_options[option.upper()] = options[option]

        return shell_hook(caller_task, 'vps_cmd_proxy', shell_proxy_options)