0

I have read about disk profiles for salt-virt. I have created a disk profile accordingly.

virt.disk:
  default:
    - system:
        size: 8192
  kmaster:
    - system:
        size: 40000
  knode:
    - system:
        size: 40000
    - data:
        size: 80000

I understand that when I create a vm now via salt virt.init

salt 'myminion' virt.init knode20.localdomain ${NODE_CPU} ${NODE_MEM} salt://files/images/centos7-salt.qcow2 install=False start=True seed=True nic='default' disk=knode enable_vnc=True

, the system disk image will be a seeded version of the disk image I provide via the salt://files/images uri. However I am not clear on how the second disk (my data disk) shoould get handled, I don't think salt virt.init will do a qemu-img create for example. Can I pass a list of source images in the call to virt.init (one for system, one for data).

Or do I just have to add the second disk manually later (uin which case what is the point of the disk profile?)

rtmie
  • 151
  • 3

1 Answers1

1

So to answer my own question, if the "image" parameter is set in the call to init, then salt virt will assume that it is the only disk and force the default disk profile. From current release code:

    if image:  # with disk template image                                   
        log.debug('Image {0} will be used'.format(image))
        # if image was used, assume only one disk, i.e. the                 
        # 'default' disk profile                                            
        # TODO: make it possible to use disk profiles and use the           
        # template image as the system disk                                 
        diskp = _disk_profile('default', hypervisor, **kwargs)
        log.debug('Disk profile is {0}'.format(diskp))
rtmie
  • 151
  • 3