Ejemplo n.º 1
0
def datastore_create(cmd, client: AVSClient, resource_group_name, private_cloud, cluster, name, nfs_provider_ip=None, nfs_file_path=None, endpoints=[], lun_name=None):
    from azext_vmware.vendored_sdks.avs_client.models import Datastore, NetAppVolume, DiskPoolVolume
    datastore = Datastore()
    if nfs_provider_ip is not None or nfs_file_path is not None:
        datastore.net_app_volume = NetAppVolume(nfs_provider_ip=nfs_provider_ip, nfs_file_path=nfs_file_path)
    if len(endpoints) > 0 or lun_name is not None:
        datastore.disk_pool_volume = DiskPoolVolume(endpoints=endpoints, lun_name=lun_name)
    return client.datastores.begin_create(resource_group_name=resource_group_name, private_cloud_name=private_cloud, cluster_name=cluster, datastore_name=name, datastore=datastore)
Ejemplo n.º 2
0
def datastore_netappvolume_create(client: AVSClient, resource_group_name,
                                  private_cloud, cluster, name, volume_id):
    from azext_vmware.vendored_sdks.avs_client.models import NetAppVolume
    net_app_volume = NetAppVolume(id=volume_id)
    return client.datastores.begin_create_or_update(
        resource_group_name=resource_group_name,
        private_cloud_name=private_cloud,
        cluster_name=cluster,
        datastore_name=name,
        net_app_volume=net_app_volume,
        disk_pool_volume=None)