Example #1
0
class MyAhvVmResources(AhvVmResources):

    memory = 4
    vCPUs = 2
    cores_per_vCPU = 1
    disks = [
        AhvVmDisk("Centos7"),
        AhvVmDisk.CdRom("SQLServer2014SP2-FullSlipstream-x64"),
        AhvVmDisk.CdRom.Sata("SQLServer2014SP2-FullSlipstream-x64"),
        AhvVmDisk.CdRom.Ide("SQLServer2014SP2-FullSlipstream-x64"),
        AhvVmDisk.Disk.Scsi.cloneFromImageService("AHV_CENTOS_76", bootable=True),
        AhvVmDisk.Disk.Pci.allocateOnStorageContainer(12),
        AhvVmDisk.CdRom.Sata.emptyCdRom(),
        AhvVmDisk.CdRom.Ide.emptyCdRom(),
        AhvVmDisk.Disk.Scsi.cloneFromVMDiskPackage(Era_Disk),
        AhvVmDisk.CdRom.Sata.cloneFromVMDiskPackage(Virtio_CdRom)
    ]
    nics = [
        AhvVmNic("vlan.0"),
        AhvVmNic.DirectNic.egress("vlan.0")
    ]

    guest_customization = AhvVmGC.CloudInit(filename="scripts/guest_cus.yaml")

    serial_ports = {0: False, 1: False, 2: True, 3: True}
Example #2
0
class MyAhvVmResources(AhvVmResources):

    memory = 4
    vCPUs = 2
    cores_per_vCPU = 1
    disks = [
        AhvVmDisk("Centos7"),
        AhvVmDisk.CdRom("SQLServer2014SP2-FullSlipstream-x64"),
        AhvVmDisk.CdRom.Sata("SQLServer2014SP2-FullSlipstream-x64"),
        AhvVmDisk.CdRom.Ide("SQLServer2014SP2-FullSlipstream-x64"),
        AhvVmDisk.Disk.Scsi.cloneFromImageService("AHV_CENTOS_76"),
        AhvVmDisk.Disk.Pci.allocateOnStorageContainer(12),
        AhvVmDisk.CdRom.Sata.emptyCdRom(),
        AhvVmDisk.CdRom.Ide.emptyCdRom(),
        AhvVmDisk.Disk.Scsi.cloneFromVMDiskPackage(Era_Disk, bootable=True),
        AhvVmDisk.CdRom.Sata.cloneFromVMDiskPackage(Virtio_CdRom),
    ]
    nics = [AhvVmNic("vlan.0"), AhvVmNic.DirectNic.egress("vlan.0")]

    guest_customization = AhvVmGC.CloudInit(
        config={
            "users": [{
                "name": "centos",
                "ssh-authorized-keys": [CENTOS_PUBLIC_KEY],
                "sudo": ["ALL=(ALL) NOPASSWD:ALL"],
            }]
        })

    serial_ports = {0: False, 1: False, 2: True, 3: True}
Example #3
0
class MyAhvVmResources(AhvVmResources):

    memory = 4
    vCPUs = 2
    cores_per_vCPU = 1
    disks = [
        AhvVmDisk(CENTOS_HM),
        AhvVmDisk.CdRom(SQL_SERVER_IMAGE),
        AhvVmDisk.CdRom.Sata(SQL_SERVER_IMAGE),
        AhvVmDisk.CdRom.Ide(SQL_SERVER_IMAGE),
        AhvVmDisk.Disk.Scsi.cloneFromImageService(CENTOS_CI),
        AhvVmDisk.Disk.Pci.allocateOnStorageContainer(12),
        AhvVmDisk.CdRom.Sata.emptyCdRom(),
        AhvVmDisk.CdRom.Ide.emptyCdRom(),
        AhvVmDisk.Disk.Scsi.cloneFromVMDiskPackage(Era_Disk, bootable=True),
        AhvVmDisk.CdRom.Sata.cloneFromVMDiskPackage(Virtio_CdRom),
    ]
    nics = [AhvVmNic(NETWORK1), AhvVmNic.DirectNic.egress(NETWORK1)]

    guest_customization = AhvVmGC.CloudInit(
        config={
            "users": [{
                "name": "centos",
                "ssh-authorized-keys": [CENTOS_PUBLIC_KEY],
                "sudo": ["ALL=(ALL) NOPASSWD:ALL"],
            }]
        })

    serial_ports = {0: False, 1: False, 2: True, 3: True}
Example #4
0
class MyAhvVmResources2(AhvVmResources):

    memory = 4
    vCPUs = 2
    cores_per_vCPU = 1
    disks = [
        AhvVmDisk("Centos7"),
        AhvVmDisk.Disk.Pci.cloneFromImageService("AHV_CENTOS_76", bootable=True),
        AhvVmDisk.CdRom.Ide.emptyCdRom(),
    ]
    nics = [AhvVmNic("vlan.0"), AhvVmNic.DirectNic.egress("vlan.0")]

    guest_customization = AhvVmGC.CloudInit(
        config={
            "users": [
                {
                    "name": "centos",
                    "ssh-authorized-keys": [CENTOS_PUBLIC_KEY],
                    "sudo": ["ALL=(ALL) NOPASSWD:ALL"],
                }
            ]
        }
    )

    serial_ports = {0: False, 1: False, 2: True, 3: True}
Example #5
0
class MyAhvVm(AhvVm):

    memory = 2
    vCPUs = 2
    cores_per_vCPU = 1
    disks = [
        AhvVmDisk(image_name="Centos7", bootable=True),
        AhvVmDisk.CdRom(image_name="SQLServer2014SP2"),
        AhvVmDisk.CdRom.Sata(image_name="SQLServer2014SP2"),
        AhvVmDisk.Disk.Scsi.cloneFromImageService(image_name="AHV_CENTOS_76"),
        AhvVmDisk.Disk.Pci.allocateOnStorageContainer(size=12),
        AhvVmDisk.CdRom.Sata.emptyCdRom(),
        AhvVmDisk.CdRom.Ide.emptyCdRom(),
        AhvVmDisk.Disk.Scsi.cloneFromVMDiskPackage(Era),
    ]
    nics = [
        AhvVmNic(subnet="vlan.0", cluster="calmdev1"),
        AhvVmNic.DirectNic.egress(subnet="vlan.0", cluster="calmdev1"),
        AhvVmNic.DirectNic.ingress(subnet="vlan.0", cluster="calmdev1"),
        AhvVmNic.DirectNic.tap(subnet="vlan.0"),
        AhvVmNic.NormalNic.egress(subnet="vlan.0", cluster="calmdev1"),
        AhvVmNic.NormalNic.ingress(subnet="vlan.0"),
        AhvVmNic.NormalNic.tap(subnet="vlan.0"),
        AhvVmNic.NetworkFunctionNic.tap(),
        AhvVmNic.NetworkFunctionNic(),
        AhvVmNic("@@{substrate_variable}@@"),
    ]
    boot_type = "UEFI"
    """
    guest_customization = AhvVmGC.Sysprep.PreparedScript.withDomain(
        filename="guest_cus.xml",
        domain="1.1.1.1",
        dns_ip="1.1.1.1",
        credential=ref(DefaultCred),
    )
    """
    guest_customization = AhvVmGC.CloudInit(
        filename="specs/guest_cust_cloud_init.yaml")

    serial_ports = {0: False, 1: False, 2: True, 3: True}

    gpus = [
        AhvVmGpu.Amd.passThroughCompute(device_id=111),
        AhvVmGpu.Nvidia.virtual(device_id=212),
    ]
Example #6
0
class MyAhvVmResources(AhvVmResources):

    memory = 4
    vCPUs = 2
    cores_per_vCPU = 1
    disks = [
        AhvVmDisk(CENTOS_CI, bootable=True),
        AhvVmDisk.Disk.Pci.allocateOnStorageContainer(12),
    ]
    nics = [AhvVmNic(NETWORK1)]

    serial_ports = {0: False, 1: False, 2: True, 3: True}
Example #7
0
class MyAhvVmResources(AhvVmResources):

    memory = 4
    vCPUs = 2
    cores_per_vCPU = 1
    disks = [
        AhvVmDisk(CENTOS_CI),
    ]
    nics = [AhvVmNic(NETWORK1)]

    guest_customization = AhvVmGC.CloudInit(
        config={
            "users": [{
                "name": "centos",
                "ssh-authorized-keys": [CENTOS_PUBLIC_KEY],
                "sudo": ["ALL=(ALL) NOPASSWD:ALL"],
            }]
        })

    serial_ports = {0: False, 1: False, 2: True, 3: True}