定制 the-basement/libvirt 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

the-basement/libvirt

最新稳定版本:v0.1.0

Composer 安装命令:

composer require the-basement/libvirt

包简介

This package implements the domain service contract for the libvirt hypervisor.

README 文档

README

Latest Version on Packagist Software License Total Downloads

This package is a basic QEMU management interface using the interfaces from the-basement/common.

Install

Via Composer

$ composer require the-basement/libvirt

Basic Usage

Creating a VM in QEMU/KVM

// This assumes you have an ubuntu server image available from your KVM host
// This also assumes the default image location of the disks created by KVM.
// Both of these can be changed; disks that exist will not be overwritten
// disks that don't exist will be created.
$service = new TheBasement\Libvirt\LibvirtService();
$service->createServer([
    'name' => 'my-virtual-machine',
    'memory' => (string) (1024 * 1024), // 1G in KiB
    'cores' => 1,
    'threads' => 1,
    'iso_path' => '/var/lib/libvirt/iso/ubuntu-22.04.4-live-server-amd64.iso',
    'storage_pool' => 'default',
    'network_mac' => '',
    'video_ram' => '65536', // bytes of video ram
    'disk_path' => '/var/lib/libvirt/images/ubuntu22.04-2.qcow2',
    'disk_name' => 'ubuntu22.04-2.qcow2',
    'disk_capacity' => 10 * 1024 * 1024 * 1024, // 10 GB in bytes
]);

// Gets all servers defined for the KVM
$servers = $service->findAllServers();

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email security@austinkregel.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-13