2017 © Pedro PelĂĄez
 

library libvirt-php

Virtual Machine Manager

image

weelrs8/libvirt-php

Virtual Machine Manager

  • Friday, May 8, 2015
  • by zephx
  • Repository
  • 3 Watchers
  • 2 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 9 % Grown

The README.md

Libvirt PHP

Conectando na Plataforma

<?php
use LibvirtPHP\App\Libvirt;
use LibvirtPHP\Auth\QemuTcp;

$app = new Libvirt();
$app->connect(
    new QemuTcp(
        'example.com',
        [
            'username' => 'user',
            'password' => 'pass'
        ]
    )
);

Criando um novo DomĂ­nio

<?php

$app->newDomain(
    100, // ID do DomĂ­nio
    1,   // VCPU = 1
    1,   // MemĂłria = 1GB
    [
        'size' => 10,   // HD = 10GB
        'path' => ini_get('libvirt.image_path')     // DiretĂłrio onde ficarĂĄ salvo a imagem
    ],
    'bridge:br0',   // Rede
    [
        'path' => 'http://172.17.10.180/pub/centos/6.6/os/x86_64',   // PXE
        'ks'   => 'http://172.17.10.180/pub/centos/6.6/ks.cfg'   // Kickstart
    ],
    [
        'type' => 'linux',   // linux, windows
        'variant' => 'rhel6'    // rhel6, win7
    ]
);

Exibindo todos os Dominios

<?php

$app->getDomains();

Gerenciando um DomĂ­nio EspecĂ­fico

<?php

$app->getDomainManager('domain_id')->powerOn();

$app->getDomainManager('domain_id')->powerOff();

$app->getDomainManager('domain_id')->forceOff();

$app->getDomainManager('domain_id')->reboot();

$app->getDomainManager('domain_id')->getInfo();

The Versions

08/05 2015

dev-master

9999999-dev

Virtual Machine Manager

  Sources   Download

GNU

The Requires

 

php kvm xen libvirt